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 Reply Children
  • Hi Ibrahim,

    I have some issues with my laptop and gave it to IT to fix it, unfortunately I would have to look into this before Monday when i get a new laptop. Sorry about the inconvenience.

  • Hello Ibrahim,

    Sorry for the delay. Susheel is out of office, and I will handle your ticket. 

    I have two questions:

    - You say that the watch dog times out after 4 seconds if you feed the watchdog in your init function. Are you sure that your application doesn't reset before the 12 seconds pass? If you try to set a breakpoint on where you feed the watchdog right after you start the application, you should be able to tell if it is being called again due to a reset. 

    - There are some options when you initialize the watchdog. You probably call nrf_drv_wdt_init(&config, wdt_event_handler) somewhere in your project.

    Can you please check what your config.behaviour is?

    From sdk_config.h:

    // <o> NRFX_WDT_CONFIG_BEHAVIOUR  - WDT behavior in CPU SLEEP or HALT mode
     
    // <1=> Run in SLEEP, Pause in HALT 
    // <8=> Pause in SLEEP, Run in HALT 
    // <9=> Run in SLEEP and HALT 
    // <0=> Pause in SLEEP and HALT 
    
    #ifndef NRFX_WDT_CONFIG_BEHAVIOUR
    #define NRFX_WDT_CONFIG_BEHAVIOUR 1
    #endif

    If it is not 9, can you please try to set it to 9 before nrd_drv_wdt_init(&config, wdt_event_handler)? Does it still behave the same?

    Best regards,

    Edvin

Related