Use jlink+gdbserver+insight to debug ARM program--Configure insight

Publisher:快乐行者Latest update time:2024-09-19 Source: cnblogsKeywords:jlink  gdbserver  insight Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Download insight-6.8a.tar.bz2
and compile: ./configure --target=arm-linux --prefix=/opt/insight_arm --disable-werror
(1) --target=arm-linux will affect the name of the executable file generated by the installation. For example, the name of the executable file after installation is:
caodan@caodan-Ubuntu:/opt/insight_arm/bin$ ls
arm-linux-gdb arm-linux-insight arm-linux-run tclsh8.4 wish8.4
(2) --prefix=/opt/insight_arm specifies the installation path
(3) --disable-werror disables the -Werror compilation option because it will treat all Warnings as errors, resulting in compilation failure.

2. Compile make
3. Install make install
The directory structure after installation is:
caodan@caodan-Ubuntu:/opt/insight_arm$ ls
bin include info lib man share 4. You may encounter the following problem

when running arm-linux-insight in the terminal : caodan@caodan-Ubuntu:/opt/insight_arm/bin$ ./arm-linux-insight Tk_Init failed: Can't find a usable tk.tcl in the following directories: /opt/insight_arm/share/tk8.4 /opt/insight_arm/lib/tk8.4 /opt/lib/tk8.4 /opt/insight_arm/library /opt/library /opt/tk8.4.1/library /tk8.4.1/library /opt/insight_arm/share/tk8.4/tk.tcl: no event type or button # or keysym no event type or button # or keysym while executing "bind " Listbox { %W yview scroll [expr {- (%D / 120) * 4}] units }" (file "/opt/insight_arm/share/tk8.4/listbox.tcl" line 183) invoked from within "source /opt/insight_arm/share/tk8.4/listbox.tcl" (in namespace eval "::" script line 1) invoked from within "namespace eval :: [list source [file join $::tk_library $file.tcl]]" (procedure "SourceLibFile" line 2) invoked from within "SourceLibFile listbox" (in namespace eval "::tk" script line 4) invoked from within "namespace eval ::tk { SourceLibFile button SourceLibFile entry SourceLibFile listbox SourceLibFile menu SourceLibFile panedwindow SourceLibF ile ..." invoked from within "if {$::tk_library ne ""} { if {[string equal $tcl_platform(platform) "macintosh"]} { proc ::tk::SourceLibFile {file} { if {[catch { namesp..." (file "/opt/insight_arm/share/tk8.4/tk.tcl" line 393) invoked from within "source /opt/insight_arm/share/tk8.4/tk .tcl" ("uplevel" body line 1) invoked from within "uplevel #0 [list source $file]" This probably means that tk wasn't installed properly. The prompt message says that tl is not installed properly. What is tcl? What is tk?















































Tcl is the abbreviation of Tool Command Language, and tk is an X window Tool Kit, which is the application of tcl in X Window System.
Tcl is an interpreter language and a set of C function libraries. Why do we say that? Because the interpreter of tcl is designed as a C function library, providing basic commands and control structures, and any program using tcl can be written according to the specifications of tcl to link with it to add new commands to improve the efficiency of key programs or add new features.
The interpreter of tk is called wish, which is the abbreviation of WIndowing SHell. Just enter wish at the prompt (under xterm). Next, you can see a blank window appear, and the prompt under xterm also changes to the prompt of wish. At this time, enter the following two lines of instructions at the prompt, and you can see the simplest and most amazing tk program:

I don’t know how to solve the problem mentioned above, but the fastest way is to block the wrong line.
Comment out the content near line 181 of share/tk8.4/listbox.tcl
#annotation by caodan
#bind Listbox {
# %W yview scroll [expr {- (%D / 120) * 4}] units
#}
Comment out the content near line 461 of share/tk8.4/text.tcl file
#annotation by caodan
#bind Text {
# %W yview scroll [expr {- (%D / 120) * 4}] units
#}

Execute again and you will find that there is no problem. The interface is as follows:

5. You can create a shortcut in the Dash menu (for Ubuntu users)
caodan@caodan-Ubuntu:/usr/local$ cat /usr/share/applications/insight.desktop
[Desktop Entry]
Name=insight
GenericName=insight-6.8
Comment=graphic interface for debug with gdbserver
Exec=/opt/insight_arm/bin/arm-linux-insight
Terminal=false
Type=Application
StartupNotify=true
Icon=
Categories=Utility;Gnome;tcl;tk;redhat

6. Run jlinkgdbserver, and use insight to connect to gdbserver
The interface of running jlinkgdbserver is as follows, waiting for connection on TCP/IP port 2331:

caodan@caodan-Ubuntu:~/code/asm/S3C6410$ sudo jlinkgdbserver
[sudo] password for caodan:
SEGGER J-Link GDB Server V4.22

JLinkARM.dll V4.22 (DLL compiled Dec 17 2010 17:41:06)

Listening on TCP/IP port 2331

J-Link connected
Firmware: J-Link ARM V8 compiled Dec 16 2010 20:21:29
Hardware: V8.00
S/N: 20100213
Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFULL

J-Link found 2 JTAG devices, Total IRL en = 5
JTAG ID: 0x07B76F0F (ARM11)
J-Link: ARM11 CP15 Settings changed: 0x00450078 from 0x00001002, MMU Off, ICache Off, DCache Off
Info: CP15.0.0: 0x410FB766: ARM, Architecture Unknown architecture
Info: CP15.0.1: 0x1D152152: ICache: 16kB (4*128*32), DCache: 16kB (4*128*32)
DIDR: 6 Breakpoints available and 2 Watchpoints available.

Note: The jlinkgdbserver here is a symbolic link I created myself. For how to use JLinkGDBserver, please refer to other documents.

Run insight and set up a connection to jlinkgdbserver

Note that in the Port area, the above picture shows 1000. Because this parameter cannot be modified, the temporary solution is to set the Hostname to 127.0.0.1:2331.
After the connection is successful, it will be as shown below:

7. How to solve the problem of being unable to set the port number:
(1) You can set the listening port of jlinkgdbserver to 1000 when it starts.
For example:

caodan@caodan-Ubuntu:~/code/asm/S3C6410$ sudo jlinkgdbserver -port 1000
SEGGER J-Link GDB Server V4.22

JLinkARM.dll V4.22 (DLL compiled Dec 17 2010 17:41:06)

Listening on TCP/IP port 1000

J-Link connected
.............................................

(2) Another way is to modify the source code before compiling and change the default port.
The default port in gdb/gdbtk/library/targetselection.itb is 2331.
Modify line 345: pref define gdb/load/$target-portname 2331.
Modify line 809: pref define gdb/load/$target-portname 2331.

Recompile and install.
However, I did not succeed. It may be because something was not cleaned up during make clean. For now, let's use the first method instead.


Keywords:jlink  gdbserver  insight Reference address:Use jlink+gdbserver+insight to debug ARM program--Configure insight

Previous article:S3C6410 bare metal program, LED light flashes
Next article:Chapter 5 Building the test environment for the S3C6410 development board

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号