FreeRTOS + Pico-SDK install with Github fetch

Hi everyone,

I’m currently trying to set up a template project for FreeRTOS with the Pico-SDK.
I found several guides online but I’m trying to make the code as portable between machines as possible since I expect several people to work on it. We’re currently already having a lot of trouble with this in other frameworks (such as PlatformIO), so I’m trying to eliminate as many sources of error as I can.

For this, I’m trying to pull the FreeRTOS kernel and the Pico-SDK from their respective Github repositories. I’ve set up a repository so you can browse through all the files. It’s called Lithimlin/freeRTOS-pico. (As a new user I can’t link it directly unfortunately.)

In the second commit (0df6afd), I’m getting an error from the Pico-SDK because some files are not being generated properly. In the next commit (7784687), I added a workaround to fix this, but I’m not sure if things are being built correctly as now I’m getting a lot of errors about unknown types and implicit function declarations that seem to be stemming from the RP2040 port of FreeRTOS. Perhaps my workaround didn’t fix as much as I’d have liked.

I hope someone here can help out.

Did you try following this guide from Pico?

Yes but without much luck. The issue is also not getting the Pico-SDK to work on its own. It’s specifically the FreeRTOS port I’m having trouble with.

Try to use this demo - FreeRTOS-Community-Supported-Demos/CORTEX_M0+_RP2040 at 3d475bddf7ac8af425da67cdaa2485e90a57a881 · FreeRTOS/FreeRTOS-Community-Supported-Demos · GitHub.

I didn’t yet, seeing as they use an outdated version of the FreeRTOS Kernel before the SMP was merged into the main branch. I don’t have a great overview of the feature difference before and after the merge, but I’ll try it out.

While this project does build correctly, it only does so when I go to the FreeRTOS repo (still can’t link in posts, sorry) and clone it. This makes sense since the demos use code in the Demo/Common directory there.
But this still doesn’t teach me a whole lot about how to make a new small project.

Are you able to follow this CMakeLists.txt file? It uses this file to import pico SDK and this file to import FreeRTOS-Kernel.