STM32L4R9 reset reason flags always 0 (RCC->CSR)
Details:
MCU: STM32L4R9ZGJ6
IDE: STM32CubeIDE v1.6.1
SDK: STM32Cube_FW_L4_V1.14.0
Board: Custom PCB
Hello,
I am seeing really strange behavior where bits 31-24 in the RCC->CSR register are usually always 0. I have verified this behavior on two boards. The only bit I ever see set is PINRSTF but only after programming the board with the debugger attached. Subsequent resets with NVIC_SystemReset(), toggling NRST, watchdog reset, etc do not set the reset bits accordingly.
I have tried reading the registers after basic system init and immediately upon entering main() with the same result. Below are two tests that read RCC->CSR just after calling NVIC_SystemReset().
Test 1 (Read CSR after basic system init):
Test 2 (Read CSR as soon as main() is entered):
I can't figure out why this would be happening. I skimmed through the MCU erratas and didn't see anything, but I could have overlooked something.
Thanks,
Derek