Don't clear Reset Source Register on boot
mkj opened this issue · 4 comments
This bootloader (and the standard Portenta H7 one) clears the RSR so it isn't possible for subsequent programs to check the reset reason. Could it be changed to keep the reset source register intact? Thanks.
mcuboot-arduino-stm32h7/app/main.cpp
Line 229 in a828baf
Hi @mkj, thanks for the report.
I've just had a quick look and i think that it can be done calling directly the mbed-os hal function from the bootloader. I will give it a try and let you know.
@mkj storing the reset reason somewhere else, like in an RTC register, would be an acceptable solution?
@pennam any news on this issue? i have a board getting rebooted, and i would like to address the reset cause
It is stored in RTC backup register 8
you should be able to read it like in this example: