Getting Reset Reason as Watchdog Reset after image update

Hi Team

We are using the Nrf52840 module for our dev purpose. As part of image update, we Erasing and load the new image to the chip by using Nrf connect App with Jlink Debugger.

After flashing is done, board is Reset and running, at that time when read the  below register, it is always showing reset reason as Watchdog Reset "DOG".

                                                                                           NRF_POWER->RESETREAS 

Without Image update when we power on reset the board, it is showing the Reset reason as  "-RESETPIN".

So when ever we update the image and run the board , by default the Reset reason it should  show "-DOG", is this is expected only, some issue is there is by default. Could anyone give clarity on this one.

Regards,

Srinivas.V

Parents
  • Remember that after reading the RESETREAS register you must clear it by writing '1' to all bits, since the RESETREAS register is retained and can store previous reset values if not cleared.

    Kenneth

  • Hi Kenneth,

    Thanks for your reply. On main function at every start up, we are reading and clearing the Reset reason.

                nrf_power_resetreas_get();

                nrf_power_resetreas_clear(nrf_power_resetreas_get()); //NRF Clear after reset

    Here our doubt is what is expected reset reason when we do the Flash Erase followed new image update with Nrf Connect with jLINK Debugger.

    when we reset the board without flashing it is showing the Reset reason as  "-RESETPIN"., but when we erase and flash the board after that when we read the Reset reason showing the reset reason as Watchdog Reset "DOG".

    Here why it is showing two different Reset reasons, can you please clarity on this one.

    Regards,

    Sinivas.V

Reply
  • Hi Kenneth,

    Thanks for your reply. On main function at every start up, we are reading and clearing the Reset reason.

                nrf_power_resetreas_get();

                nrf_power_resetreas_clear(nrf_power_resetreas_get()); //NRF Clear after reset

    Here our doubt is what is expected reset reason when we do the Flash Erase followed new image update with Nrf Connect with jLINK Debugger.

    when we reset the board without flashing it is showing the Reset reason as  "-RESETPIN"., but when we erase and flash the board after that when we read the Reset reason showing the reset reason as Watchdog Reset "DOG".

    Here why it is showing two different Reset reasons, can you please clarity on this one.

    Regards,

    Sinivas.V

Children
  • I am not sure how much time we should spend on this. But I did try a very simple main() where I simple read, output and cleared resetreas. Nothing else in main(). I am not able to see watchdog reset set on startup, are you sure your application is not enabling watchdog at any time, and when you are programming the watchdog timeout?

  • Hi Kenneth,

    Once again thanks for your reply. we both are not getting into point what i am expecting, here two  scenarios with the same code base i am explaining,

    1. Just Reset the board and Read the Reset reason output and clear , the output showing Reset Reason as "-RESETPIN".

    2. Completely erase the board and reflash it again and after that Read and output and clear the Reset Reason , in this case the out put showing Reset Reason as "DOG".

    3. Yes , in our application we are enabled the Watchdog timer in the main function and in while loop we are re feeding every time, i am adding the code snippet for that 

    Here our doubt was why we are getting Reset Reason as "DOG",as explained in 2 Point, instead of 

    "-RESETPIN", or after erase and Flash by default it should show the Reset Reason as "-DOG" Only, just need clarification on this that sit. Actually QA Team has raised one issue on this , just need clarification from Nordic People, based on that we will close the Defect.

    Regards, 

    Srinivas.V

  • I suggest to change to:

    2. Completely erase the board, POWER CYCLE THE BOARD, and reflash it again and after that Read and output and clear the Reset Reason , in this case the out put showing Reset Reason as "???".

  • Hi Kenneth,

    Thanks for your reply.

    we have followed the sequence what you have suggested in previous reply in point 2.

    2. Completely erase the board, POWER CYCLE THE BOARD,  and reflash it again and after that we have Read and output and clear the Reset Reason. In this case the out put showing Reset Reason as "-RESETPIN" , not as "DOG".

    If we do the Flash erase, Reflash the New Image and POWER CYCLE THE BOARD, in this sequence we are getting the Reset Reason as "-DOG"

    What is difference between these two sequences, if we do flash without power cycle what's happened inside the Registers. Can you please give me or explain the difference.

    Regards,

    Srinivas.V

  • (Sorry if this reply doesn't align with last message)

    Reset is not always what you expect; to be sure power-cycle and power on at least twice before looking at the reset reason to prove the scenarion you describe, as a single power cycle often generates a reset before you get to user code which looks at the reset reason and therefore shows the wrong reset reason. Alternatively place the code which captures the reset reason at the start of the following function, as this function often generates a reset (for example to apply reset pin programming) after a flash erase and reprogram. This function runs before main()