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 Reply Children
  • 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

  • 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 

    void main()
    {   log_init();                                                         //NRF log    
        hal_timers_init();                                                  //HAL Timers Init
        leds_init();                                                        //NRF LED's Init
        power_management_init();                                            //NRF Power Management Init
        (void)UTL_get_resetreason();                                              //HAL Rese Reason
        nrf_power_resetreas_clear(nrf_power_resetreas_get());               //NRF Clear after reset
        hal_rtc_initialize();                                               //HAL initialization of RTC2 for calender.
        ble_sb_initialize();                                                //HAL BLE Init
        hal_scheduler_init();                                               //NRF Scheduler Init
        nrf_mem_init();                                                     //NRF Memory Init
        hal_eeprom_initialize(&config);                                     //HAL EEPROM Init
        nrf_crypto_init();                                                  //NRF Crypto Init
        rtcInterfaceInit();          				                        //APP RTC Init for calender time
         
        hal_Wdt_Config_Enable();
        Read_Error_log_Write_Index();
        Update_Error_Diag_Log_Reset_Reason_Data();
        
        // Enter main loop.
        for (;;)
        { 
            sb_main();                                                                     //SB SoftBroker Main
            hstForeverReadAndHandoffNextPacket();                                          //HAL ECI Receive
            //if ((false == hal_ble_connection_state()) || (CDsIsStillCardData()))         // TODO Will see it later is it really required OR not.
            hstComTaskFxn();                                                               //HAL ECI Com Task
            idle_state_handle();                                                           //NRF idle state handling
            app_sched_execute();                                                           //NRF scheduler  
            hal_Wdt_Feed();                                                                //Re-feeding at the end of the while loop every time.
        }
    }

    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

Related