Both RP-series chips have two cores. Raspberry Pi's FreeRTOS-Kernel fork includes SMP ports (one kernel scheduling tasks across both cores) that plug into the Pico SDK's CMake build.
Set up
- Add the kernel to your project (e.g. as a git submodule) or point to it with
FREERTOS_KERNEL_PATH. - Copy
FreeRTOS_Kernel_import.cmakefrom the port directory into your project and include it:
include(FreeRTOS_Kernel_import.cmake)
With Pico SDK versions after 1.3.1, you can include FreeRTOS later in the build and it only applies to targets that explicitly link it. With 1.3.1 or older, the include must come before pico_sdk_init() and applies to all targets.
Port directories in the fork: portable/ThirdParty/GCC/RP2040 and portable/ThirdParty/GCC/RP2350_ARM_NTZ (Arm, non-TrustZone).
What the port gives you
- Kernel and tasks on core 0, core 1 or both.
- Interoperability: Pico SDK primitives (mutexes, semaphores, queues from
pico_sync) work between FreeRTOS tasks and code on a non-FreeRTOS core or in interrupt handlers.
Known limits (per the READMEs)
- Tickless idle has not been tested on the RP2040 port and is likely non-functional, which matters for low-power designs.
- Running the SMP port on only one core is probably less efficient than the regular non-SMP FreeRTOS kernel; use that if you don't need both cores.
- The RP2350 Arm port requires specific FreeRTOS configuration options (it currently runs at a single privilege level in the secure state); follow its README when writing
FreeRTOSConfig.h.
Alternative
If you only need the second core for one job, the Pico SDK's own multicore support (without an RTOS) may be simpler. The SDK README lists multicore programming among its libraries.