
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.
The port folder contains a bunch of files. This lecture will explain these at a high level. We look at them again in section 9.
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.
Summary lecture for this section.
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.
Section summary lecture.
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.
Summary lecture for this section.
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.
Section summary lecture.
Section goals:
Configuration
C++ Memory Management
Debugging
FreeRTOS Official Repo
Through the configuration of FreeRTOS Kernel we can configure for different RP2040 boards' memory, but also turn on and off functionality.
In this course, we have used C++ for the examples. C++ by default will use the Pico SDK Heap rather than FreeRTOS Kernel. This section shows how it is configured to use the Kernel heap.
This course has used FreeRTOS repo for the kernel but other ports do exist. Plus the RP2040 and RP2350 configurations for the Kernel are done differently and may show how future version will support RP2040.
An example using the V11.20 kernel on Pico and calculating the value of PI to 1,000 decimal places.
An example using the V11.20 kernel in SMP mode on Pico and calculating the value of PI to 1,000 decimal places.
Some advice on debugging FreeRTOS Kernel application and common issues.
Section summary.
Congratulations and thank you lecture.
Updated for Pico SDK 2.1.1 and FreeRTOS Kernel V11.2.0 - March 2025.
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 for fun learning FreeRTOS Kernel for the Raspberry PI Pico, Pico W or RP2040 board.
FreeRTOS Kernel will also run on the Pico 2 and RP2350 boards. The configuration for the RP2350 is a little bit more complex and not covered by this course.