Debugging issues with eclipse/command line


#1

Trying to follow the instructions on ODrive firmware page and I’ve got stuck at debugging. If using git bash I get the following output:

Console Printout (collapsed)

tep@TEPW7L MINGW64 /c/Users/tep/Projects/P3035 - Infernal Contraption/SW/Firmware (master)
$ make gdb
arm-none-eabi-gdb build/ODriveFirmware.elf -x openocd.gdbinit
GNU gdb (GNU Tools for ARM Embedded Processors 6-2017-q1-update) 7.12.1.20170215-git
Copyright © 2017 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 build/ODriveFirmware.elf…done.
GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00478-g34180b9 (2017-06-07-21:41)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: target/stm32f4x_stlink.cfg is deprecated, please switch to target/stm32f4x.cfg
Info : auto-selecting first available session transport “hla_swd”. To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
openocd.gdbinit:1: Error in sourced command file:
Remote replied unexpectedly to ‘vMustReplyEmpty’: PacketSize=3fff;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+
(gdb)

Log file output:

Logfile (collapsed)

Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.254183
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection from pipe
Info : device id = 0x10076413
Info : flash size = 1024kbytes
Error: GDB missing ack(2) - assumed good
Info : dropped ‘gdb’ connection

When I use Eclipse it also doesn’t work, makes sense, but then get this output in the console window:

Console Printout (collapsed)

GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00478-g34180b9 (2017-06-07-21:41)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: target/stm32f4x_stlink.cfg is deprecated, please switch to target/stm32f4x.cfg
Info : auto-selecting first available session transport “hla_swd”. To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
Started by GNU ARM Eclipse
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.252590
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
Info : device id = 0x10076413
Info : flash size = 1024kbytes
undefined debug reason 7 - target needs reset
Info : dropped ‘gdb’ connection

I’ve wired in the rst on the STLINK as well. Any suggestions?


#2

Can you do a skype session some evening (UK time)?
I’m in PST.


#3

I am currently using the following version of openocd. Can you try to use that version and see if the problem persists?
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00114-g8419536 (2017-04-18-21:56)

I think it’s this one.


#4

I’m also having problems using Eclipse debug, would someone be able to post a good console window output . I get several different outputs and can’t connect on USB even after hitting resume. Windows 10 with Open On-Chip Debugger 0.10.0-00114-g8419536 (2017-04-18-21:56). Thanks.


#5

When I launch the debug configuration in Eclipse, it works as expected. Note that I don’t have the reset line wired up, just SWD, SWC and GND.

The console print I get:

Console Printout (collapsed)

GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00114-g8419536 (2017-04-18-21:56)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: target/stm32f4x_stlink.cfg is deprecated, please switch to target/stm32f4x.cfg
Info : auto-selecting first available session transport “hla_swd”. To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
Started by GNU ARM Eclipse
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.265469
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
Info : device id = 0x10076413
Info : flash size = 1024kbytes
adapter speed: 2000 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800e654 msp: 0x20020000
adapter speed: 8000 kHz
semihosting is enabled
adapter speed: 2000 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800e654 msp: 0x20020000, semihosting
adapter speed: 8000 kHz
Info : Padding image section 0 with 8 bytes
Info : Padding image section 1 with 4 bytes
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000046 msp: 0x20020000, semihosting
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1939). Workaround: increase “set remotetimeout” in GDB
adapter speed: 2000 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800e658 msp: 0x20020000, semihosting
adapter speed: 2000 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800e658 msp: 0x20020000, semihosting
===== arm v7m registers
(0) r0 (/32): 0x00000000
(1) r1 (/32): 0x00000000
(2) r2 (/32): 0x00000000
(3) r3 (/32): 0x00000000
(4) r4 (/32): 0x00000000
(5) r5 (/32): 0x00000000
(6) r6 (/32): 0x00000000
(7) r7 (/32): 0x00000000
(8) r8 (/32): 0x00000000
(9) r9 (/32): 0x00000000
(10) r10 (/32): 0x00000000
(11) r11 (/32): 0x00000000
(12) r12 (/32): 0x00000000
(13) sp (/32): 0x20020000
(14) lr (/32): 0xFFFFFFFF
(15) pc (/32): 0x0800E658
(16) xPSR (/32): 0x01000000
(17) msp (/32): 0x20020000
(18) psp (/32): 0x00000000
(19) primask (/1): 0x00
(20) basepri (/8): 0x00
(21) faultmask (/1): 0x00
(22) control (/2): 0x00
(23) d0 (/64): 0x0000000000000000
(24) d1 (/64): 0x0000000000000000
(25) d2 (/64): 0x0000000000000000
(26) d3 (/64): 0x0000000000000000
(27) d4 (/64): 0x0000000000000000
(28) d5 (/64): 0x0000000000000000
(29) d6 (/64): 0x0000000000000000
(30) d7 (/64): 0x0000000000000000
(31) d8 (/64): 0x0000000000000000
(32) d9 (/64): 0x0000000000000000
(33) d10 (/64): 0x0000000000000000
(34) d11 (/64): 0x0000000000000000
(35) d12 (/64): 0x0000000000000000
(36) d13 (/64): 0x0000000000000000
(37) d14 (/64): 0x0000000000000000
(38) d15 (/64): 0x0000000000000000
(39) fpscr (/32): 0x00000000
===== Cortex-M DWT registers
(40) dwt_ctrl (/32)
(41) dwt_cyccnt (/32)
(42) dwt_0_comp (/32)
(43) dwt_0_mask (/4)
(44) dwt_0_function (/32)
(45) dwt_1_comp (/32)
(46) dwt_1_mask (/4)
(47) dwt_1_function (/32)
(48) dwt_2_comp (/32)
(49) dwt_2_mask (/4)
(50) dwt_2_function (/32)
(51) dwt_3_comp (/32)
(52) dwt_3_mask (/4)
(53) dwt_3_function (/32)

In Bash I get the exact same error as you @ParkedTom, and it doesn’t work.
Since it is reproducible, I can try to debug it. I am swarmed with lots of stuff to do, so it may take me a while to get around to this unfortunately. If someone in the community finds a solution please do let us know!

As for the Eclipse part, I don’t really know what is different. Let me dump the exact versions I’m using:

  • Windows 10 64 bit
  • Eclipse IDE for C/C++ Developers Version: Neon.3 Release (4.6.3)
  • GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00114-g8419536 (2017-04-18-21:56)
  • GNU gdb (GNU Tools for ARM Embedded Processors 6-2017-q1-update) 7.12.1.20170215-git
  • Debug configuration from ODriveFirmware\ODriveFirmware.launch without any modifications.

#6

Yeah I should be around this coming Thursday (20th July) any time after 18:00BST?


#7

Okay, just contact me on fb or email.


#8

@madcowswe @ParkedTom

I am getting the same issue in git bash. Did you find out what was wrong?


#9

Sorry no I haven’t found anything new since.