This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to detect cause of Reset

Hello,

 

I am using nRF52832, SDK_15.3.0, S132 SoftDevice and Segger for flashing the image. I am using ‘ble_app_blinky’.

 

1) As per below link, do I need to skip GPIO initialization when chip wakeup from System OFF or even peripheral, ble and other initializations (Ex: rtc, timers etc…) can be skipped.

https://devzone.nordicsemi.com/f/nordic-q-a/38550/gpio-value-after-wake-up-from-gpio

 

2) Is there any API to know the status of reset (System OFF, Watchdog etc…) or directly read NRF_POWER->RESETREAS register.

 

3) As per below link, I am trying to print RESETREAS register. But code gets hanged. Do I need to call NRF_POWER->RESETREAS before enabling of SoftDevice.

https://devzone.nordicsemi.com/f/nordic-q-a/38405/detect-wake-up-reason-from-deep-sleep/148200#148200

 

 

    #if 1
    uint32_t u32Reset_reason = NRF_POWER->RESETREAS;
    NRF_LOG_INFO("Reset Status %x", u32Reset_reason);
    NRF_POWER->RESETREAS = NRF_POWER->RESETREAS; // Clear reset reason by writting 1.
    #endif

I called above code after all Peripheral and SoftDevice initilization. But I am getting below debug prints.

<info> app: Reset Status 0

<error> app: SOFTDEVICE: INVALID MEMORY ACCESS

Thanks & Regards

Vishnu Beema

Related