Hello everyone,
After several years of using the Pico, i wanted to try out freeRTOS.
Unfortunately, im failing the demo build.
Cmake gives no error, however, compilation with make stops at 20% due to this error:
[ 17%] Building C object OnEitherCore/CMakeFiles/on_core_zero.dir/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Demo/ThirdParty/Community-Supported-Demos/pico-sdk/lib/tinyusb/src/common/tusb_fifo.c.obj
[ 17%] Building C object OnEitherCore/CMakeFiles/on_core_zero.dir/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Demo/ThirdParty/Community-Supported-Demos/pico-sdk/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c.obj
[ 17%] Building C object OnEitherCore/CMakeFiles/on_core_zero.dir/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Demo/ThirdParty/Community-Supported-Demos/pico-sdk/src/rp2_common/pico_multicore/multicore.c.obj
[ 18%] Linking CXX executable on_core_zero.elf
[ 18%] Built target on_core_zero
[ 19%] Building C object OnEitherCore/CMakeFiles/on_core_one.dir/main.c.obj
[ 19%] Building C object OnEitherCore/CMakeFiles/on_core_one.dir/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Source/portable/ThirdParty/GCC/RP2040/port.c.obj
[ 19%] Building C object OnEitherCore/CMakeFiles/on_core_one.dir/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Source/croutine.c.obj
[ 19%] Building C object OnEitherCore/CMakeFiles/on_core_one.dir/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Source/event_groups.c.obj
[ 19%] Building C object OnEitherCore/CMakeFiles/on_core_one.dir/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Source/list.c.obj
[ 20%] Building C object OnEitherCore/CMakeFiles/on_core_one.dir/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Source/queue.c.obj
[ 20%] Building C object OnEitherCore/CMakeFiles/on_core_one.dir/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Source/stream_buffer.c.obj
/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Source/stream_buffer.c: In function 'prvInitialiseNewStreamBuffer':
/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Source/stream_buffer.c:1375:26: error: unused variable 'xWriteValue' [-Werror=unused-variable]
1375 | const BaseType_t xWriteValue = 0x55;
| ^~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [OnEitherCore/CMakeFiles/on_core_one.dir/build.make:160: OnEitherCore/CMakeFiles/on_core_one.dir/home/daniel/Downloads/FreeRTOSv202212.01/FreeRTOS/Source/stream_buffer.c.obj] Error 1
No I have hunted around in every cmake file i can think of, and also tried to pass the
–compile-no-warnings-as-error flag to cmake to get around it.
Any one have a clue? Is it normal for the source to have unused variables or am i missing something? If normal, how do we get around the error?
EDIT: After setting release manually to “Debug” it compiles cleanly. Is this expected?
I used the official download link that points to FreeRTOS202212.01 so im not really sure what i am missing here
Now, if I force my cmake to use a “Debug” build, these errors goes away and it builds and uploads fine.
And you are referring to NDEBUG, which might be this flag maybe?
However, not sure what the best route is here? Because I of course want it to build cleanly without “hiding” anything, so to speak. And a debug build is probably a bit bigger also…
I’m sorry if I confuse anyone with this thread, . New to freeRTOS and having hard time to gather all the pieces.
However, I did everything from scratch. Downloaded the “Distribution”-version that includes “all the files” The latest one here is the 202212.01 version, it is directly linked from the website.
Inside of that, I put the RP2040 demo from the github in the thirdparty folder.
No issues here.
To build “cleanly” I need to set cmake to Debug release, otherwise it halts with the above error.
So main question now is. Since I want to be able to compile a non-debug version also of course. What needs to be done? Is there a step I’m missing?
Also are these warnings something to be expected and not harmful?
I’m using the RP2040 guide from freeRTOS website and it does not state any further info unfortunately. (Cannot link to it since I’m a new member of the forum)