Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

WDT initialization after FW activation

Hello

It seems that we had a crash during execution of nrf_bootloader_fw_activate() in an added sub function where we program an externally connected MCU and the bootloader was not able to recover.

Now, I see that the init function "nrf_bootloader_init" in nrf_bootloader.c under nRF5_SDK_16.0.0_98a08e2\components\libraries\bootloader shows that the firmware activation is done before WDT initialization.

Can someone explain why the WDT is not already initialized during FW activation?

Thank you.

  • Hi Timon, 

    When entering the bootloader from the application nrf_bootloader_wdt_init() will be called in nrf_bootloader_init() and the WDT feed timer will be started if the WDT was active in the application. Then the DFU transfer will be performed and after the firmware image has been transferred to the nRF52 device, the device will reset before activating the new firmware image.

    The WDT will not be reset during this Soft reset( NVIC_SystemReset())

    Upon entering main() after this reset, nrf_bootloader_init() will be called and nrf_bootloader_fw_activate() will be called, which in turn calls app_activate(), which calls image_copy(). So after the Soft reset you should only see that nrf_bootloader_wdt_init() is called once, i.e. in image_copy().

    -Amanda H.

Related