raspberrypi / pico-examples

BSD 3-Clause "New" or "Revised" License
2.9k stars 835 forks source link

Cannot build the FreeRTOS examples #234

Closed youca04 closed 2 years ago

youca04 commented 2 years ago

The default behaviour for me was to not find FreeRTOS.h

D:/dev/rpi/pico-examples/pico_w/freertos/iperf/picow_freertos_iperf.c:14:10: fatal error: FreeRTOS.h: No such file or directory 14 | #include "FreeRTOS.h"

If I add include paths to pico_w/freertos/iperf/CMakeLists.txt, then I get further

but cannot find a link library ( (xxx)/arm-none-eabi/bin/ld.exe: cannot find -lFreeRTOS-Kernel-Heap4 collect2.exe: error: ld returned 1 exit status

I'm obviously missing something - possibly config and/or build of FreeRTOS?

kilograham commented 2 years ago

Passing -DFREE_RTOS_KERNEL_PATH=xxx to your cmake invocation is all that you should need.

Make sure you have the very latest main or smp branch of FreeRTOS-Kernel

youca04 commented 2 years ago

@kilograham Thank you very much for the fast response. I did have the kernel source cloned locally as part of the master FreeRTOS repo, but it was pointing to an older kernel (356fff8028734dc50a46972b2e315e2871b0a12e, V10.4.0-kernel-only-208-g356fff802), so I guess this tripped me up. Moving directly to the kernel repo allowed for a successful build.

Perhaps we should note to use the kernel repo directly, and not via FreeRTOS/FreeRTOS-SMP-Demos?