Watchdog reset during DFU

Hello,

While working on the DFU, I can't get MCUBoot to complete a slot swap ... The device always is reset due to the watchdog.

The watchdog is setup in the app. I know that once it is started, it can't be stopped; which is shy the bootloader should feed it.

If I don't enable the watchdog in the app, everything works fine.

I already added the following config to mcuboot.conf, but it does not help.

CONFIG_BOOT_WATCHDOG_FEED=y
CONFIG_WATCHDOG=y

Since I wasn't sure of the usage, I also added this to mcuboot_config.h

  #define MCUBOOT_WATCHDOG_FEED()
     do { 
        wdt_feed(wdt, wdt_channel_id);
      } while (0)
 

What am I missing ? Is there a specific setting I need to have when enabling the watchdog. I currently use wdt_install_timeout(),  wdt_setup() and wdt_feed().

Thanks.

Parents Reply Children
  • Hi,

    I am sorry for the late reply.

    Vincent44 said:

    If I increase the watchdog to 35 sec, I have no problem.

    While increasing the timer is acceptable for my application, I have the feeling that it's just a solution to move around the initial problem

    I agree. The watchdog should be fed in between writing chunks, so ther seems to be an issue here. I need to look into it and get back to you.

    Vincent44 said:
    Is there any specific configuration to have on the watchdog ?

    No, feedign of the watchdog should work out of the box when enabled (it is possible to read all relevant information direclty from the WDT peripheral registers, so configuration is not needed).

  • Hi,

    I have been looking more into this and testing, but I am not able to reproduce it with nRF Connect SDK 2.5.2 (currently the latest). Which SDK version are you using?

    (Note that BOOT_WATCHDOG_FEED is enabled by default if the watchdog is enabled, and as mentionned it reads the WDT registers so no configuration is needed, so normally this is not something you need to think about at all.)

  • Hi Einar,

    I set aside this issue to continue developping other parts of the project.

    Now back to it, I no longer have issue with watchdog during DFU. Not tsure I modified some inits, kconfig, or anything else, but everything works as expected now.

    Thanks.

Related