Loading...
 

System Workbench for STM32


Debug only works once after code change, Run does not work, Manually resetting the device the uploaded software works

I don’t know what to say. I’m using OSX and ST-LINKV2, latests versions of everything, the problem appears on an empty project and old used-to-work ones. I’ve tried a different probe, different USB port. Here is a typical console output:

Open On-Chip Debugger 0.10.0-dev-00011-g46c94c8 (2018-09-06-08:44)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter_nsrst_delay: 100
adapter speed: 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : vid/pid are not identical: 0x0483/0x374B 0x0483/0x3748
Info : using stlink api v2
Info : Target voltage: 3.238270
Info : Stlink adapter speed set to 1800 kHz
Info : STM32F411CCUx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Info : Stlink adapter speed set to 1800 kHz
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800414c msp: 0x20020000
configuring PLL
Info : Stlink adapter speed set to 4000 kHz
adapter speed: 4000 kHz
Info : device id = 0x10006431
Info : flash size = 256kbytes
Info : Stlink adapter speed set to 1800 kHz
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800414c msp: 0x20020000
Info : Stlink adapter speed set to 1800 kHz
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800414c msp: 0x20020000
configuring PLL
Info : Stlink adapter speed set to 4000 kHz
adapter speed: 4000 kHz
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000046 msp: 0x20020000
Info : Stlink adapter speed set to 1800 kHz
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x1fff4252 msp: 0x20002e58


The above output is the same when the debug work and does not work.

What I mean by “work” and “not work” is: When it works, I get a program breakpoint at the first line of the program. I can then hit continue and the program will run. When it does not work, the program doesn’t break at main and clicking pause gets me to instruction 0x1fff15e2. Sometimes even lower addresses like < 0xf0000.