FreeRTOS on the Raspberry Pi Pico (RP2040) Part 3: Scheduling and Task Priorities

preview_player
Показать описание
FreeRTOS is an open source Real Time OS available for a wide range of microcontrollers and this video is part 3 in a series on using FreeRTOS on RP2040 based boards such as the Raspberry Pi Pico. In this video we show you how the FreeRTOS scheduling algorithm works. We also cover task priorities and task states. By the end of this tutorial you will have a project which explains how task priorities affect task scheduling.

In this tutorial we create a simple program where a Raspberry Pi Pico uses two FreeRTOS tasks to print to a command line over the USB interface which task is running.

Timestamps
00:00 Introduction
01:08 Task Scheduler
03:16 Tick Interrupt
03:32 Context Switching
04:25 Task States
06:13 Task Priorities
07:26 Example
09:58 Conclusions

If this video helped you, please consider leaving a like and subscribing, thank you!

-- Equipment we use regularly --
The following links are affiliate links where I may make a small percentage on qualifying sales through these links. Use the respective UK or US links listed.

All videos and tutorials on this channel and mentioned websites are for educational purposes only.
Рекомендации по теме
Комментарии
Автор

this video is the best tutorial on how to lean FreeRTOS that i have never seen before...! good job!

jackyli
Автор

This video crushes I love the way you do things

andrewkuhl
Автор

This video series is so clear and educative. I hope you will continue.

omerkurt
Автор

Finally the scheduling coverage!
Thanks!

crckdns
Автор

Interesting that a higher priority task can essentially hog the entire CPU.
From memory, the way AmigaOS handled scheduling was it would create a list of all tasks with their priorities, then iterate through the list, subtracting from the priority as it went. Only tasks with priority > 0 would be executed. Once all tasks had reached 0, the list would be repopulated with the original priority value and the process would repeat. This way, even the lowliest task would get some CPU allocation, but a task with priority 10 would get 10x the time slices of a task with priority 1 for example.

thisnthat
Автор

Great content as usual. What about installing FreeRTOS on both cores of the Pico...that would be a great topic! :-)

lfarge
Автор

This delay will only work if compiled without optimisation....

GIJOEG
Автор

That means that high priority task need to cooperate by entering the delay stage in order to give lower priority tasks a chance to execute?
That appears to be not very useful. There is no way to divide the available slots up to all the tasks and give them more or less time slices?
Or is that a problem with the idea of an RTOS?

helmutzollner
Автор

if you want time slicing among equal priorities in the example with for loops, you need to turn on "configUSE_TIME_SLICING" in "FreeRTOSConfig.h".

tuncayusta