cancel
Showing results for 
Search instead for 
Did you mean: 

Eclipse/JLink/CodeSourcery/GDB run vs continue?

johnspeth
Associate
Posted on December 27, 2011 at 16:04

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 30

monitor endian big

monitor reset

monitor speed auto

set remote memory-write-packet-size 1024

set remote memory-write-packet-size fixed

monitor flash device = STM32F103VB

monitor flash download = 1

load Debug/First.elf

monitor reg r13 = (0x00000000)

monitor reg pc = (0x00000004)

Please help.  Thanks. - John Speth
2 REPLIES 2
infoinfo980
Associate II
Posted on December 31, 2011 at 09:42

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 init

monitor stm32x mass_erase 0

monitor stm32x options_read 0

monitor stm32x unlock 0

monitor reset init

file path-to-your-file.elf

load

monitor reset init

monitor speed adaptive

Other stuff I have set in the Eclipse Debug tabbed form:

Debugger/GDB command = arm-none-eabi-gdb.exe

Startup/Reset and delay (seconds) = 1 (and checked)

Startup/Halt = checked

thebooney
Associate II
Posted on January 04, 2012 at 17:15

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!