Updated for FreeRTOS Kernel V11 - January 2024.
FreeRTOS Kernel allows us to add multi-processing to projects on the Raspberry PI Pico. This course teaches the foundations of FreeRTOS Kernel through practical example projects to get you quickly up and running. The course includes 15 separate projects using FreeRTOS Kernel including Symmetric Multi-Processing (using both RP2040 cores).
Updated for FreeRTOS Kernel V11 - January 2024.
FreeRTOS Kernel allows us to add multi-processing to projects on the Raspberry PI Pico. This course teaches the foundations of FreeRTOS Kernel through practical example projects to get you quickly up and running. The course includes 15 separate projects using FreeRTOS Kernel including Symmetric Multi-Processing (using both RP2040 cores).
The course is written for the Raspberry PI Pico and Pico W. The examples will also run on any RP2040 board, though some modification due to different pinouts may be required if the board is different from the Raspberry PI Pico. These examples can be used as a basis for your own projects or as reference examples of the concepts of FreeRTOS Kernel.
This course covers:
Tasks: Multiple concurrent processes on a single core
Semaphores: Sending signals between tasks to protect shared resources
Queues: Queue management. Queues are often used for decoupling tasks
Message Buffers: A queue of variable length items
Symmetric Multiprocessing: Using both RP2040 cores
C++ use of the FreeRTOS Heap
Simple circuits to illuminate LEDs are used in each example. To build these circuits a small amount of equipment is required:
Raspberry PI Pico or Pico W
Micro USB Cable for power
Breadboard and connection wires
12 LEDs. Any colour though examples use 2x Green, 2x Blue, 8x Red
12 75Ohm resistors
Desktop/Laptop for building code and flashing the Pico
The course assumes knowledge of C++. Though each example will walk through the functionality, the course will not talk about the syntax of C++. An understanding of how stack and heap are used by C++ is also assumed.
The course assumes that you can compile and deploy C++ code to the Pico using the Raspberry PI Pico SDK. My other course “Introduction to C Development Environment for Raspberry PICO” teaches these skills.
FreeRTOS Kernel is a foundation state in the journey to more complex projects and IoT devices. Join the course today to have some fun learning FreeRTOS Kernel for the Raspberry PI Pico, Pico W or RP2040 board.
The course goal is to get to grips with FreeRTOS on Raspberry PI PICO, PICO W or RP2040 board. In this lecture, I set out the goal and breadth of the course.
Introduction to Dr Jon Durrant as the tutor for the course. Remember I am here to answer questions as well as the voice in your ears.
The course will break down FreeRTOS Kernel into its component features. Take a step-by-step approach to learn with resources to help you.
This sections summary and resources.
The goals for this section are to talk about the setup required to get going on the course. Then to test the setup out with an example FreeRTOS project.
Raspberry PI Pico Setup
SDK and Code Deployment
Blink External LED, using FreeRTOS
Other RP2040 Devices
Writing C++ for the Pico requires that we have an IDE or Editor, Compiler, Pico SDK, and an approach to deploying binary code to the Pico
There are two strategies for deploying code to the Pico either to use Bootsel or SWD. This lecture briefly summarises these options.
This lecture talks about our first FreeRTOS project to blink an LED. This validates that our build and deploy environment is working.
All of the example projects from the course are included in a code repository. This lecture introduces the structure of the repository and the strategy for reusing libraries.
This lecture briefly talks about some alternative RP2040 boards available. The lecture isn't crucial to the course so can be skipped.
Summary lecture for this section.
This section introduces FreeRTOS Kernels and features.
FreeRTOS is more than just the Kernel library. This section introduces the libraries that FreeRTOS provide that sit alongside the Kernel. Then introduces the features of the Kernel.
The FreeRTOS Kernel is heavily configurable for porting and memory efficiency. This section explains the configuration header file.
Summary lecture for the section.
This section will focus on Task, the key unit of concurrency in FreeRTOS. We will encapsulate a task in a class, explore priority and look at memory management and utilisation.
This lecture refactors the Blink LED example to encapsulate the Task within a C++ class. It looks at the basic control of tasks.
This lecture looks at getting debugging information from FreeRTOS on the tasks and memory usage.
Tasks in FreeRTOS have priority with the highest priority task that is waiting to run being picked next by the scheduler. This lecture explore setting priority and scheduler behaviour.
The method used in this section to construct tasks has all used a dynamic memory model, allocated from the heap. This section looks at how the static memory approach could be used.
This section will define semaphores and look at examples using binary semaphores, counting semaphores and task notification.
This lecture introduces the concept of a semaphore.
This lecture explores an example of using a FreeRTOS Binary Semaphore to protect a shared resource.
This lecture explores an example of using a FreeRTOS Counting Semaphore to reduce the number of tasks which can blink an LED at any one time.
This lecture introduces an algorithm for synchronising tasks.
In order to explore synchronisation, we first need an example demonstrating desynchronized tasks.
This lecture uses Task Notification to achieve synchronisation of tasks.
FreeRTOS has a special type of semaphore called a mutex.
Section summary lecture.
The goals for this section are to explore queues and their usage to decouple tasks.
This lecture introduces the concept of queues and how queues can be used to decouple agent objects in C++.
This lecture introduces FreeRTOS queue functions. The example shows the usage of queues to allow the public interface of an object to place requests on a queue which can then be handled by the run loop.
The goal of this section is to show how message buffers are used to communicate variable length structures between tasks.
This lecture introduces the concepts of a message buffer buffer.
This lecture explores a simple example of using a message buffer which will contain string commands.
This section explores using both cores of the RP2040, firstly through the SDK and then using FreeRTOS SMP.
The RP2040 has two cores. This lecture introduces the two cores, executing code on both cores, identifying which core code is running on, and using the FIFO queues in the SDK to communicate between the cores.
This lecture introduces FreeRTOS SMP, Symmetric Multi-Processing, which allows FreeRTOS to run tasks across both cores under the control of the scheduler.
Congratulations and thank you lecture.
The section goals for this section:
To build a FreeRTOS Kernel V11 application for a single-core
To build a FeeeRTOS V11 SMP application, running on both cores
C++ Memory management, using the FreeRTOS Heap
In this section I briefly introduce the new FreeRTOS Kervel V11 and talk about the updates to the course repo to provide examples using this version of the Kernel.
The V11 Kernel has some slight changes in configuration for the build and the FreeRTOSconfig.h file. I talk through these changes and then show an example running on a single core.
The great advantage of V11 Kernel is that is merges the SMP code base. So we can now switch our application to run on both cores with a simple configuration change. I talk through SMP configuration and show an example of this in this lecture.
By default C++ will use the Pico SDK Heap for the "new" and "delete" operators. We should configure the "new" and "delete" operations to use the FreeRTOS Heap by default. In this lecture I show how to do that.
This is a summary lecture for this section.
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.