reason for reset ( nrfx_reset_reason_get ) ( hwinfo_get_reset_cause ) not retaining state after boot from bootloader

We are using Zephyr with nRF SDK v2.4.1 on nRF52840. We have a secure bootloader following the example. This all works. Inside the bootloader I can inspect the reason for reset and see it varying with different scenarios as expected. In the main app it is always 0, so has been cleared somehow. I've searched for any 

nrfx_reset_reason_clear() or 
hwinfo_clear_reset_cause
and not found any. Any clues as to what could be clearing it?
If I can't stop the clear, I'll have to store it somewhere.
Parents
  • Hello,

    The bootloader may clear the reset reason as part of its operation. In some cases, the bootloader clears the reset reason before the application can access it. See this thread.

    I've searched for any 

    nrfx_reset_reason_clear() or 
    hwinfo_clear_reset_cause
    and not found any.

    Can you use debugging tools to step through the bootloader code and observe when the reset reason is cleared? This might help you identify the specific code that is responsible.

    Kind Regards,

    Abhijith

Reply
  • Hello,

    The bootloader may clear the reset reason as part of its operation. In some cases, the bootloader clears the reset reason before the application can access it. See this thread.

    I've searched for any 

    nrfx_reset_reason_clear() or 
    hwinfo_clear_reset_cause
    and not found any.

    Can you use debugging tools to step through the bootloader code and observe when the reset reason is cleared? This might help you identify the specific code that is responsible.

    Kind Regards,

    Abhijith

Children
No Data
Related