Home
J-Link GDB Server User Guide
Contents
1. M 25 3 5 12 Mem oera A ee tease ne arr en 25 3 5 13 MeEMU 16 ESAE HE CR VIR REV CORR E pad Fe DRE AA 26 3 5 14 memli32 2 Re AAS eee A Akad RERUM VEDI RI V RET 26 3 5 15 mc IE 26 3 5 16 TA ae Pen mess A seutnlnadeasaeie aie Dales elceg ts 26 3 5 17 FESCUE Acree tesa weal Ate tes icra el cete em OU em I DL De epu cleans M DOSE E MEME DD UR 28 3 5 18 Select A Lade ak 30 3 5 19 semihosting enable eer ke em c cale e ee e x Le ene Pee n e ati 30 3 5 20 semihosting ARMSWI DA e aa cece eee ee A ee eme hee emere messen 30 3 5 21 semihosting ThumbSWI iit aa n ae e aeris eee 30 3 5 22 dopo RP DE 30 3 5 23 izle I EE 31 3 5 24 SPOS Ceca T EU 32 3 5 25 iore E E ME M M AM 32 3 5 26 Walithalt 2 A eh Aha ASA AVE thease dt iret rien ee et 32 J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 3 5 27 WI c 33 3 6 Command lire options e a entrainer lies 34 3 6 1 Dipl 34 3 6 2 D 34 3 6 3 ple a 34 3 7 Running GDB extensions Insight Eclipse etc coooococcnoncnonnonncnncnnncnncnnnannnnos 35 3 7 1 InSigDE siiis eet A A NR METRE er ERU val dave Maa 36 3 7 2 eiie D 40 3 7 3 VAQ AMO LEES 40 4 Flash download and Flash breakpoints ccceeeeeeeeceeeeeeeeeeeeaeeeeeeeeeeneeee
2. eee Sets the SWI number used for semi hosting in thumb mode ThumbSWI setbp Sets an instruction breakpoint at a given address sleep Sleeps for a given time period speed Sets the JTAG speed of J Link J Trace step Performs one or more single instruction steps waithalt Waits for target to halt code execution wice Writes to given IceBreaker register Table 3 1 GDB remote commands GDB sends the remote commands to the GDB Server Remote command are what fol lows the GDB command monitor on the same line If for example you want to start the target CPU you have to either enter monitor go in the GDB console window or include this line in the gdbinit file J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 23 3 5 1 AllowSimulation Syntax AllowSimulation Value Description Enables or disables ARM instruction set simulation Example monitor AllowSimulation 1 Enables ARM instruction set simulation monitor AllowSimulation 0 Disables ARM instruction set simulation 3 5 2 clrbp Syntax CIrBP BPHandle or ci BPHandle Description Removes an instruction breakpoint where BPHandle is the handle of breakpoint to be removed If no handle is specified this command removes all pending breakpoints Example monitor clrbp 1 or monitor ci 1 3 5 3 cp15 Syntax cp15 lt CRn gt CRm lt opl gt lt op2 g
3. Key based license This type of license is used if you already have a J Link but want to enhance its func tionality by using J Link GDB Server In addition to that the key based license is used for trial licenses To enable this type of license you need to obtain a license key from SEGGER Free trial licenses are available upon request from www segger com This license key has to be added to the GDB Server license management How to enter a license key is described in detail in section Entering a license key on page 13 Every license can be used on different PCs but only with the J Link the license is for This means that if you want to use J Link GDB Server with other J Links every J Link needs a license Free evaluation and non commercial use license This type of license comes with J Link GDB Server and is a license for educational and nonprofit use of J Link GDB Server To use this license simply select Start in free mode when the license dialog is opened In this free mode the maximum pro gram size that can be downloaded with J Link GDB Server is limited to 32 KBytes 2 2 1 Built in license This type of license is easiest to use The customer does not need to deal with a license key The software automatically finds out that the connected J Link contains the built in license s To check what licenses the used J Link have simply open the J Link commander JLink exe The J Link commander finds and lists all of the J Link s
4. Reset type Explanation Halt watchpoint The hardware RESET pin is used to reset the CPU After reset release J Link continuously tries to halt the CPU This typically halts the CPU shortly after reset release the CPU can in most 4 systems execute some instructions before it is halted The number of instructions executed depends primarily on the JTAG speed the higher the JTAG speed the faster the CPU can be halted Some CPUs can actually be halted before executing any instruction because the start of the CPU is delayed after reset release Halt DBGRQ The hardware RESET pin is used to reset the CPU After reset release J Link continuously tries to halt the CPU This typically halts the CPU shortly after reset release the CPU can in most 5 systems execute some instructions before it is halted The number of instructions executed depends primarily on the JTAG speed the higher the JTAG speed the faster the CPU can be halted Some CPUs can actually be halted before executing any instruction because the start of the CPU is delayed after reset release Software reset Sets the CPU registers to their after Reset values PC 0 6 CPSR OxD3 Supervisor mode ARM IRQ FIQ disabled All SPSR registers Ox10 All other registers which are unpredictable after reset are set to O The hardware RESET pin is not affected 7 Reserved Software for ATMEL AT91SAM7 MCUs The reset pin of the device is per default disabled This means that the
5. 8x888a97c Reset Handler R H 885 r r 8x888a988 lt Reset_Handler_RON 84 gt rh r 11073741824 6x46666666 8x888a98 4 lt Reset_Handler_ROH 88 gt str rh r5 8x888a988 Reset Handler R H 925 mou r8 16384 0x4000 Program stopped at Ox800a94c 888a94c 262 Using gdbinit files If you use one of our supplied gdbinit files you can abbreviate this sequence The gdbinit files initializes the connection to J Link GDB Server with the default settings J Link GDB Server running on Localhost listening on port 2331 initialzes the core and downloads the specified executable We advise to use our supplied gdbinit files To start Insight with a supplied gdbinit file choose the gdbinit file that is suitable for your target hardware copy it to your project folder and start Insight from your project folder with gdbtk se NameOfYourExecutable and start debug ging Note By default GDB will send relatively small memory write packets during download and reduces so the possible download speed In the supplied gdbinit files is the memory write packet size enlarged to 1024 bytes This enlargement helps to increase the download speed and should not lead to problems with your target hard ware Therefore ignore the warning from the GDB and select Yes in the dialog 2004 2009 SEGGER Microcontroller GmbH amp Co KG 40 Debugging with GDB 3 7 2 Eclipse Eclipse is an open source platform independent software fram
6. monitor semihosting ARMSWI 0x123456 3 5 21 semihosting ThumbSWI Syntax semihosting ThumbSWI Value Description Sets the SWI number used for semi hosting in thumb mode The default value for the ThumbSWI is OxAB Example monitor semihosting ThumbSWI OxAB 3 5 22 setbp Syntax setbp lt Addr gt lt Mask gt or J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH 8 Co KG 31 bi Addr Mask Description Sets an instruction breakpoint at the given address where Mask is the address mask to be used If no mask is specified a default mask of 0x03 is used matches for breakpoints on ARM instructions For breakpoints on THUMB instructions a mask of 0x01 should be specified Example monitor setbp 0x00 monitor setbp 0x100 0x01 3 5 23 sleep Syntax sleep Delay Description Sleeps for a given time where Delay is the time pediod in milliseconds to delay Example monitor sleep 1000 J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 32 Debugging with GDB 3 5 24 speed Syntax speed kHz auto adaptive Description Sets the JTAG speed of J Link J Trace Speed can be either fixed in kHz automatic recognition or adaptive In general Adaptive is recommended if the target has an RTCK signal which is connected to the corresponding RTCK pin of the device S cores only Refer to J Link J Trace User Manual for detailed
7. 0x00000190 lt main 148 gt ldr r3 rii 16 0x00000194 lt main 152 gt add ES c3 1 Oxi De activate FLASH at 0x00000000 that is conne 0x00000198 lt main 156 gt str r3 rii 4 16 set size to OKB Ox0000019c lt main 160 gt ldr r2 r11 4 16 MFBAHR1 Ox00000000 OxO000001a0 lt main 164 gt mov 99328 Ox18401 MFBALR1 0x00000000 Ox000001a4 lt main 168 gt add Ox Ox000001a8 lt main 172 gt add RAM is 12K at 0x00400000 is einitialized as f Ox000001ac lt main 176 gt cmp Activate RAM at 0x00400000 that is connected Ox000001b0 lt main 180 gt bls 0x190 lt main 148 gt set size to 8KB MFBAHR2 Ox00000040 Ox000001b4 lt main 184 gt b 0x160 lt main 100 gt MFBALRZ BLOCK SIZE 8K Debug Flash Embedded debug Cygwin hosted GDB 2 Embedded GDB 10 9 06 3 12 PM Suspended Ei gf Thread 0 Suspended Debugger Process 10 9 06 3 12 PM section text section size 440 total size 2044 Writing register R15 PC 0x00000000 Refer to http www eclipse org for detailed information about Eclipse Note We only support problems directly related to the J Link GDB Server Prob lems and questions related to your remaining toolchain have to be solved on your own 3 7 3 Yagarto The name Yagarto stands for Yet another GNU ARM Toolchain Yagarto is an Eclipse compatible native Windows toolchain and consists of several packages Yagarto itself is the GNU toolchain Binutils
8. Ml start group lib arm7 32b gnu bsp connectme libbsp a AR REA dib arm 32b gnu libftpsur a 1ib arm7 32b gnu libf lash a uL lib arm7 32b gnu libposix a lib arm7 32b gnu libtx a lanl anl lib armn7 32b gnu libdnsclnt a lib arm7 32b gnu libfastip a I lib arm7 32b gnu libaddp a lib arm7 32b gnu libtcpip a L 7 7 7lib 32b gnu lc lgcc lim 1lstdc W1 end group NX W1 Map rom map usr hin arm elf nm n rom elf gt rom sym usr hin arm elf objcopy 0 binary rom elf rom bin 5 4 Setting up the GDB configuration file The GDB will search for the g binit file in the workspace folder from where you start the GDB out of For this you need to copy the init file corresponding to your board from cygdrive c netos63 gnu debugger files into your workspace folder This can easily be done by the following two commands cd cygdrive c netos63 gnu src apps template 32b cp debugger files gdbconnectme jlink gdbinit J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 49 5 5 Debugging the sample application To debug your sample application change your directory to cygdrive c netos63 gnu src apps template 32b cd cygdrive c netos63 gnu src apps template 32b Start the GNU Project Debugger GDB with the compiled sample project by typing gdbtk se image elf into the NET Works 6 3 Build Envi
9. Newlib GCC compiler and the Insight debugger and Yagarto IDE is a compilation of Eclipse CDT and an additional plug in which improves the support for GDB embedded debugging in CDT The maintainer of Yagarto offers also some sample projects for various ARM cores and some tutorials for the work with Eclipse and the GNU ARM toolchain Refer to http www yagarto de for detailed information J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 41 Chapter 4 Flash download and Flash break points This chapter describes how to use the J Link flash download and Flash breakpoint features with the GDB Server J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 42 Flash download and Flash breakpoints 4 1 Licensing Flash download and flash breakpoints are features of the J Link software which require separat licenses from SEGGER 4 2 Enabeling flash download and flash breakpoints To use flash download and flash breakpoints with the J Link GDB Server you have to enable them first This is done by the remote commands 1ash device flash down load and flash breakpoints For more information about the flash device command please refer to chapter Supported remote commands on page 22 For example if you want to enable flash download and flash breakpoints for a Atmel AT91SAM7S256 device simply add the following three lines to the gdbinit file monitor flash devic
10. this command writes the memory content at address lt address gt to register lt RegName gt Otherwise this com mand reads the given register Example monitor reg pc 0x00 monitor reg cpsr 0x1F monitor reg r0 0x40 monitor reg pc 0x100 3 5 16 remoteport Syntax remoteport port Description Changes the port an which the GDB server listens for connections J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG Example monitor remoteport 8000 J Link ARM GDB Server UM08005 27 2004 2009 SEGGER Microcontroller GmbH amp Co KG 28 3 5 17 reset Syntax reset Description Debugging with GDB lt ResetType gt Resets and halts the target CPU using the given reset type If no reset type is speci fied the reset type 0 Normal will be used Add information The following reset types are available Reset type Explanation Normal default if no reset type is specified The hardware RESET pin is used to reset the CPU After reset release J Link continuously tries to halt the CPU This typically halts the CPU shortly after reset release the CPU can in most systems execute some instructions before it is halted The number of instructions executed depends primarily on the JTAG speed the higher the JTAG speed the faster the CPU can be halted Some CPUs can actually be halted before executing any instruction because the start of the CPU is dela
11. LPTask void 4 while 1 4 BSP ToggleLED 1 S Delay 288 H 33 3 3 3 HE DE HE 3 DE 3 3 DE 3 3 3 3 3 3 3 3 3 3 3 3 3 DE 3 3 DE DE 3 3 DE DE 3 3 DE DE 3 3 DE 3 3 3 3 3 3 DE DE JE 3 DE DE 3 3 3 DE 3 3 3 9 3 3 3 3 main HEH HEHEHE HEHEHE HEHE JE JE HEHE JE E JE E JE JE JE EC E JE JE HE E JE E JE JE JE E JE DE JE JE JE JE E JE JE E JE JE JE E JE JE JE IEEE HEE TEES int main void 0S InitKern initialize 0S 0S InitHU initialize Hardware for OS BSP_Init initialize LED ports You need to create at least one task before calling 0S Start OS_CREATETASK amp TCBHP HP Task HPTask 188 StackHP OS_CREATETASK amp TCBLP LP Task LPTask 58 StackLP 0S Start Start multitasking x return 8 Program stopped at line 63 168 63 J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 44 Flash download and Flash breakpoints From now on you can set an unlimited number of breakpoints and debug through the application Below a sample screenshot for using Flash breakpoints when debugging a sample project a 35 include RTUS h 36 winclude BSP h a7 38 OS STACKPTA int StackHP 128 StackLP 128 Task stacks A US TASM TCBHP TCBLP da Task control blocks at
12. Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 20 Debugging with GDB 3 4 Debugging on Cortex M3 devices J Link GDB Server supports debugging on Cortex M3 devices Both debugging in RAM and flash are supported Flash download FlashDL and flash breakpoints FlashBP are also available but require a separate license 3 4 1 Debugging in RAM When debugging in RAM on a Cortex M3 device the stack pointer SP R13 and pro gram counter PC R15 are not automatically set to the start values by most debug gers In order to debug an application in RAM please ensure that PC and SP have correct values before you start to debug the application Typically the start of the vector is the start of the RAM area used for download On most devices this is 0x20000000 This means that the initial value of the stack pointer SP can be read from 0x20000000 and the initial value of the PC can be read from 0x20000004 To ensure that the stack pointer and the PC are initialized correctly you can set them in the gdbinit file as shown below Sample GDB init sequence The following sample GDB init sequence should work on any Cortex M3 device when debugging in RAM Ak Cckckckckckckckckckck ckock ck ck ck ck ck ck ckckckckck ck ck ck ck ck ck ckckckck ck ck k ck ck ck ck ck k kk kk E Connect to J Link and debug application in flash on Cortex M3 E Download to flash is performed E Connect to the J Li
13. Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 48 Using DIGI evalboards Now you can start to compile the sample application which is described under Com piling the sample application on page 48 5 3 Compiling the sample application After building the BSP for your DIGI board change to the cygdrive c netos63 gnu src apps template 32b directory by using the following command cd cygdrive c netos63 gnu src apps template 32b Then compile the sample project by using the make command You will have to spec ify for which target you want to compile the sample project This is done by the PLATFORM parameter and the clean all parameters to clean up the directories before building the BSP library make PLATFORM connectme clean all After the sample application is built your screen should look similar to the screen shot below yl fcygdrive c netos63_gnu stc apps template 32b Al ES Using LZSS Encoder Decode v2 Input bytes 449792 Output bytes 274556 Compression ratio 39 42 24 2 4 bin boothdr src bsp platforms connectme bootldr dat imag e compressed image bin rm image compr ed usr hin arm elf gcc o rom elf objs appconf_api o objs root o mbig end ian nostartfiles mcpu arm7tdmi T sxc hsp platforms connectme rom ld lib arm7 32bh gnu bsp connectme reset 0 lib arm7 32b gnu bsp connectme memcpy o l l lib 32b gnu crtB8 o0 N
14. Meaning J Link J Trace could not be enumerated by the USB controller Most likely reasons a Another program is already using J Link J Trace b The J Link USB driver does not work correctly Remedy a Close all running applications and try to reinitialize J Link J Trace by disconnect ing and reconnecting it b If the LED blinks permanently check the correct installation of the J Link USB driver Deinstall and reinstall the driver as shown in chapter Setup on page 9 J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 53 J Link J Trace does not get any connection to the target Most likely reasons a The JTAG cable is defective b The target hardware is defective Remedy Please follow the steps described in section 9 1 1 in the J Link J Trace User s Guide 6 2 Contacting support Before contacting support make sure you tried to solve your problem by following the steps outlined in section General procedure in the J Link J Trace User s Guide You may also try your J Link J Trace with another PC and if possible with another target system to see if it works there If the device functions correctly the USB setup on the original machine or your target hardware is the source of the problem not J Link J Trace If you need to contact support please send the following information to support segger com A detailed description of the problem J Link J Trace ser
15. cn eere tn ive ei e et ae Qd e a oti C RR DC e C es 10 CAFE om ETON 11 2 1 IN FOAUCTION ce EE 12 2 2 License tVpesi ie exter a a e S Red e e 12 2 2 1 Builtsin eens E RAR RNA A Peas rade Sn semer titre 12 2 2 2 Key based license iii nhan nna nena sea sena sua sena sena 13 2 2 3 Free evaluation and non commercial use license 13 3 Deb gging With GD Bisse cased rr S 15 3 1 Starting the J Link GDB Server cece cece eee eee nen ene nnnm 16 3 1 1 User interface cse ner xd ed ya cette SA v es 16 3 2 Setting up the J Link GDB Server sisi 17 3 3 Setting p GDB each a ea xxi RE UA I D EAE HA E ate BE 18 3 3 1 General GDB startup sequence s is sense menn nennen nnns 18 3 3 2 The gdbihit file crie ete rete Cae We e Rita rco Pea V in e ER De SAA 18 3 3 3 Running GDB 5 22er reper ee a IR eR Ee DE 19 3 4 Debugging on Cortex M3 devices 20 3 4 1 Debugging IN RAM ich rex RE E RR ER ER REPE dott 20 3 4 2 Debugging in flash cere ter A aae et nl ERI t AA 20 3 5 Supported remote commands issue 22 3 5 1 AllowSimulation ever e e tn M IE 23 3 5 2 CID Dx is rr EE LP PEE 23 3 5 3 o e E M 23 3 5 4 AU EE 23 3 5 5 flash breakpoints vox A a 24 3 5 6 TASH device eR Re ex E nn nan a d excea 24 3 5 7 LS A ee e oeste ane dave eue V ath v iate i D ON e Rn 24 3 5 8 A LEE EE 24 3 5 9 halte esteso Meaux or si ra A e P Combe rcu ecd NEAS 24 3 5 10 jtagconf 253 seed eee e e A di erra ades 25 3 5 11 Korale
16. electronics automotive SEGG ER industry and industrial automation SEGGER s intention is to cut software development time for embedded applications by offering compact flexible and easy to use middleware allowing developers to concentrate on their application Our most popular products are emWin a universal graphic software package for embed ded applications and embOS a small yet efficent real time kernel emWin written entirely in ANSI C can easily be used on any CPU and most any display It is comple mented by the available PC tools Bitmap Converter Font Converter Simulator and Viewer embOS supports most 8 16 32 bit CPUs Its small memory footprint makes it suitable for single chip applications Apart from its main focus on software tools SEGGER developes and produces program ming tools for flash microcontrollers as well as J Link a JTAG emulator to assist in devel opment debugging and production which has rapidly become the industry standard for debug access to ARM cores Corporate Office United States Office http www segger com http www segger us com EMBEDDED SOFTWARE SEGGER TOOLS Middleware emWin Flasher Graphics software and GUI Flash programmer emWin is designed to provide an effi Flash Programming tool primarily for microcon cient processor and display control trollers ler independent graphical user interface GUI for any application that J Link operates with a graphical display JTAG emu
17. kc kckck kc kc k ck ckckck ck ckckckckck ck ck ckckck ck kk Connect to J Link and debug application in flash on Cortex M3 Download to flash is performed 3t Connect to the J Link gdb server target remote localhost 2331 monitor speed 1000 monitor flash device STM32F103VB monitor flash download 1 load ST MB525 FLASH elf Initializing PC and stack pointer monitor reg r13 0x00000000 monitor reg pc 0x00000004 3 4 2 2 Flash breakpoints Most Cortex M3 devices offer 6 hardware breakpoints Can be very conveniant for debugging to have more than 6 breakpoints Flash breakpoints are supported for most popular Cortex M3 devices To enable flash breakpoints the device needs to be selected and flash breakpoints have to be enabled the license for download FlashBP is also required For more information please refer to Enabeling flash download and flash breakpoints on page 42 fk KK KK KK KK ck KE ck ck ck ck k ck ckck ck ck k kc kckckckck ck k ck ckckck ck ck ck ckckck ck ck kkk ck kk Connect to J Link and debug application in flash on Cortex M3 Download to flash is performed 3t Connect to the J Link gdb server target remote localhost 2331 monitor speed 1000 monitor flash device STM32F103VB monitor flash breakpoints 1 monitor flash download 1 load ST MB525 FLASH elf Initializing PC and stack pointer monitor reg r13 0x00000000 monitor reg pc 0x00000004 J Link ARM GDB Ser
18. registered trademarks of their respec tive holders Contact address SEGGER Microcontroller GmbH amp Co KG In den Weiden 11 D 40721 Hilden Germany Tel 49 2103 2878 0 Fax 49 2103 2878 28 Email support segger com Internet http www segger com Manual versions This manual describes the latest software version If any error occurs please inform us and we will try to assist you as soon as possible For further information on topics or routines not yet specified please contact us Manual version Date By Explanation Chapter Debugging with GDB 3 91 Rev 0 080821 AG Debugging on Cortex M3 devices added Supported remote commands updated 3 90 Rev 0 080811 AG Several corrections Chapter Debugging with GDB 3 84 Revia 030617 AG Y Remote command AllowSimulation added Chapter Licensing added SERE 2 080408 AG Chapter Intro updated Chapter Debugging with GDB Remote command flash device updated 3 80 ReV 1 089213 AG Remote command flash download added Remote command flash breakpoints added Chapter Debugging with GDB 3 80 Rev 0 080206 SK Remote command flash device added Chapter Flash download and Flash breakpoints added 3 78 Rev 1 071213 OO General update Commands WriteU8 WriteU16 WriteU32 added Chapter Debugging with GDB SPERM 070308 ak Subchapter Yagarto added Chapter Licensing enhanced 3 64 Rev 2 070307 SK C
19. reset strategies which rely on the reset pin low pulse on reset do not work per default For this reason a special reset strategy has been made available 8 It is recommended to use this reset strategy This special reset strategy resets the peripherals by writing to the RSTC_CR register Resetting the peripherals puts all peripherals in the defined reset state This includes memory mapping register which means that after reset flash is mapped to address O It is also possible to achieve the same effect by writing Ox4 to the RSTC CR register located at address OxfffffdOO Table 3 2 Reset types Example monitor reset monitor reset 1 J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 30 Debugging with GDB 3 5 18 select Syntax select USB or select IP hostname Description Selects the way J Link J Trace is connected to the host system Example monitor select USB monitor select IP localhost 3 5 19 semihosting enable Syntax semihosting enable lt VectorAddr gt Description Enables semi hosting with the specified vector address If no vector address is spec ified the SWI vector at address 0x8 will be used Example monitor semihosting enable 3 5 20 semihosting ARMSWI Syntax semihosting ARMSWI Value Description Sets the SWI number used for semi hosting in ARM mode The default value for the ARMSWI is 0x123456 Example
20. tx_kernel_enter Enter the ThreadX kernel return 8 we never actually get herex Refer to http sources redhat com insight for detailed information about Insight Note We only support problems directly related to the J Link GDB Server Prob lems and questions related to your remaining toolchain have to be solved on your own J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 37 3 7 1 1 Start a debug session with Insight and J Link GDB Server You can start a debug session with Insight in the following way Start Insight Open your program in Insight Connect to J Link GDB Server Download your program to your target Run and debug your program Start Insight Enter gdbtk in your console window to start Insight Open your program in Insight To open your program in Insight choose File Open and select the executable that you want to debug Connect to J Link GDB Server Set the settings for the connection to J Link GDB Server Open the Target selection dialog File Traget settings and select GDBServer TCP in the Target choice list Enter the IP address of the host which runs the J Link GDB Server for example local host 127 0 0 1 and select the port the server listens for connections By default the server listens on port 2331 Target Selection GDBserver TCP 2331 You can insert additional commands for example for the initialization of your target cor
21. A2 static void HPTask uoid 4 a3 while 4 4 aa BSP nimm H a ar ag re void LPTask void 4 while 1 4 BSP ToggleLED 1 S Delay 208 62 int main uoid 4 0S IncDI Initially disable interrupts S InitKern initialize 0S OS_Ini tH gt s initialize Marin T ns BSP ee initialize LED de to create at least one task before call E Bs Start Os CRERTETASR ETCBNP HP Task HPTask 108 StackHP BS ORERTETREMBTORLP LP Task LPTask 58 StackLP tart de Start multitasking pie Breakpoint 4 main at Rpplication Start LEDBlink c 3 gdb c Continuing eakpoint 4 HPTask at Application Start LEDBlink c AA gdb s ifo saie Index 8 at Setup BSP c 18H WPTask at Application Start LEDBlink c A5 gdb J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 45 Chapter 5 Using DIGI evalboards This chapter describes the setup procedure required in order to debug DIGI boards with the GDB and the J Link GDB Server This includes primarily the compilation rou tines and configuration hints for the DIGI sample applications In this case we will refer to the DIGI Connect ME hardware J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 46 Using DIGI evalboards 5 1 Initial Steps First of all please start the J Link GDB Server by double clicking the executable file You will see the J Link GDB Serv
22. GmbH amp Co KG 10 Introduction 1 1 GDB GDB Server overview The GNU Project Debugger GDB is a freely available debugger distributed under the terms of the GPL It connects to an emulator via a TCP IP connection It can con nect to every emulator for which a GDB Server software is available The latest Unix version of the GDB is freely available from the GNU commitee under http www gnu org software gdb download GDB compatible Debugger IP GDB Server GDB Server is a remote server for GDB When you run GDB in the GDB source direc tory it will read a gdbinit file The GDB gdbinit file contains default setting informations and additional monitor commands GDB and GDB Server communicate via a TCP IP connection using the standard GDB remote serial protocol The GDB Server translates the GDB monitor commands into J Link commands 1 2 Hardware requirements To use J Link GDB Server you have to meet the following hardware requirements e PC running Win2K XP Vista e USB port e J Link J Trace 1 3 Setup The J Link setup procedure required in order to work with the J Link GDB Server is described in chapter 2 of the J Link User s Guide The J Link User s Guide is part of the J Link software package which is available for download under www segger com J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 11 Chapter 2 Licensing This chapter describes the license mana
23. J Link ARM GDB Server User guide of the J Link ARM GDB Server Software Version 4 00 Manual Rev 0 Date January 28 2009 Document UMO8005 gt SEGGER A product of SEGGER Microcontroller GmbH amp Co KG www segger com Disclaimer Specifications written in this document are believed to be accurate but are not guar anteed to be entirely free of error The information in this manual is subject to change for functional or performance improvements without notice Please make sure your manual is the latest edition While the information herein is assumed to be accurate SEGGER Microcontroller GmbH amp Co KG the manufacturer assumes no responsibility for any errors or omissions The manufacturer makes and you receive no warranties or conditions express implied statutory or in any communication with you The manufacturer specifically disclaims any implied warranty of merchantability or fitness for a particular purpose Copyright notice You may not extract portions of this manual or modify the PDF file in any way without the prior written permission of the manufacturer The software described in this doc ument is furnished under a license and may only be used or copied in accordance with the terms of such a license O 2007 SEGGER Microcontroller GmbH amp Co KG Hilden Germany Trademarks Names mentioned in this manual may be trademarks of their respective companies Brand and product names are trademarks or
24. an be used Sample configuration file J LINK GDB SERVER Configuration file Set the listening port of GDB Server to tcp port 2331 port 2331 Set JTAG speed to 30 kHz speed 30 Set GDBServer to little endian endian little Reset the chip to get to a known state reset 3 6 1 XC Description Starts the GDB server with a configuration file The commands in the configuration file will not be executed until a debugging session is started The J Link GDB Server executes the commands specified in the configuration file with every start of a debugging session Example jlinkgdbserver xc lt YourConfigurationFile gt 3 6 2 X Description Starts the J Link GDB server with a configuration file In contrast to the xc com mand line option runs the J Link GDB Server the commands in the configuration file once only direct after the start of the J Link GDB Server Example jlinkgdbserver x lt YourConfigurationFile gt 3 6 3 port Description Starts the GDB Server listening on a specified port This option overrides the default listening port of the J Link GDB Server Example jlinkgdbserver port J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 35 3 7 Running GDB extensions Insight Eclipse etc There are many extensions and graphical user interfaces for GDB available The range of products reaches from standalone implementations li
25. building your application assembler linker C com piler e The C programming language e The target processor e DOS command line If you feel that your knowledge of C is not sufficient we recommend The C Program ming Language by Kernighan and Richie ISBN 0 13 1103628 which describes the standard in C programming and in newer editions also covers the ANSI C standard How to use this manual This manual explains all the functions and macros that emFile offers It assumes you have a working knowledge of the C language Knowledge of assembly programming is not required Typographic conventions for syntax This manual uses the following typographic conventions Style Used for Text that you enter at the command prompt or that appears on the Keyworg display that is system functions file or pathnames Parameter Parameters in API functions Sample Sample code in program examples Reference Reference to chapters tables and figures or other documents GUIElement Buttons dialog boxes menu names menu commands Emphasis Very important sections Table 1 1 Typographic conventions J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG SEGGER Microcontroller GmbH amp Co KG develops and distributes software development tools and ANSI b C software components middleware for embedded systems in several industries such as telecom medi cal technology consumer
26. e AT91SAM7S256 monitor flash download 1 monitor flash breakpoints 1 The J Link GDB Server comes with sample projects for the most common flash micro controllers The sample projects can be found at Samples GDB Projects of the installation directory of the J Link software and documentation package 4 2 1 How to use the sample projects First of all you have to choose an appropriate sample project for your device and unzip it into a directory of your choice After unzipping the project you can start the J Link GDB Server J SEGGER J Link GDB Server V3 79t beta J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 43 To start the sample project simply start the Debug Flash bat file in the directory of the sample project The sample projects already include an executable Debug Flash elf file so you don t have to recompile the project After starting the debugger the source windows should look as follows Start LEDBlink c Source Window OE x File Run View Control Preferences Help o90o0 o me asaoe m rim dde start LEDBiink c main y SOURCE m Purpose Sample program for OS running on EVAL boards with LEDs ll END OF HEADER include RTOS h ttinclude BSP h OS_STACKPTR int StackHP 128 StackLP 128 Task stacks OS_TASK TCBHP TCBLP Task control blocks static void HPTask void while 1 4 BSP ToggleLED 8 US Delay 58 static void
27. e in the textfield Commands to issue after attaching of the Target Selection dialog J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 38 Debugging with GDB Choose Run Connect to target to connect to your target via the J Link GDB Server main c Source Window 198 199 200 tif BSP POST TEST 261 postResults ncc post 262 if postResults gt ccode t POST_PASSED 283 285 NALedBlinkFailureCode LED_2 POST FAILURE postResults gt testCode postResults gt s 285 H 286 ttendif 207 208 setupUectorTable setup standard vector tablex 209 tifdef BSP ARH9 218 NAEnableMmu 211 tendif 212 NABoardInit initialize the hardware 213 DDIFirstLevelInitialize let device drivers init their hardwa 214 215 NAGetAppCpp 216 217 tx kernel enter Enter the ThreadX kernel return 8 we never actually get herex Check the status of the connection to J Link GDB Server The Debugger status mes sage has changed to Connected to 127 0 0 1 and the status field aside has changed from red to green ae SEGGER J Link GDB Server V3 78a CICTSE TII J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 39 Download your program to your target To download your program choose Run Download Afterwards you ca
28. eeeeeeeeenaaaees 41 4 1 ELCANO Giese E 42 4 2 Enabeling flash download and flash breakpoints ccceeeeeeee eee eeeee eee eeeees 42 4 2 1 How to use the sample projects sise 42 5 Using DIGI evalboards sis 45 5 1 Initial Steps ciae eee aveo det eade acsi dud t Du eut 46 5 1 1 Copying gdbinit files enne nemen rr rr rr rr rr 46 5 2 Compiling the board support package BSP sssseeeeeene mmm 47 5 3 Compiling the sample application cece cee eee ee eee mmm nnn 48 5 4 Setting up the GDB configuration file sess 48 5 5 Debugging the sample application cocoocccccccnccnccnnnnnnononanenncnnnncnnnrnnnnnnnnrnns 49 D SUPPOR aes ear re eee E a E A 51 6 1 Troubleshooting occi ere sain xke enean ar vel ea ia x ae XE een S YR DU 52 6 1 1 General procedure odia A Gea E Ee de rende ia 52 6 1 2 Typical problem scenarios iii aane nnn 52 6 2 Contacting suppOTrt i senex caus eee reina Sex ao exe epe Fe RE SEP x Yee e Cav HERE KR ORE NIE 53 6 3 o E 53 7 MOSS AN ceu o a Te eta de Ate tw uota t us te ee em 55 8 Literature and references evs ise ted ex A A epa patiente 57 J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH 8 Co KG Chapter 1 Introduction This chapter gives a short overview about how to start debugging your hardware with the GDB and the J Link GDB Server J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller
29. ends to the GDBServer The Log output window is primarily usefull for troubleshooting Log to file If the Log to file checkbox is selected the GDBServer generates the log file C NJLinkGDB log Cache reads Enables a memory read ahead optimization which can speed up debugging Verify download Verifies the program in the target after a download Init regs on start Initializes target registers with good start values J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG Debugging with GDB 3 3 Setting up GDB We assume that you already have a solid knowledge of the software tools used for building your application assembler linker C compiler and espe cially the debugger and the debugger frontend of your choice We do not answer questions about how to install and use the choosen toolchain 3 3 1 General GDB startup sequence 1 Sets up the command interpreter as specified by the command line 2 Reads the init file if any in your home directory and executes all the commands in that file 3 Processes command line options and operands 4 Reads and executes the commands from init file if any in the current working directory This is only done if the current directory is different from your home directory 5 Reads command files specified by the x option 6 Reads the command history recorded in the history file For more details about the GDB startup sequence refer to http www gnu o
30. er cde SEGGER J Link GDB Server V3 78a wating for comnecion oi y comentes E Fe B 326v B ute enian 7 CA ASE ILESI 5 1 1 Copying gdbinit files To make things easy the J Link GDB Server package contains ready to go gdbinit files for the various DIGI boards In order to use these gdbinit files with the DIGI boards and NET Works GNU Soft ware please copy the jlink files found in the GDBInit folder to NETOS DIR debugger_files which is per default C netos63_gnu debugger_files J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 47 5 2 Compiling the board support package BSP After starting the Net Works 6 3 Build Environment you will find yourself in a Unix like shell environment with a command prompt To compile the board support package BSP change to the bsp directory which is located under cygdrive c netos63_gnu src bsp by using the ca command which stands for change directory cd src bsp To list the available BSPs please use the following command ls platforms 1 You will see a list of available platforms as shown in the screenshot below fcygdrive c netos63_gnu stc bsp OF x GNU X Tools and Bash Shell ready Setting up Shell for arm elf arm elf GNU Tools Shell Ready ygdr ive 5 cd src bsp cugdrive t neto ls platforms 1 total 1080 druxruxrux druxruxrux druxruxrux druxruxruxt druxruxruxt druxruxrux
31. er is lim ited to 32 KBytes To use this type of license J Link GDB Server has to be started in free mode How to start J Link GDB Server in free mode is explained in the fol lowing J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 14 Licensing 2 2 3 4 License dialog A startup license dialog will be opened with every start of the J Link GDB if no addi tional license is installed J Link GDB Server License Select Start in free mode to start J Link GDB Server with 32 Kbytes download limi tation or select Enter license to remove the limitation and deactivate the startup dialog If the J Link GDB Server is started in free mode a status message appears in the log window d SEGGER J Link GDB Server 3 78a Bue p lue c B ute endian H pev f fue endan z Qe an i J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 15 Chapter 3 Debugging with GDB This chapter describes the setup procedure required in order to use the GDB with the J Link GDB Server J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 16 Debugging with GDB 3 1 Starting the J Link GDB Server Start the J Link GDB Server by double clicking the executable file Connect a J Link to the host system as described in chapter Installing the USB driver on page 10 If a J Link and target system is connected the J Link GDB Server s
32. ework which has typi cally been used to develop integrated development environment IDE Therefore Eclipse can be used as C C IDE if you extend it with the CDT plug in http www eclipse org cdt CDT means C C Development Tooling project and is designed to use the GDB as default debugger and works without any problems with the J Link GDB Server Debug cstartup c Eclipse SDK ls Hall gt Tt IRQ Handler FIO Handler m HETDOUT Ox80000001 HET31 f 0x00000160 lt main 100 gt mvn r2 524288 Oxi f 0x00000164 lt main 104 gt sub r2 r2 960 Ox void ResetHandler void h 0x00000168 lt main 108 gt sub ra r2 3 3 0x3 t OxO000016c lt main 112 gt mvn r3 524288 Oxi Disable peripheral access violation memory acc Ox00000170 lt main 116 gt sub r3 r3 960 Ox and illegal address reset 0x00000174 lt main 120 gt sub r3 r3 3 7 0x3 mif 0 0x00000178 lt main 124 gt ldr r3 r3 SYSECR RESETO PACCOVR ACCOVR ILLOVR Ox0000017c lt main 128 gt eor r3 r3 f 214748364 Ox00000180 lt main 132 gt str r3 r2 1 Flash is 256K at Ox00000000 is einitialized a for i 0 i lt 100000 i f Activate Flash at Ox00000000 that is connecte IMOxODO00184 lt main 136 gt mov r3 0 OxO set size to 256KB enable read only protectio str r3 rii 16 MFBALRO BLOCK SIZE 256K Ox0000018c lt main 144 gt b Ox19c lt main 160 gt MFBAHRO Ox00000000
33. gement of the software J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 12 2 1 2 2 Licensing Introduction J Link GDB Server is distributed as free for evaluation and non commercial use The software can be used free of charge for educational and nonprofit purposes with out additional license Without additional license only 32 KBytes may be down loaded To download bigger programs or to use the software for other especially commercial purposes a license is required With such a license the download size is not limited Free evaluation licenses are available upon request To obtain an trial or unlimited license please contact sales segger com Full and valid license terms are specified in file License txt which comes with the J Link software and documentation package SAM ICE J Link GDB Server can be used free of charge without limitation of program size with SAM ICE License types For the J Link GDB Server three types of licenses are available which will be explained in the following Built in License This type of license is easiest to use The customer does not need to deal with a license key The software automatically finds out that the connected J Link contains the built in license s This is the type of license you get if you order J Link and the license at the same time typically in a bundle Atmel s SAM ICE comes with a Built in license for J Link GDB Server
34. hapter Licensing added 3 64 Rev 1 070305 SK Chapter Command line options added J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG Manual version Date By Explanation 3 60 Rev 1 070222 Seve Debugging With GDB Command speed updated Various layout and content improvements Chapter About this document added 3 50 Rev 1 061025 SK a ede chapter Setup and moved into chapter Introduc Chapter Debugging with GDB revised Subchapter GDB extensions added 3 30 Rev 1 060703 00 ieee da Supported remote commands Added reset type 3 23 Rev 1 060526 TQ Minor improvements 3 21 Rev 1 060512 TQ Several corrections in chapter Using DIGI evalboards on page 45 1 00 Rev 1 060407 OO Initial manual version Software versions Software Dat B Explanation version ate y prsanaug 3 78a 071213 OO Several improvements 3 30g 060703 OO Several improvements 3 23a 060526 TQ Several improvements 3 21b 060512 TQ Dialog based user interface added 1 00 060407 TQ Initial software version J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH 8 Co KG About this document Assumptions This document assumes that you already have a solid knowledge of the following e The software tools used for
35. hould look similar to the screenshot below El SEGGER J Link GDB Server 3 78a M a m Iv L LI 3 1 1 User interface The J Link GDB Server s user interface shows information about the debugging pro cess and the target connected via JTAG It shows IP address of host running debugger Connection status of J Link Information about the target core Measured target voltage Bytes that have been downloaded Status of target Log output of the J Link GDB Server optional if Log output window is checked Initial and current JTAG speed e Target endianess J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 3 2 Setting up the J Link GDB Server Typically most of the GDB setup is done from GDB via remote commands monitor in the gdbinit file However it is also possible to do the setup manually via user interface E SEGGER J Link GDB Server 3 78a M M LI M LI LI Via the Initial JTAG speed dropdown box the JTAG speed can be selected and with the box below the endianess of the target can be set These two boxes will be grayed out while debugging although their values can be changed from the debugger console using remote commands Stay on top Allows you to force a window to stay on top of the other windows Log window The log window is only visible if the checkbox Log window is selected The Log out put window shows all commands which the GDB s
36. ial number Output of JLink exe if available Your findings of the signal analysis Information about your target hardware processor board etc J Link J Trace is sold directly by SEGGER or as OEM product by other vendors We can support only official SEGGER products 6 3 FAQ Q Which CPUs are supported A Every CPU supported by J Link J Trace is supported J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 54 Support J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 55 Chapter 7 Glossary This chapter explains important terms used throughout this manual J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 56 Glossary Big endian Memory organization where the least significant byte of a word is at a higher address than the most significant byte See Little endian Cache cleaning The process of writing dirty data in a cache to main memory GDB A GNU Project Debugger that is freely available Host A computer which provides data and other services to another computer Especially a computer providing debugging services to a target being debugged ICache Instruction cache Image An executable file that has been loaded onto a processor for execution Joint Test Action Group JTAG The name of the standards group which created the IEEE 1149 1 specification Little endian Memory organizati
37. information about the differ ent modes Example monitor speed 1000 monitor speed auto monitor speed adaptive 3 5 25 step Syntax step lt NumSteps gt or si lt NumSteps gt Description Performs one or more single instruction steps where lt NumSteps gt is the number of instruction steps to perform If lt NumSteps gt is not specified only one instruction step will be performed Example monitor step 3 3 5 26 waithalt Syntax waithalt lt Timeout gt or wh lt Timeout gt Description Waits for target to halt code execution where lt Timeout gt is the maximum time period in milliseconds to wait Example monitor waithalt 2000 or monitor wh 2000 J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH 8 Co KG 33 3 5 27 wice Syntax wice RegIndex value or rmib RegIndex value Description Writes to given IceBreaker register where value is the data to write Example monitor wice 0x0C 0x100 or monitor rmib 0x0C 0x100 J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 34 Debugging with GDB 3 6 Command line options You can use command line configuration options to start the J Link GDB Server with a configuration file or set the listening port of the J Link GDB Server The configuration file can be used as an alternative to the gdbinit file All commands listed in Supported remote commands on page 22 c
38. iption Reads or writes a byte from to a given address If value is specified this com mand writes the value to the given address Otherwise this command reads from the given address Example monitor memU8 0x50000000 Read monitor memU8 0x50000000 OxFF Write J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 26 Debugging with GDB 3 5 13 memU16 Syntax memU16 address lt value gt Description Reads or writes a halfword from to a given address If value is specified this com mand writes the value to the given address Otherwise this command reads from the given address Example monitor memU16 0x50000000 Read monitor memU16 0x50000000 OxFFFF Write 3 5 14 memU32 Syntax MemU32 address lt value gt Description Reads or writes a word from to a given address If value is specified this com mand writes the value to the given address Otherwise this command reads from the given address This command is similar to the long command Refer to ong on page 25 for more information Example monitor MemU32 0x50000000 Read monitor MemU32 0x50000000 OxFFFFFFFF Write 3 5 15 reg Syntax reg lt RegName gt lt value gt or reg lt RegName gt lt address gt Description Reads or writes from to given register If lt value gt is specified this command writes the value into the given register If address is specified
39. ke GNU Insight http sources redhat com insight frontends like DataDisplayDebugger DDD http www gnu org software ddd and IDEs like Eclipse http www eclipse org The J Link GDB Server is tested with GDB version 6 1 Insight version 6 1 Eclipse version 3 2 0 and CDT version 3 1 0 We appologize that you are familiar with all tools which you use for the development of your application The following information should only help to to round out the context in which the J Link GDB Server can be used Note We only support problems directly related to the J Link GDB Server Prob lems and questions related to your remaining toolchain have to be solved on your own J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH Co KG 36 Debugging with GDB 3 7 1 Insight Insight is a version of GDB that uses Tcl Tk to implement a graphical user inter face It is a fully integrated GUI not a separate front end program main c Source Window 197 ttendif 198 199 200 tif BSP POST TEST 201 postResults ncc post 282 if postResults gt ccode t POST PRSSED 283 H 285 NALedBlinkFailureCode LED_2 POST FAILURE postResults gt testCode postResults gt s 205 H tendif setupUectorTable setup standard vector tablex ifdef BSP_ARM9 8 NAEnabletimu tendif 2 NABoardInit initialize the hardware DDIFirstLevelInitialize let device drivers init their hardwa NAGetappCpp
40. lator for ARM cores Starterkits eval and trial versions are USB driven JTAG interface for ARM cores available J Trace embos JTAG emulator with trace Real Time Operating System USB driven JTAG interface for ARM cores with embOS is an RTOS designed to offer Trace memory supporting the ARM ETM Embed TT the benefits of a complete multitasking ded Trace Macrocell EJ system for hard real time applications with minimal resources The profiling J Link J Trace Related Software PC tool embOSView is included Add on software to be used with SEGGER s indus try standard JTAG emulator this includes flash emFile programming software and flash breakpoints File system emFile is an embedded file system with FAT12 FAT16 and FAT32 support emFile has been optimized for mini mum memory consumption in RAM and ROM while maintaining high speed Various Device drivers e g for NAND and NOR flashes SD MMC and Com pactFlash cards are available emUSB USB device stack A USB stack designed to work on any embedded system with a USB client controller Bulk communication and most standard device classes are sup ported ES J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG Table of Contents A O emo AMA ran Lala iM Co c ud 9 1 1 GDB GDB Server Overview iesssssseese nennen eene enin aaa aa nn 10 1 2 Hardware requirements iii SEES sena sean nenne nnn nnn nnn 10 1 3 Setup
41. licenses automatically as can be seen in the screenshot below J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 2 2 2 Key based license When using a key based license a license key is required in order to unlock the full potential of J Link GDB Server License keys can be added via the J Link GDB Server license management To open the J Link GDB Server license management simply select Licenses from the Help menu in the main window Like the built in license the key based license is only valid for one J Link so if another J Link is used it needs a separate license When using J Link GDB Server and no license is found by the software it will ask for a license key 2 2 2 1 Entering a license key The J Link GDB Server license management dialog shows the available licenses and allows to add and remove licenses as well J Link GDB Server License management ES Add license Delete license Display serial number Select Add license to enter a license key or Display serial number to get the serial number of the connected J Link J Link GDB server licenses are accorded on a one per J Link basis This means that a license key is only valid for the J Link with the suitable serial number 2 2 3 Free evaluation and non commercial use license When using the free evaluation and non commercial use license of J Link GDB Server the program size which can be downloaded with the J Link GDB Serv
42. n run and debug your program on your target hardware INIT s Source Window File Run View Control Preferences Help ADOOS 8x888a92c Reset Handler ROM 8x888a938 Reset Handler R HM Hh 5 8x888a93 4 Reset Handler R HM 85 8x888a938 Reset Handler ROM 12 gt 8x888a93c lt Reset_Handler_ROM 16 gt 8x888a948 lt Reset_Handler_ROM 26 gt 6x860a944 lt Reset_Handler_ROM 24 gt 6x866a948 lt Reset_Handler_ROM 28 gt 8x888a958 lt Reset_Handler_ROM 36 gt qe aaaoee m nwe JINIT s 52 Reset nandi M lolx agaga JaSSEMBLY y r8 19 6x13 r8 r8 128 6x86 r8 r8 64 0x40 CPSR fc r8 r8 pc 768 0x888ac88 lt START 8 gt r8 r8 r8 r8 16777216 Oxff8000008 r8 r8 lsr 24 8x888a994 lt done_p11 gt J Link ARM GDB Server UM08005 8x888a954 Reset Handler R H A85 r8 pc 684 6x866ac68 lt START 8 gt 8x888a958 Reset Handler R H AA 5 r8 r8 8x888a95c Reset Handler R H A85 r8 r8 16777216 0xff000000 8x8880a968 Reset Handler R HM 52 r8 r0 lsr 22 6x800a964 Reset Handler R HM 56 ri pc 672 80x888ac8c lt START 12 gt 8x888a968 Reset Handler R OH 685 r8 r8 r1 8x888a96c lt Reset_Handler_ROM 64 gt 1dr r8 r8 8x8880a978 Reset Handler R H 685 ldr ri pc 664 8x888ac18 lt START 16 gt 0x800a974 lt Reset_Handler_ROM 72 gt str r8 r1 8x888a978 Reset Handler R H 762 1dr r5 pc 660 6x866ac14 lt START 20 gt
43. nk gdb server target remote localhost 2331 monitor speed 1000 load ST MB525 RAM elf Initializing PC and stack pointer RAM START ADDR is at 0x20000000 monitor reg r13 0x20000000 monitor reg pc 0x20000004 3 4 2 Debugging in flash When debugging in flash the stack pointer and the PC are set automatically when the target is reset after the flash download Without reset after download the stack pointer and the PC need to be nitialized cor rectly typically in the gdbinit file The following sample GDB init sequence is for a STM32 Sample GDB init sequence kkxkxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxk Connect to J Link and debug application in flash on Cortex M3 no download is performed Connect to the J Link gdb server target remote localhost 2331 monitor speed 1000 Can not load into flash if device is not specified load ST MB525 FLASH elf Initializing PC and stack pointer monitor reg r13 0x00000000 monitor reg pc 0x00000004 J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 21 3 4 2 1 Download to flash To enable download to flash the device needs to be selected and flash download has to be enabled the license for download FlashDL is also required For more informa tion please refer to Enabeling flash download and flash breakpoints on page 42 Sample GDB init sequence fk KKK KKK KK kk ck ck ck ck ck kck ck ck ck ck k ck
44. on where the least significant byte of a word is at a lower addressthan the most significant byte See also Big endian Target The actual processor real silicon or simulated on which the application program isrunning Watchpoint A location within the image that will be monitored and that will cause execution to stop when it changes J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 57 Chapter 8 Literature and references This chapter lists documents which we think may be useful to gain deeper under standing of technical details J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 58 Literature and references Reference Title Comments This document describes the GDB GDB GDB Documentation Server usage in detail It is publicly available from the GNU commitee www gnu org This document describes the J Link EV y l J Trace debug interfaces in detail JUG d Link J Trace User s Guide It is publicly available from SEGGER www segger com Table 8 1 Literature and reference J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 59 Index B Bigsendian cete ret Rd rk nena 56 C Cache cleaning seseesesseses 56 Command line options sesse 34 E Eclipse 15v ER As 40 G reip 56 SOODINIG rr 18 extensions uices e ERREUR me
45. ost system attach USB cable Power on target Try your target application again If the problem vanished you are done other wise continue Close all running applications on your host system again Disconnect the J Link J Trace device from USB Power off target Re connect J Link J Trace with host system attach USB cable Power on target Start JLink exe If JLink exe reports the J Link J Trace serial number and the target processor s core ID the J Link J Trace is working properly and cannot be the cause of your problem If JLink exe is unable to read the target processor s core ID you should analyze the communication between your target and J Link J Trace with a logic analyzer or oscilloscope Follow the instructions in section 9 2 in the J Link J Trace User s Guide If your problem persists and you own an original product not an OEM version see section Contacting support on page 53 Typical problem scenarios J Link J Trace LED is off Meaning The USB connection does not work Remedy Check the USB connection Try to re initialize J Link J Trace by disconnecting and reconnecting it Make sure that the connectors are firmly attached Check the cable connections on your J Link J Trace and the computer If this does not solve the problem please check if your cable is defective If the USB cable is ok try a different PC J Link J Trace LED is flashing at a high frequency
46. rg software gdb documentation 3 3 2 The gdbinit file When you run the GDB an initialization file called gbdinit is searched in the GDB home directory If the GDB finds a gdbinit file GDB executes all the commands in that file It is a good approach to store the setup informations for the remote debugging ses sion in the g binit file Some sample files are supplied in the GDBInit folder of the GDB Server installation directory Choose the sample that best fits to your target board customize it and copy it into your GDB source directory You can use the gdbinit template as base for the implementation of new hard ware J LINK GDB SERVER initialization for commands on localhost at tcp port 2331 arget remote localhost 2331 Set JTAG speed to 30 kHz monitor speed 30 Set GDBServer to big endian monitor endian big Reset the chip to get to a known state monitor reset This connects to a GDB Server listening E CPU core initialization to be done by user Set the processor mode monitor reg cpsr 0xd3 Set auto JTAG speed monitor speed auto Setup GDB FOR FASTER DOWNLOADS set remote memory write packet size 1024 set remote memory write packet size fixed Load the program executable called image elf load image elf J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 19 3 3 3 Running GDB To start GDB enter gdb se lt NameOfYo
47. ronment The GDB will ask if you would like to change the packet size Select Yes After this GDB starts to download the sample application into the target When the download is finished you can debug through the application For further information please refer to the GDB documentation which is freely avail able from the GNU commitee under http www gnu org software gdb documentation J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 50 Using DIGI evalboards J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 51 Chapter 6 Support This chapter contains troubleshooting tips together with solutions for common prob lems which might occur when using J Link J Trace There are several steps you can take before contacting support Performing these steps can solve many problems and often eliminates the need for assistance Further instructions are explained in the J Link J Trace User s Guide J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 52 6 1 6 1 1 Support Troubleshooting General procedure If you experience problems with a J Link J Trace you should follow the steps below to solve these problems O U1 BR YU N 15 6 1 2 Close all running applications on your host system Disconnect the J Link J Trace device from USB Power off target Re connect J Link J Trace with h
48. s 35 Insight 2 rte nie de a 36 startup sequence 18 H In oe EE EE ERE re 56 I Co x e i Ya e a 56 TIMAQE m 56 J J Link GDB Server eeeeennn 10 User interface eene nnne 16 Joint Test Action Group JTAG 56 L Littlle endian een 56 S Server command AllowSimulation eene 23 fol d ojo iet 23 onc Ets 23 endian assassin e pis 23 flash breakpoints 24 J Link ARM GDB Server UM08005 flasli d vice a IP 24 flash download eese 24 o 24 Halt esse dr EN 24 jtagconhf iue raser rarement 25 ONG ssh nee LO eer a RR RE Een 25 memd TOo eremo er Rime unes 26 miemdlU32 ind o EE da 26 meml8 aaa 25 A o teu nd e E E 26 temotepoOFt ore deese rx e RIEN 26 GSGE ose dr xa I ERR EE YR AEN 28 Selec e ev e 30 SeLBP ouis nei t riore DUE EE 30 0 R 31 Speed sommets Dawa carey 32 m 32 waithalt 1 15 occisus eee n vv 32 WICE E 33 Server commands eene 22 SUuppOFE ii ea 55 Syntax conventions used 5 T A EE LES RE TENES 56 W Watch point viii 56 Y NAQAF O 25 t 40 2004 2009 SEGGER Microcontroller GmbH amp Co KG 60 Index J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH 8 Co KG
49. t lt data gt Description Reads or writes from to cp15 register If lt data gt is specified this command writes the data to the cp15 register Otherwise this command reads from the cp15 register For further information please refer to the ARM reference manual Example Read monitor cp15 1 2 6 7 Read Write monitor cp15 1 2 6 7 OxFFFFFFFF Write 3 5 4 endian Syntax endian lt endianess gt Description Sets endianess of target where lt endian gt can either be big or little Example monitor endian little Additional information By default the GDB server is configured to use big endianess J Link ARM GDB Server UMO8005 O 2004 2009 SEGGER Microcontroller GmbH Co KG 24 Debugging with GDB 3 5 5 flash breakpoints Syntax monitor flash breakpoints Value Description This command enables disables the flash breakpoints feature Example monitor flash breakpoints monitor flash breakpoints 3 5 6 flash device Syntax 1 Enable flash breakpoints 0 Disable flash breakpoints flash device lt DeviceID gt Description Selects the target s flash device The flash device is selected by it s device identifier For more information about the supported device identifiers please refer to the J Link J Trace User Guide chapter Flash programming and flash breakpoints Example monitor flash device AT91SAM7S256 3 5 7 flash download Syntax monitor flash download l
50. t druxruxrux druxruxrux druxruxrux druxruxruxt druxruxruxt Administ connectcore9c a fidminist connectem Administ connectme Administ connectsp Administ connectuwiem Administ connectwime Administ net56_d fidminist net5Bbga_a Administ ns 752B8 a fidminist ns9 366_a Administ ns 756_a NNNNNNNNNNN Then compile the board support package BSP by using the make command You will have to specify for which target you want to compile the BSP This is done by the PLATFORM parameter and the clean all parameters to clean up the directories before building the BSP library make PLATFORM connectme clean all After the BSP is built your screen should look similar to the screenshot below fcygdrive c netos63_gnu stc bsp OF x 0bjs 32b gnu connectme profiler o objs 32b gnu connectme na_init o objs 32b gnu connectme INIT o objs 32b gnu connectme I RQHAND o 0bjs 32b gnu connectme armut ils o 0bjs 32b gnu connectme cksum o objs 32b gnu connectme runcksun o objs 32b gnu connectme I RQREG o Zobjs 32b gnu connectme getOuner o Zobjs 32b gnu connectme nainvalidate o 0bjs 32b gnu connectme nammu o 0b3s 32b gnu connectme addpconf_api o r Zobjs 32b gnu connectme blExe o MAKE make PLATFORM connectme ENDIAN mbig endian PROCESSOR arm TOOLSET gnu CPU FLAG mcpu arm tdmi DEBUG off Compressing blram bin to blramzip bin Using LZSS Encoder Decode lt vu2 gt 66116 s 35239 Compression ratio 47 J
51. t Value gt Description This command enables disables the flash download feature Example monitor flash download monitor flash download 1 Enables flash download 0 Disables flahs download 3 5 8 go Syntax go Description Starts the target CPU Example monitor go 3 5 9 halt Syntax halt Description Halts the target CPU J Link ARM GDB Server UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG 25 Example monitor halt 3 5 10 jtagconf Syntax jtagconf IRPre lt DRPre gt Description Configures a JTAG scan chain with multiple devices on it IRPre is the sum of IRLens of all devices closer to TDI where IRLen is the number of bits in the IR Instruction Register of one device lt DRPre gt is the number of devices closer to TDI For more detailed information of how to configure a scan chain with multiple devices please refer to the J Link ARM User s Guide Example monitor jtagconf 4 1 3 5 11 long Syntax long address lt value gt Description Reads or writes from to given address If value is specified this command writes the value to the given address Otherwise this command reads from the given address This command is similiar to the WriteU32 command Refer to memU32 on page 26 for more information Example monitor long 0x50000000 Read monitor long 0x50000000 OxFFFF Write 3 5 12 memU8 Syntax MemU8 address lt value gt Descr
52. urProgram gt in the console window The option se followed by a file name specifies the file which is used as symbol file and execut able file for the debug session GDB tries to load a gdbinit file and executes all commands in that file El cyadiive c YourApplication G x gdb version GNU gdb 6 1 Copyright 2004 Free Software Foundation Inc GDB is free software covered by the GNU General Public License and you are welcome to change it and or distribute copies of it under certain conditions Type show copying to see the conditions There is absolutely no warranty for GDB Type show warranty for details This GDB was configured as U host i686 pc cyguvin target arm elf gdb se image elf We advise to use our supplied gdbinit files if one that fits to your hardware is available The supplied gdbinit files initializes the connection to J Link GDB Server with the default settings J Link GDB Server running on localhost 127 0 0 1 listen ing on port 2331 initializes the core and downloads the specified executable The last command in the supplied gdbinit files is the command to download your pro gram to the target After the download process has finished you must start program execution with con tinue rather than run as the program is already started You can stop the program by pressing control c A list of debugger commands can be found by using the console command help J
53. ver UM08005 O 2004 2009 SEGGER Microcontroller GmbH amp Co KG Debugging with GDB 3 5 Supported remote commands J Link GDB Server supports several remote commands from the GDB This commands can be used from within a gdbinit file or the GDB console to initialize the target board and to setup J Link GDB Server specific parameters Remote command Explanation AllowSimulation Enables Disables ARM instruction set simulation clrbp Removes an instruction breakpoint cp15 Reads or writes from to cp15 register endian Sets endianess of the target go Starts the target CPU flash breakpoints Enables Disables flash breakpoints flash device Selects the target s flash device flash download Enables Disables flash download halt Halts the target CPU jtagconf Configures a JTAG scan chain with multiple devices on it long Reads or writes a word from to given address memU8 Reads or writes a byte from to given address memUl 6 Reads or writes a halfword from to given address memU3 2 Reads or writes a word from to given address reg Reads or writes from to given register remoteport Changes the GDB server remote port reset Resets and halts the target CPU select Selects the way J Link is connected to host system semihosting enable Enables semi hosting semihosting ARMSWI Sets the SWI number used for semi hosting in ARM mode
54. yed after reset release If a pause has been specified J Link waits for the specified time before trying to halt the CPU This can be useful if a bootloader which resides in flash or ROM needs to be started after reset Breakpoint Q0 The hardware RESET pin is used to reset the CPU Before doing so the ICE breaker is programmed to halt program execution at address 0 effectively a breakpoint is set at address O If this strategy works the CPU is actually halted before executing a sin gle instruction This reset strategy does not work on all systems for two reasons a if nRESET and nTRST are coupled either on the board or the CPU itself reset clears the breakpoint which means the CPU is not stopped after reset b Some MCUs contain a bootloader program sometimes called kernel which needs to be executed to enable JTAG access Analog Devices The following sequence is executed The CPU is halted A soft reset sequence is downloaded to RAM A breakpoint at O is set The soft reset sequence is executed This sequence performs a reset of CPU and peripherals and halts the CPU before executing instructions of the user program It is recommended reset sequence for Analog Devices ADuC7xxx MCUs and works with these chips only 3 No reset is performed Nothing happens Table 3 2 Reset types J Link ARM GDB Server UM08005 2004 2009 SEGGER Microcontroller GmbH amp Co KG 29
Download Pdf Manuals
Related Search
Related Contents
4 204 408 BA 6-Euro-3 DE.indd SDQUPN 48MBs 8GB~64GB news - BizBroad DNP Fotolusio Co.,Ltd. 取扱説明書[PDF:6,24MB] TEFAL IG500140 Instruction Manual Sistema de Alineamiento para Vehículos Tipo Pasajero CAMCORDER E CÂMARA FOTOGRÁFICA U, V, W, X, Y, Z - Maison de la Négritude カタログ裏 Copyright © All rights reserved.
Failed to retrieve file