I'm debugging a STM32F4 (custom board) with ST-LINK2 white dongle. Everything looks good, but after some time running, the debugger unexpectedly stops as if it hits a breakpoint. It does not look like exception. No breakpoints are set, and no breaks in the code. ITM trace is used for debug prints. There are only few prints periodically, not a lot.
When I continue, it often stops again immediately, 1-2 times. After few minutes, another unexplained stop.
No message or popup shows up. Spooky! Tried to reset the target, kill all breakpoints. The chip is cold.
Please suggest how to avoid this. I need the program running!
MDK 5.26.2 on Win10.
Thanks, Pavel A.
I do not recall the processor but I saw this once a good while ago. The cause was a "wild write"
Thank you Erik. What means wild write - out of RAM limits? unaligned?
-- pa
Like a BKPT instruction in a library function, say printf(), exit() or abort()? Look at where it is actually stopping and if there is something consistent. Perhaps pulling some odd state/context when leaving an IRQ/System Handler?
Semihosting ?
Thanks to all responses. No embedded breakpoints, no semihosting (does Keil have it?) Execution stops only in app code. It runs in tight loop.
What is suspicious: the project was built for a slightly different MCU: STM32F407 but I run it on F446. And the memory map has extra area not present on 446. It is not used anyway and marked as no-init. I've fixed the project file manually - replaced the MCU model etc. and now these stops seem to cease.
It would be helpful if the debugger reported anything it sees unusual or suspicious...
Yes:
www.keil.com/.../armcc_pge1358787048379.htm