I have 5 tasks running under FreeRTOS 10.3.1 /CMSIS V2.0 in STM32CubeIDE.
What circumstance is responsible for the freqency a task is invoked?
Hi @Krischu I just grabbed a manual from AWS/FreeRTOS here.
It would be good to learn the principles of scheduling, task priorities, time-sharing, sleeping. And also the relation and interaction between ISRs and tasks.
What circumstance is responsible for the freqency a task is invoked?
In order to become active, a task must be run-able and it must have an equal or higher priority than it’s “competitors”.
Normally I do my best to keep CPU activity at a minimum, by handling all events that may occur interrupt- or event-driven. Don’t want to waste too much time on polling.
But please have a go, download one of the simulator demos for Windows or for Linux, and play with it. Or get an Arduino real board and start playing with a live system.
In addition to what @htibosch said, the following tutorials are also a good starting point to learn FreeRTOS concepts: GitHub - FreeRTOS/Lab-Project-FreeRTOS-Tutorials: Tutorials to learn FreeRTOS Kernel. · GitHub.
Assuming all your tasks are fully CPU bound and all tasks have the same priority and you have preemption and time slicing enabled, your tasks will be scheduled round robin at the frequency determined by your sys tick handler (plus platform dependent latencies).
The assumptions almost never hold true though, as the others who answered pointed out. In any real world system, there are many dependencies between tasks, isrs, peripherals, priority induced shifts and external events like requests coming over communication interfaces which determine how a system eventually behaves.
Thanks . This meets the observtion. I found that the task I assigned to scanning a poano keyboard occured evey 10ms which turned out far too slow.
I then installed a timer interrupt that handled the scanning every 1 ms, so to say outside of FreeRTOS.
Thans for your answers.
ISRs are or can be part of a FreeRTOS based application.
Usually in a way, that an ISR just handles the bare minimum dealing with the hardware and then signal the ISR event (by e.g. task notification, message, semaphore..) to an associated task doing the application side processing.
Just a hint in case you‘re not already aware of it.