(a) Environment:
Target version: TINY6410
os:centos6.5
Ide:eclipse Luna
cdt:v8.3
gdb:v7.5
(ii) Environmental supervision
1, installation Cenntos: Refer to other related articles, here the focus is jlink operation.
2. Install Eclipse: Download http://www.eclipse.org/downloads/
3. Installing CDT: Download http://www.eclipse.org/cdt/downloads.php installation (refer to the official manual: http://help.eclipse.org/luna/index.jsp?topic=// org.eclipse.platform.doc.user/tasks/tasks-127.htm)
4, install Gdbserver: Download ftp://ftp.gnu.org/gnu/gdb/, here is very much version, my personal principle is to install the latest release version of the first 1 or the first two version, my reason is very simple: the latest version may not be very stable need time test, Version too old some subsequent patches and features are incomplete or have historical flaws.
After downloading Gdbserver,
Unzip: Tar zxvf gdb-7.5.tar.gz. This command is not recorded in detail again.
Installation:./configure--target=arm-linux--prefix=/usr/local/arm/bin/-V
Make
Make Ckeck (can be omitted)
Make install
Describe:. /configure parameter--target set the target type, the corresponding parameters can refer to the GNU Official document, or the Readme file under the source file, can get the relevant parameterization.
5, ARM-LINUX-GDB environment variable configuration: You can write arm-linux-gdb path in ROOT/.BASHRC or write in/etc/profile, SOURCE/ROOT/.BASHRC or source/etc/ Profile is the new configured PATH environment variable to take effect.
Note: If you have an arm cross tool chain and configuration and environment variables installed, then this ARM-LINUX-GDB PATH environment variable must be written in front of Arm's cross tool chain because there is also arm-linux-gdb in the arm's toolchain. Our goal here is to use our own ARM-LINUX-GDB server.
6. Install the Jilink for Linux Toolkit:
Download: http://www.segger.com/jlink-software.html. In the official find the corresponding J-link software & documentation pack for Linux, download the source code.
Decompression: TAR-ZXVF jlink_linux_v434a.tgz
Configuration:
MV Libjlinkarm.so.4/usr/lib
MV Libjlinkarm.so.4.34.1/usr/lib
CP 45-JLINK.RULES/ETC/UDEV/RULES.D
Testing: Connecting the Development Board
Connect the USB device Segger Jlink to the virtual machine, in the lower right corner of the icon, right-click
./jlinkgdbserver (in the Jlinkgdbserver directory, you can write to the environment variable)
If successful will prompt arm for information that appears on my computer:
./jlinkgdbserver
SEGGER j-link GDB Server v4.34a
JLinkARM.dll v4.34a (DLL compiled 31 2011 11:51:40)
Listening on TCP/IP port 2331
J-link connected
Firmware:j-link ARM V8 compiled Nov 14 2012 22:34:52
hardware:v8.00
S/N: 17935099
Feature (s): Rdi,flashdl,flashbp,jflash
J-link found 2 JTAG devices, total Irlen = 5
JTAG id:0x07b76f0f (ARM11)
7 Installing the embedded CDT tool in Eclipse ()
Open Eclpse:help/install new software
Enter in work with: http://opensource.zylin.com/zylincdt/
Click Add to enter Zylin OK.
List of options: ZLLINEMBEDDEDCDT
Start a step-by-step installation and restart after installation.
The above source code path may change, need to go to the official to find the latest release path: http://opensource.zylin.com/embeddedcdt.html
8 Commissioning:
Open an arm project and pour into eclipse, these are not the focus here, withheld. There are many references on the Internet. Here is the key to debugging.
After compiling the project, click Run/debug Configuration.
Double-click Zylin Embedded Debug
1 in main window: Configure the program you want to debug. The format is the elf file.
2debug window: Select-〉emdedded GBD in the debugger bar, click Browse in the GDB debug bar in Main in the child window. Select the Arm-llinux-gdb path.
3Commands window: Enter the initialization command, the source of the command is not clear, now with someone else, the following will be dedicated to write a note of how the initialization command is written here.
4 other defaults. Click apply,closed to close the window.
5 Start Debugging. Click the Ladybug icon on the window's toolbar to start. When you move the mouse over the icon, we will display the newly created debug conguation name, such as the debug project name, the wrong ring, and click the arrow next to the icon to select the name you just configured.
6 debug with Debug commands.
The above is confined to my environment.
Theory based on: National embedded Network Course
Reference article: http://blog.chinaunix.net/uid-12461657-id-3336153.html