freertos lock timer problem

Greetings ,
I have implemented an application with freertos (sdk 15.3)
which goes into low power and wakes up on two irqs (rtc and button).
When the button irq arrive turns on the system,  performs operations
and then return to a low power state.
When entering low power the task/int rtc are suspended , restored
on wake up.
The anomaly occurs when the system remains in the low
power state   , when I wake up i find that the task
remains frozen / paused (in vTaskDelay / xEventGroupWaitBits ) for a time
proportional to the time it remained in low consumption .
Anyone have any ideas on what to investigate (or a hint) to solve the problem ?

Best regards
Andy

Parents Reply Children
  • Hi ,
    the application runs on a custom hw (i don't have a demo board),
    turning the complete project to you i think would be useless,
    but if you think it can be useful to identify the problem i can send
    you individual files (freertos config ...) .

    Best regards
    Andy

  • you can try sending me the freertos config files but I doubt that the issue can be reproduced just using those changes. But i can give it a try to reproduce the error from your config changes. Also give me your sdk_config.h file and main.c if possible.

  • Hi ,

    in the zip files with some notes.

    https://sendgb.com/FBVOHl1io9j

    Thanks in advance ,
    Best regards
    Andy

  • Hi ,

    i have found something , if i set a define to 1 ( configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG 1 )    the problem does not arise.

    Have any idea what it might mean ? 

    Best regards
    Andy

  • configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG  was designed for tickless sleep and is helpful to have the application have normal debugging experience in the debug mode. In tickless sleep the RTC IRQ is disabled but service the RTC irq is crucial for keeping the internal rtos timer tick updated. So after wakeup from sleep from tickless , the rtc tick handler checks if any ticks handling was missed and updates the internal rtos ticks as needed. In debug mode you do not want to have this feature because you can halt the cpu and you do not want to internal rtos ticks to be updated while the cpu is halted in the debug mode. This will cause all the timers to expire due to internal tick corrections. Hence this config gives you the ability to disable autocorrection and should only be useful when you are debugging the code using a debugger, stepping or halting the CPU.

    when I wake up i find that the task
    remains frozen / paused (in vTaskDelay / xEventGroupWaitBits ) for a time
    proportional to the time it remained in low consumption .

    Something is not right here. Where is this vTaskDelay come into picture from? was there a delay executed in the task just before the sleep or was this vTaskDelay called after wakeup? What is the wakeup Disabling this feature fixes the issue does not sound architecturally correct. 

    How are you observing this problem? are you in the debug mode while this problem happens?

Related