Dear co-sufferers,
I'm trying to find out how to properly connect a debugger to the Ublox C027, especially from Eclipse. As a test program, I'm using the C027 HelloWorld sample from mbed online, exported with a Makefile, and imported to Eclipse. I can build it and run it no problem, and I've been half-way successful in connecting OpenOCD from the command line:
>openocd -f ..\scripts\board\mbed-lpc1768.cfg
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.9.0-00073-gdd34716-dirty (2015-05-19-09:55)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
adapter speed: 10 kHz
adapter_nsrst_delay: 200
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 1.0
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 10 kHz
Info : SWD IDCODE 0x2ba01477
Info : lpc17xx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
undefined debug reason 7 - target needs reset
Warn : WARNING! The target is already running. All changes GDB did to registers will be discarded! Waiting for target to halt.
and debugging with gdb:
>arm-none-eabi-gdb C027_HelloWorld.elf -ex "target remote localhost:3333"
GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from C027_HelloWorld.elf...done.
Remote debugging using localhost:3333
0x00000000 in __isr_vector ()
(gdb) continue
Continuing.
WARNING! The target is already running. All changes GDB did to registers will be discarded! Waiting for target to halt.
Program received signal SIGINT, Interrupt.
0x0000127e in wait_us ()
(gdb) info registers
r0 0x1e9f4f0 32109808
r1 0xe8480000 -397934592
r2 0xb 11
r3 0x100002a0 268436128
r4 0x1cd966e 30250606
r5 0x1e8480 2000000
r6 0x12345678 305419896
r7 0x0 0
r8 0x53112309 1393632009
r9 0x10000214 268435988
r10 0xfff8000 268402688
r11 0x0 0
r12 0x0 0
sp 0x10007fe0 0x10007fe0
lr 0x127f 4735
pc 0x127e 0x127e <wait_us+14>
xPSR 0x81000000 -2130706432
(gdb) info locals
No symbol table info available.
(gdb) step
Single stepping until exit from function wait_us,
which has no line number information.
main () at main.cpp:19
19 myled = !myled;
But I'm wondering why the symbol table from the elf file cannot be used - to my understanding, it should be included when building with the compiler options "-O0 -g".
My other problem is that these operations do not seem to work when transferred to an Eclipse launch config, which is described here https://gnuarmeclipse.github.io/debug/openocd/ in great detail.
Started by GNU ARM Eclipse
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 1.0
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 10 kHz
Info : SWD IDCODE 0x2ba01477
Info : lpc17xx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
undefined debug reason 7 - target needs reset
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x1fff0080 msp: 0x10001ffc
Warn : negative acknowledgment, but no packet pending
Info : SWD IDCODE 0x2ba01477
Error: Failed to write memory at 0x00000004
Info : SWD IDCODE 0x2ba01477
Error: Failed to write memory at 0x00001004
Do you have a clue how to load the symbol table correctly? And maybe even how to configure the Eclipse launch config properly?
Is the OpenOCD script for the mbed-lpc1768 even correct? C027 has the same CPU, but it is a different board...
Dear co-sufferers,
I'm trying to find out how to properly connect a debugger to the Ublox C027, especially from Eclipse. As a test program, I'm using the C027 HelloWorld sample from mbed online, exported with a Makefile, and imported to Eclipse. I can build it and run it no problem, and I've been half-way successful in connecting OpenOCD from the command line:
and debugging with gdb:
But I'm wondering why the symbol table from the elf file cannot be used - to my understanding, it should be included when building with the compiler options "-O0 -g".
My other problem is that these operations do not seem to work when transferred to an Eclipse launch config, which is described here https://gnuarmeclipse.github.io/debug/openocd/ in great detail.
Do you have a clue how to load the symbol table correctly? And maybe even how to configure the Eclipse launch config properly?
Is the OpenOCD script for the mbed-lpc1768 even correct? C027 has the same CPU, but it is a different board...