Reset when adding or removing breakpoints
I have a STM32L072 and when last I worked on the project, from what I rmember, there were no debugging issues at all.
When I started to work at it again now, I see this effect that, when, in STM32CubeIDE, using a STLINK V3SET debugger, I am in a debugging session, the program is running, when I remove or add a breakpoint, in a part of the code currently not being run, the MCU resets.
Now, one of the later things added was a watchdog (WWDG), so I'd expect to have the WWDG do a reset when breaking. But not just for adding breakpoints in currently inactive code? Or is this normal and I just don't remember?
Now, in the debug settings of CubeIDE, I set the option "Suspend watchdog counters while halted" to ENABLE.
I also already had this line in the watchdog config code:
DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_WWDG_STOP;The behavior is still there...
If this is not normal, what could cause it?
Edit:
It also seems the case that, only when the debugger is connected, I reset the device by writing to it via I2C (the MCU acting as slace), while writing and reading back from the same of my implemented I2C registers works correctly when the debugger is not attached, but the binary version is still the debug version.
