Spark Logic

Debugging Arduino sketch with STM32 Nucleo in Eclipse .. works !

michael_l Sat Aug 29, 2015 7:17 pm

I have followed this site http://gnuarmeclipse.livius.net/blog/install/ to install GNU arm toolchain, build tools, etc. Compiling works okay, binary is created. I’m using toolchain: gcc-arm-none-eabi-4_9-2015q2-20150609-win32
Debugging does not work. I am quite new to STM32, OpenOCD etc so I might do something wrong.

Based on this log I’m asking what could be wrong ? LD1 flashes red/green and nothing happens after this. It seems to be sort of stuck.

GNU ARM Eclipse 32-bits Open On-Chip Debugger 0.9.0-00073-gdd34716-dirty (2015-05-19-09:56)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Started by GNU ARM Eclipse
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v24 API v2 SWIM v11 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.243243
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x20036410
Warn : STM32 flash size failed, probe inaccurate - assuming 128k flash
Info : flash size = 128kbytes
undefined debug reason 7 - target needs reset
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
semihosting is enabled
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc, semihosting
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000003a msp: 0xfffffffc, semihosting
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x20000000 msp: 0x08000028, semihosting
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x20000000 msp: 0x08000028, semihosting
===== arm v7m registers
(0) r0 (/32): 0x00000020
(1) r1 (/32): 0x00000000
(2) r2 (/32): 0x2000003C
(3) r3 (/32): 0x2000083C
(4) r4 (/32): 0x08000028
(5) r5 (/32): 0x2000006C
(6) r6 (/32): 0x00000020
(7) r7 (/32): 0x00000014
(8) r8 (/32): 0x00000000
(9) r9 (/32): 0x00000000
(10) r10 (/32): 0x00000000
(11) r11 (/32): 0x00000000
(12) r12 (/32): 0x00000000
(13) sp (/32): 0x08000028
(14) lr (/32): 0xFFFFFFFF
(15) pc (/32): 0x20000000
(16) xPSR (/32): 0x00000000
(17) msp (/32): 0x08000028
(18) psp (/32): 0x00000000
(19) primask (/1): 0x00
(20) basepri (/8): 0x00
(21) faultmask (/1): 0x00
(22) control (/2): 0x00
===== Cortex-M DWT registers
(23) dwt_ctrl (/32)
(24) dwt_cyccnt (/32)
(25) dwt_0_comp (/32)
(26) dwt_0_mask (/4)
(27) dwt_0_function (/32)
(28) dwt_1_comp (/32)
(29) dwt_1_mask (/4)
(30) dwt_1_function (/32)
(31) dwt_2_comp (/32)
(32) dwt_2_mask (/4)
(33) dwt_2_function (/32)
(34) dwt_3_comp (/32)
(35) dwt_3_mask (/4)
(36) dwt_3_function (/32)

Replies

Vitalhb Mon Jan 16, 2017 6:23 pm

michael_l wrote:After a long pause decided to try Arduino IDE 1.6.9 and latest Arduino_STM32 .zip package. It looks like Arduino IDE produces .elf binary with correct paths! So I just compiled a OLED sample project and started a debug session with Eclipse. I am using blue pill with St-Link V2 dongle. It worked just fine and I could even add ‘global’ expressions in Eclipse IDE. Just wanted to tell this if someone is trying so there’s no need to use modified Arduino IDE

michael_l Mon Jan 16, 2017 8:02 pm

Hi, please Check my post on 03 Sep 2015 for instructions.

Sign in to reply