2011-12-27 07:04 AM
Hi Folks-
I'm trying to get debugging working on Eclipse. It appears that the Eclipse debugger wants to send a ''run'' command after loading the image when it should be sending a ''continue'' command. The debugger reports that error. How can I get Eclipse to send continue instead of run?I'm using Mentor's CodeSourcery G++ Lite for GNU tools, Eclipse, Segger's JLink with the JLink GDBServer via JTAG all of which were recently downloaded. I can flash the part and run the software all through the GDB server so the JTAG connection is solid. I can run GDB interactively from the console.Here's my GDB startup script:target remote localhost:2331
monitor speed 30monitor endian bigmonitor resetmonitor speed autoset remote memory-write-packet-size 1024set remote memory-write-packet-size fixedmonitor flash device = STM32F103VBmonitor flash download = 1load Debug/First.elfmonitor reg r13 = (0x00000000)monitor reg pc = (0x00000004)Please help. Thanks. - John Speth2011-12-31 12:42 AM
I used to use JLink/openocd with Eclipse Helios before switching to a different debugger and I still have my old startup sequence here. This was correct for openocd 0.4.0, some of the stm32x commands may be deprecated and renamed in 0.5.0 to cope with the new f2/4 devices.
target remote localhost:3333
monitor reset initmonitor stm32x mass_erase 0monitor stm32x options_read 0monitor stm32x unlock 0monitor reset initfile path-to-your-file.elfloadmonitor reset initmonitor speed adaptiveOther stuff I have set in the Eclipse Debug tabbed form:Debugger/GDB command = arm-none-eabi-gdb.exeStartup/Reset and delay (seconds) = 1 (and checked)Startup/Halt = checked2012-01-04 08:15 AM
I'm using the same setup except I recently upgraded to Indigo. You need to use the GDB Hardware Debugger plugin if you are not already.
The main tab should just have the path to your elf file and your project name. On the Debugger tab you need to specify the path to your gdb executable from CS. Its a standard command set and I use the mi protocol version. Make sure you DO NOT check use remote target. In the startup tab i have a reset and delay time of 3 seconds and I halt. In the text box below that is where I have part of my script.target remote localhost:2331
monitor speed auto
monitor endian little
monitor flash device = STM32F103ZG
monitor flash breakpoints = 1
monitor flash download = 1
load
monitor reg r13 = (0x00000000)
monitor reg pc = (0x00000004)
Below that I just load the image and symbols. Then my run commands are as follows.
monitor reset
break main
continue
Of course YMMV and some of the settings may need to be tweaked for your ST chip.
Cheers!