cancel
Showing results for 
Search instead for 
Did you mean: 

Question about configTICK_RATE_HZ on FreeRTOS related with Task time ?

antonius
Senior
Posted on March 31, 2017 at 13:47

Everyone,

I have a question about configTICK_RATE_HZ ((TickType_t)1000) related with my Task,

How can I make it slower if my task is a lot slower than 1000Hz, for example it needs 5s or more to finish ?

Thanks

#freertos #systick #stm32
4 REPLIES 4
antonius
Senior
Posted on April 01, 2017 at 08:28

will vTaskDelay(100); help for a longer task ?

I have some tasks that finishes on a long time how can I handle it ?? or with if ...task not finish, return to that task ? how can I check that ?

Thanks

valentin
Senior
Posted on April 03, 2017 at 02:28

To my understanding, you can reduce the tickrate down to 1 if you like. That affects how often the SysTick interrupt is fired and how often your tasks are evaluated for activity regarding context switching.

That said, I don't see any use in reducing the tick frequency and instead just add the according osDelay(xx) inside your task loops. This then allows the OS to still do context switches every ms if required.

I THINK if you increase tick time it'll switch less often meaning you'll probably loose CPU time being wasted in completed tasks.

Correct me if I'm wrong though.

Posted on April 03, 2017 at 02:52

I've reduced to 1Hz, but it doesn't help, probably, semaphore will help,

so it's just like a chain, task 1 finish the job, after finish allow

task 2 doing the job, finish return to task 1 and loop it..

Posted on April 03, 2017 at 06:56

Mutex or semaphore is good enough for task synchronization ?