Open mkj opened 2 years ago
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
https://github.com/arduino/mcuboot-arduino-stm32h7/commit/fc726574650a348bf2248d1938dfcaefe38b5fe0
you should be able to read it like in this example:
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.
https://github.com/arduino/mcuboot-arduino-stm32h7/blob/a828baf73f93b6aa855a5d185f0ca4fed5755e2f/app/main.cpp#L229