STM32U5 enter low power modes after debugger connectivity without powercycle
Hi,
I making a product that has the STM32U5 running from a battery, most of the time being in one of the low power modes.
I can use the debugger to .. debug my code, step through it, use SWO etc, and this all works great. However, as long as the debugger is connected, the MCU draws +- 300uA constant current in all sleep modes, while if we are in the sleep mode without the debugger ever having been connected, this is +- 3uA.
If I simply power cycle the MCU after my debugging session, all is fine, and I can enter the low power modules without issue. BUT, once I attach with my debugger (which then enables all the SWD registers), I cannot "disable" this high power usage anymore.(Toggling the nRST pin does not turn off SWD etc)
This is "good".. in the sense that we can use the debugger to follow through lots of events, and even detect resets, but this is "bad", in the usecase where I'd like to run my device in low power for most of the time, and sporadically connect the debugger to debug/flash new code, without disconnecting the power.
The obvious solution is to simply power cycle the device after a debugging session, but the question is whether there is a way to fully hard-reset (meaning also disable the SWD core) without power cycling the MCU?
Thanks for your feedback,
Arnout
