Arm+linux Bare metal environment jlink+eclipse+arm-linux-gdb online nude (end) __linux

Source: Internet
Author: User
Tags jlink gdb debugger

The Jlink plugin used in this article is here

http://download.csdn.net/detail/king_bingge/5879179

Two Prerequisites:

1. Eclipse has been successfully installed, taking into account version compatibility issues, does not apply to Redhat6 's own eclipse. How to install, before the blog has been mentioned, no longer repeat;

2, has been successful, the installation of Arm-linux-gdb debugging tools, the previous blog has been installed to complete.


The next step is to build the debugging environment

Considering that sometimes bugs are inevitable, so we have to debug the program, in order to more convenient development, we unified use in the Linux environment in the face of the program debugging.


First, hardware connection

1, OK6410 target board power line, Jtag line, serial line respectively;

2, open the virtual machine, the lower right corner of the USB port, serial connect on;

3, the development of the Board to set up the SD, and then use our SD card in the MMC-led program to erase NAND flash;

4, the Development Board set to NAND flash start.


This concludes the first part.


Second, Jlink Software installation

1. Execute command tar zxvf jlink_linux_v434a.tgz and enter the catalogue;

2, and then execute the command cp-d libjlinkarm.so.4*/usr/lib-f copy the library into the Lib, as shown below:


3, the final implementation./jlinkgdbserver the Jlink prompt on the normal connection appears, and the words ID and ARM11 are displayed.

Here Jlink this part finished, note to always maintain jlink connection, facilitate subsequent debugging.


4, install Plug-ins (this step is very important AH)

Start Eclipse and go to the following interface


Once entered, set in the following order


Finally finish, note that this step must require the virtual machine to the Internet Ah, this must be guaranteed. The installation plug-in is installed online.

Iii. Eclipse Tool Configuration

1, start Eclipse, enter the following interface


2, after the construction of the project, the following interface will appear:



3, the project has been established, the next is configured, the above figure


4, and then enter the configuration interface in order to follow the diagram

A Double click the red font ' 1 ' and then come out led default option

B Click on the red font ' 2 ' and set it on the right

C in the following browse to select the file you want to debug, remember must be elf format

D Change the GDB debugger below debugger to Arm-linux-gdb

E command inside the ' initial ' command is going to enter our initialization target board code, I am OK6410 code as follows

# Tiny6410_config Connect to the J-link gdb server target Remote localhost:2331 # Set JTAG speed to kHz monitor Endia n Little Monitor Speed # Reset the target monitor reset monitor sleep # CPU Core initialization R) # Set the processor mode monitor reg CPSR = 0xd3 #config MMU #flush v3/v4 Cache Monitor CP15 7, 7, 0, 0 = 0x0 #/* flu
SH v4 TLB */Monitor CP15 8, 7, 0, 0 = 0x0 #disable MMU stuff and caches monitor CP15 1, 0, 0, 0 =0x1002 #Peri Port Setup  Monitor CP15 2, 0, 4 = 0x70000013 #disable watchdog monitor MemU32 0x7e004000 = 0x00000000 Monitor Sleep #disable  Interrupt monitor MemU32 0x71200014 = 0x00000000 Monitor MemU32 0x71300014 = 0x00000000 Monitor MemU32 0x7120000c =   0x00000000 Monitor MemU32 0x7130000c = 0x00000000 Monitor MemU32 0x71200f00 = 0x00000000 Monitor MemU32 0x71300f00 = 0x00000000 #set Clock monitor MemU32 0x7e00f900 = 0x0000801e monitor MemU32 0x7e00f000 = 0x0000ffff Monitor MemU32 0x7e00f004 = 0x0000fffF monitor MemU32 0x7e00f020 = 0x01043310 monitor MemU32 0x7e00f00c = 0xc2150601 monitor MemU32 0x7e00f010 = 0xc21506 Monitor MemU32 0x7e00f024 = 0x00000003 monitor MemU32 0x7e00f014 = 0x00200102 monitor MemU32 0x7e00f018 = 0x00000 Monitor MemU32 0x7e00f01c = 0x14000007 #config SDRAM monitor MemU32 0x7e00f120 = 0x00000008 Monitor MemU32 0x7e001 004 = 0x00000004 Monitor MemU32 0x7e001010 = 0x0000040f monitor MemU32 0x7e001014 = 0x00000006 Monitor MemU32 0x7e00 1018 = 0x00000001 Monitor MemU32 0x7e00101c = 0x00000002 monitor MemU32 0x7e001020 = 0x00000006 Monitor MemU32 0x7e0 01024 = 0x0000000a monitor MemU32 0x7e001028 = 0x0000000c monitor MemU32 0x7e00102c = 0x0000018f Monitor MemU32 0x7e 001030 = 0x0000000c Monitor MemU32 0x7e001034 = 0x00000002 monitor MemU32 0x7e001038 = 0x00000002 Monitor MemU32 0x7 e00103c = 0x00000002 Monitor MemU32 0x7e001040 = 0x00000002 monitor MemU32 0x7e001044 = 0x00000013 Monitor MemU32 0x
7e001048 = 0x00000013Monitor MemU32 0x7e00100c = 0x00010012 monitor MemU32 0x7e00104c = 0x00000b45 monitor MemU32 0x7e001200 = 0x000150f8 Monitor MemU32 0x7e001304 = 0x00000000 Monitor MemU32 0x7e001008 = 0x000c0000 monitor MemU32 0x7e001008 = 0x0000000 0 Monitor MemU32 0x7e001008 = 0x00040000 monitor MemU32 0x7e001008 = 0x00040000 monitor MemU32 0x7e001008 = 0x000a00  Monitor MemU32 0x7e001008 = 0x00080032 monitor MemU32 0x7e001004 = 0x00000000 # Setup GDB for faster downloads #set Remote memory-write-packet-size 1024 Set remote memory-write-packet-size 4096 set remote memory-write-packet-size fixed m Onitor speed 12000 Break _start load

The meaning of the specific code is still not understood, first use.

Select Debug after configuration is complete.

Finally, create a soft link on the desktop! Ln-s/opt/eclipse/eclipse/home/xiaobing/desktop

Four, Carry on the debugging

Then you can debug, and then everyone will play it ~ ~ ~ There is no understanding of the details can be discussed ....


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.