Skip to content

[BUG] CMake error CORTEX_M0+_RP2040 #812

@Erriez

Description

@Erriez

Describe the bug
I follow the build instructions on https://freertos.org/smp-demos-for-the-raspberry-pi-pico-board.html#building-and-running-the-rtos-demo-applications which results in an error:

$ echo $PICO_SDK_PATH
/home/user/pico/pico-sdk

$ cd FreeRTOS/Demo/CORTEX_M0+_RP2040
$ mkdir build
$ cd build
$ cmake ..

Output:

FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/build$ cmake ..
PICO_SDK_PATH is /home/user/pico/pico-sdk
PICO platform is rp2040.
PICO target board is pico.
Using board configuration from /home/user/pico/pico-sdk/src/boards/include/boards/pico.h
TinyUSB available at /home/user/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
Using PICO_EXAMPLES_PATH from environment ('/home/user/pico/pico-examples')
-- Configuring done
CMake Error at Standard/CMakeLists.txt:15 (add_executable):
  Cannot find source file:

    ../../Common/Minimal/blocktim.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Target

  • Development board: RP2040
  • Instruction Set Architecture: Cortex-M0+
  • IDE and version: Commandline
  • Toolchain and version: cmake version 3.18.4

Host

  • Host OS: Ubuntu
  • Version: 21.04

To Reproduce
Follow build instructions.

Git info
Branch: main
Hash: ad88de6

Expected behavior
No build errors

Additional context
Suggested bugfix:

diff --git a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard/CMakeLists.txt b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard/CMakeLists.txt
index 6fc7bd8ce..c6650cccd 100644
--- a/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard/CMakeLists.txt
+++ b/FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040/Standard/CMakeLists.txt
@@ -17,21 +17,21 @@ add_executable(main_full
         main_full.c
         IntQueueTimer.c
         RegTest.s
-        ../../Common/Minimal/blocktim.c
-        ../../Common/Minimal/countsem.c
-        ../../Common/Minimal/dynamic.c
-        ../../Common/Minimal/recmutex.c
-        ../../Common/Minimal/QueueOverwrite.c
-        ../../Common/Minimal/EventGroupsDemo.c
-        ../../Common/Minimal/IntSemTest.c
-        ../../Common/Minimal/IntQueue.c
-        ../../Common/Minimal/TaskNotify.c
-        ../../Common/Minimal/TimerDemo.c
-        ../../Common/Minimal/GenQTest.c
-        ../../Common/Minimal/death.c
-        ../../Common/Minimal/semtest.c
-        ../../Common/Minimal/BlockQ.c
-        ../../Common/Minimal/flop.c
+        ../../../../Common/Minimal/blocktim.c
+        ../../../../Common/Minimal/countsem.c
+        ../../../../Common/Minimal/dynamic.c
+        ../../../../Common/Minimal/recmutex.c
+        ../../../../Common/Minimal/QueueOverwrite.c
+        ../../../../Common/Minimal/EventGroupsDemo.c
+        ../../../../Common/Minimal/IntSemTest.c
+        ../../../../Common/Minimal/IntQueue.c
+        ../../../../Common/Minimal/TaskNotify.c
+        ../../../../Common/Minimal/TimerDemo.c
+        ../../../../Common/Minimal/GenQTest.c
+        ../../../../Common/Minimal/death.c
+        ../../../../Common/Minimal/semtest.c
+        ../../../../Common/Minimal/BlockQ.c
+        ../../../../Common/Minimal/flop.c
         )
 
 target_compile_definitions(main_full PRIVATE
@@ -40,7 +40,7 @@ target_compile_definitions(main_full PRIVATE
 
 target_include_directories(main_full PRIVATE
         ${CMAKE_CURRENT_LIST_DIR}
-        ${CMAKE_CURRENT_LIST_DIR}/../../Common/include)
+        ${CMAKE_CURRENT_LIST_DIR}/../../../../Common/include)
 
 target_compile_definitions(main_full PRIVATE
         PICO_STDIO_STACK_BUFFER_SIZE=64 # use a small printf on stack buffer
@@ -59,7 +59,7 @@ target_compile_definitions(main_blinky PRIVATE
 
 target_include_directories(main_blinky PRIVATE
         ${CMAKE_CURRENT_LIST_DIR}
-        ${CMAKE_CURRENT_LIST_DIR}/../../Common/include)
+        ${CMAKE_CURRENT_LIST_DIR}/../../../../Common/include)
 
 target_link_libraries(main_blinky pico_stdlib FreeRTOS-Kernel FreeRTOS-Kernel-Heap1)
 pico_add_extra_outputs(main_blinky)
\ No newline at end of file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions