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

Watchdog reset during bootloader dfu

Hello,

I am working on using the open_bootloader with our application and running into a problem.

We are using the GP_REG to jump from our application back to the bootloader to perform DFU, Our application uses the watchdog timer upon for monitoring  It appears that if we attempt to jump back to the bootloader for DFU the watchdog continues to run and hard resets the board as soon as the bootloader starts.  I know that is what is causing the reset in the bootloader because if we don't start the watchdog in our application there is no issue performing DFU.

I saw this post https://devzone.nordicsemi.com/f/nordic-q-a/3143/how-to-disable-the-wdt-watchdog-timer and attempted to do the same with no success.

I guess my question are:

1- Is there a way to disable the watchdog in our application before we attempt the DFU?

2- Is there a way to configure the open_bootloader to utilizes the watchdog or do we have to create our own bootloader?

Thanks

Omid

Parents
  • Hi Omid and Einar

    I wanted to share that I experienced the exact same issue as originally reported by Omid and the fix was as Einar suggested.

    When entering DFU mode from the application, using GPREGRET register, DFU mode would successfully enter but the device would reset shortly thereafter.

    I was able to determine that the reason for the reset was a watchdog timeout. The application starts the watchdog. Temporarily not starting the watchdog in the application would solve the reset problem after entering DFU. I didn't expect this as the loop_forever() function in the bootloader is supposed to feed the watchdog, and it was clearly not doing so, despite LFCLK running.

    By including the suggested line below in the bootloader main.c to trigger the clock task, the bootloader then starts feeding the watchdog, resolving my issue:

            nrf_clock_task_trigger(NRF_CLOCK_TASK_LFCLKSTART);

    This applies to SDK 17.0.2 on an nRF52840.

Reply
  • Hi Omid and Einar

    I wanted to share that I experienced the exact same issue as originally reported by Omid and the fix was as Einar suggested.

    When entering DFU mode from the application, using GPREGRET register, DFU mode would successfully enter but the device would reset shortly thereafter.

    I was able to determine that the reason for the reset was a watchdog timeout. The application starts the watchdog. Temporarily not starting the watchdog in the application would solve the reset problem after entering DFU. I didn't expect this as the loop_forever() function in the bootloader is supposed to feed the watchdog, and it was clearly not doing so, despite LFCLK running.

    By including the suggested line below in the bootloader main.c to trigger the clock task, the bootloader then starts feeding the watchdog, resolving my issue:

            nrf_clock_task_trigger(NRF_CLOCK_TASK_LFCLKSTART);

    This applies to SDK 17.0.2 on an nRF52840.

Children
No Data
Related