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

Watchdog event handler timeout

I want to write some values to flash before the watchdog resets. For this I have the watchdog event handler specified:

err_code = nrf_drv_wdt_init(&config, wdt_event_handler);

In the wft_event_handler function I write a struct to flash with the fds module. This struct conaints 16 bytes, so 4 words. If I'm right the watchdog event handler takes 2*32768khz clock cycles, so around 61uS. I read somehwere that 1 words takes about 46 us. Is there a way to increase this timeout somehow? I need to write all this data to flash before a watchdog timeout occurs.

Parents
  • Hi,

    It is not possible to extend the time it takes between the event handler is called and the reset occurs. The only way around this is to sore data in RAM and not in flash, and then (if still needed) write it to flash after the reset. That may seem odd, as the reset behavior table states that the RAM is reset by a watchdog reset. However, the RAM is not explicitly reset and the content will in most cases be intact. You should add a checksum to the data though, so that you can verify after reset that the data is still valid.

Reply
  • Hi,

    It is not possible to extend the time it takes between the event handler is called and the reset occurs. The only way around this is to sore data in RAM and not in flash, and then (if still needed) write it to flash after the reset. That may seem odd, as the reset behavior table states that the RAM is reset by a watchdog reset. However, the RAM is not explicitly reset and the content will in most cases be intact. You should add a checksum to the data though, so that you can verify after reset that the data is still valid.

Children
Related