FreeRTOS on Raspberry Pi Pico: Resolve the Port Tree Before Debugging the Kernel
A Pico project can contain a FreeRTOS kernel checkout yet fail before any kernel source is compiled. The missing piece may be the platform-specific port directory selected by the import script, rather than a scheduler defect.
Separate three identities: the requested Pico platform, the kernel root and the actual port tree. This article examines Raspberry Pi's official example import logic as inspected on October 19, 2026, alongside FreeRTOS V11.3.1 repository metadata. It does not certify an arbitrary SDK, compiler and port combination as tested.

Read the path selected by the importer
The official Pico example FreeRTOS import script searches both the older in-tree port layout and a Community-Supported-Ports layout. It selects RP2040, RP2350 RISC-V or RP2350 ARM port paths according to `PICO_PLATFORM`. The final validation expects a CMakeLists file in the selected port directory.
That distinction explains why checking only whether the kernel root exists is insufficient. A valid checkout root can still lack the specific port content the build expects. Conversely, a copied port directory is not necessarily a complete kernel root.
When configuration fails, preserve the complete reported path. Compare its platform segment with the intended chip and instruction set, then inspect the directory rather than repeatedly changing unrelated application include paths. A mismatch between an RP2040 project and an RP2350-oriented configuration needs correction at the platform-selection layer first.
Account for submodule content explicitly
The V11.3.1 kernel submodule metadata declares partner-supported and community-supported port repositories under the kernel's portable tree. That declaration identifies an additional source dependency; it does not prove that a particular local checkout contains initialized content.
For a hypothetical project imported from an archive, the expected port folder may be absent even though the kernel's central source files are present. Check how that archive was assembled and whether the needed external tree was included. For a Git checkout, inspect the submodule state and the recorded revision before treating the checkout as complete.
Use the repository's recorded dependency revision as the starting point. Substituting an unrelated port snapshot just because it contains the missing filename changes the compatibility question. If such a substitution is intentional, it deserves its own build and runtime validation rather than disappearing inside a path fix.
Avoid ambiguity between environment and build configuration
The inspected importer can take `FREERTOS_KERNEL_PATH` from the environment when no value has already been set. It also contains discovery paths and stores the resolved root in CMake's cache. These conveniences make a developer workstation easy to configure, but they can conceal which checkout a build actually used.
For the failing build, inspect the resolved cache value and the importer version included by the application. A project-local import script may be an older copy than the one currently published upstream. Diagnose the script being executed, not a remembered tutorial or a screenshot from another machine.
Prefer a clean, disposable build directory when testing a changed dependency path. Keep the original directory and its configuration available for comparison. The purpose is to distinguish newly selected inputs from cached choices, not to delete evidence until the error disappears.
Prove the dependency graph before expanding the application
Once configuration resolves the intended root and port, build the smallest appropriate official FreeRTOS example for the actual target. Treat successful configuration, compilation and target execution as separate results. None alone establishes that a larger application's interrupts, allocation policy or peripherals are correct.
Record the exact kernel, port dependency, SDK, example and compiler revisions used by that test. The useful outcome is a reproducible starting point: another developer can identify the same source tree without relying on your shell environment. Only then add the application components whose behavior you intend to investigate.