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

FreeRtos vTaskDelayUntil affect WDT Timeout

Hi 

I am using the NRF52832 ,my code is based on the ble_app_hrs_freertos example sdk 15.0.0 

I have one main task which usually run 64 time every second using the vTaskDelayUntil(&xLastWakeTime, 16)  .

and when trying test the WDT(which is configured to give timeout event after 4000ms) without feeding it a WDT event happens after more than 12 seconds!!!!.

I notice that both the WDT and the freeRtos is using the RTC timer and when i watched the NVIC parameters (the RTC1 and WDT) enable went on/off all the time .

 

Do you have any idea why i get this kind of behavior ??

Thanks a lot

Ibrahim 

Parents
  • Hi Ibrahim,

    and when trying test the WDT(which is configured to give timeout event after 4000ms) without feeding it a WDT event happens after more than 12 seconds!!!!.

    There is nothing in the system that could postpone the WDT timeout event from 4 seconds to 12 seconds. Seems like some of the task in your application is feeding the watchdog. 

    1. Can you please explain the watchdog feeding task mechanism and the task run frequency?
    2. Can you toggle a gpio everytime it feeds the WDT so that we know that WDT is being fed.

    In short, there is no possible way I can see that the WDT is not being fed and still does not timeout immediately after 4000ms. If it does, there is a serious bug in the hardware which is very unlikely.

  • Thank you Susheel for the quick replay 

    i actually have one place that feeds the WDT and it's in the Init function 

    I set a breakpoint on the function nrf_wdt_reload_request_set and counted the time from calling this function until WD reset event and i counted 12 seconds (without feeding the dog in the middle) 

    Without any feeding to the WDT it actually happens after 4 seconds. but that doesn't explain why after 12sec from 1 feeding we get a WDT event

    This is how we feed the WDT :

    //Reload the WDT_REGISTER value.
    nrfx_wdt_channel_feed(NRF_WDT_RR0);

    Thanks a lot 

    ibrahim 

  • This does not sound correct, Can you please give me a minimalistic project to replicate the issue. I will try to debug this both in software and hardware level to see if WDT is really configured for 4 second timeout but the reset you see is 12 seconds after you last fed the WDT. 

Reply Children
Related