FreeRTOS Symmetric Multiprocessing (SMP) is a recent version of the RTOS that can schedule tasks across multiple controller cores. It's currently in test phase, and they have a version for the RP2040. In this blog post, I go over the very easy exercise to download FreeRTOS SMP for the Pico, and run the examples. |
Download and install
Clone the FreeRTOS SMP demos repository. I placed it on the same place in my directory structure where the pico-examples are installed: It's not mandatory. If you installed the tools with the same installer as I did, the Windows shortcuts will set all environment variables you need - regardless if you use comman dline or VSCode.
cd Documents/pico
git clone https://github.com/FreeRTOS/FreeRTOS-SMP-Demos.git -
-recurse-submodules
Add FreeRTOS-SMP-Demos\FreeRTOS\Demo\CORTEX_M0+_RP2040 to the VSCode workspace you used for pico-examples. The structure shows up in the VSCode explorer. I then copied the .vscode folder I made for the pico-examples (see first post). That is it.
On the bottom toolbar, I then clicked on the pico-examples entry. A selection box appears where you can select the FreeRTOS Demo folder.
Also on the bottom toolbar, select the debug configuration, to switch it to the launch.json copied into the .vscode folder.
Debug an example
At this point, you can - again in the bottom toolbar - select one of the executables. To see if everything works, select main-blinky.
Then select the Run and Debug perspective, and press Debug.
If you did the same steps as me in my first post, the picoprobe will flash the program and stop at the start of main().
Enjoy the first FreeRTOS SMP execution.