Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4674

SDK • Including SDK Header Files in a Static Library Build

$
0
0
Hello there!
I've recently been trying to build the MicroROS library for the Pico with multithreading support (using FreeRTOS); however, I've encountered an issue.

When building the MicroROS library as a STATIC library, I have to include certain FreeRTOS headers in the toolchain.cmake file.
This usually wouldn't be an issue, however, some header files specific to the RP2040 port of FreeRTOS #include certain SDK libraries. This makes it so that I have to include those headers in toolchain.cmake as well, but I can't do that directly as version.h is generated by the SDK at compile time. (I'm using the micro_ros_setup repo to build MicroROS: https://github.com/micro-ROS/micro_ros_setup)

I've tried including pico_sdk_import.cmake and adding pico_sdk_init() to the toolchain file, but that didn't work.
Is there any way to import the C/C++ SDK header files in an external STATIC library build like this?

My current MicroROS toolchain.cmake file:

Code:

include($ENV{PICO_SDK_PATH}/cmake/preload/toolchains/find_compiler.cmake)set(CMAKE_SYSTEM_NAME Generic)set(CMAKE_CROSSCOMPILING 1)set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus)set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)if (NOT PICO_GCC_TRIPLE)    if (DEFINED ENV{PICO_GCC_TRIPLE})        set(PICO_GCC_TRIPLE $ENV{PICO_GCC_TRIPLE})        message("PICO_GCC_TRIPLE set from environment: $ENV{PICO_GCC_TRIPLE}")    else()        set(PICO_GCC_TRIPLE arm-none-eabi)        message("PICO_GCC_TRIPLE defaulted to arm-none-eabi")    endif()endif()pico_find_compiler(PICO_COMPILER_CC ${PICO_GCC_TRIPLE}-gcc)pico_find_compiler(PICO_COMPILER_CXX ${PICO_GCC_TRIPLE}-g++)set(CMAKE_C_COMPILER ${PICO_COMPILER_CC} CACHE FILEPATH "C compiler")set(CMAKE_CXX_COMPILER ${PICO_COMPILER_CXX} CACHE FILEPATH "C++ compiler")SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")set(FLAGS "-O2 -march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections -fno-exceptions -nostdlib -D'RCUTILS_LOG_MIN_SEVERITY=RCUTILS_LOG_MIN_SEVERITY_NONE'" CACHE STRING "" FORCE)set(CMAKE_C_FLAGS_INIT "-std=c11 ${FLAGS} -DCLOCK_MONOTONIC=0 -D'__attribute__(x)='" CACHE STRING "" FORCE)set(CMAKE_CXX_FLAGS_INIT "-std=c++14 ${FLAGS} -fno-rtti -DCLOCK_MONOTONIC=0 -D'__attribute__(x)='" CACHE STRING "" FORCE)# FreeRTOS Kerneladd_compile_definitions(PLATFORM_NAME_FREERTOS)set(FREERTOS_KERNEL_PATH "${CMAKE_CURRENT_LIST_DIR}/../freertos/FreeRTOS-Kernel")set(FREERTOS_CONFIG_DIR "${CMAKE_CURRENT_LIST_DIR}/../freertos")include_directories("${FREERTOS_CONFIG_DIR}") include_directories("${FREERTOS_KERNEL_PATH}/include") include_directories("${FREERTOS_KERNEL_PATH}/portable/ThirdParty/GCC/RP2040/include")
My colcon.meta file:

Code:

{    "names": {        "tracetools": {            "cmake-args": [                "-DTRACETOOLS_DISABLED=ON",                "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"            ]        },        "rosidl_typesupport": {            "cmake-args": [                "-DROSIDL_TYPESUPPORT_SINGLE_TYPESUPPORT=ON"            ]        },        "rcl": {            "cmake-args": [                "-DBUILD_TESTING=OFF",                "-DRCL_COMMAND_LINE_ENABLED=OFF",                "-DRCL_LOGGING_ENABLED=OFF"            ]        },         "rcutils": {            "cmake-args": [                "-DENABLE_TESTING=OFF",                "-DRCUTILS_NO_FILESYSTEM=ON",                "-DRCUTILS_NO_THREAD_SUPPORT=ON",                "-DRCUTILS_NO_64_ATOMIC=ON",                "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON"            ]        },        "microxrcedds_client": {            "cmake-args": [                "-DUCLIENT_PIC=OFF",                "-DUCLIENT_PROFILE_UDP=OFF",                "-DUCLIENT_PROFILE_TCP=OFF",                "-DUCLIENT_PROFILE_DISCOVERY=OFF",                "-DUCLIENT_PROFILE_SERIAL=OFF",                "-DUCLIENT_PROFILE_STREAM_FRAMING=ON",                "-DUCLIENT_PROFILE_CUSTOM_TRANSPORT=ON",                "-DUCLIENT_PROFILE_MULTITHREAD=ON",                "-DUCLIENT_PROFILE_SHARED_MEMORY=ON"            ]        },        "rmw_microxrcedds": {            "cmake-args": [                "-DRMW_UXRCE_MAX_NODES=2",                "-DRMW_UXRCE_MAX_PUBLISHERS=8",                "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=2",                "-DRMW_UXRCE_MAX_SERVICES=5",                "-DRMW_UXRCE_MAX_CLIENTS=1",                "-DRMW_UXRCE_MAX_HISTORY=4",                "-DRMW_UXRCE_TRANSPORT=custom"            ]        }    }}
The output of ros2 run micro_ros_setup build_firmware.sh "$(pwd)/my_toolchain.cmake" "$(pwd)/my_colcon.meta":

Code:

Crosscompiled environment: cleaning pathBuilding firmware for generate_lib platform genericUsing provided meta: /home/urosdev/pico_ws/uros_ws/my_colcon.metaStarting >>> rcutils Starting >>> rosidl_cliStarting >>> rosidl_typesupport_interface                              Starting >>> microcdrStarting >>> rmw_implementation_cmake                                                                                          Starting >>> tracetoolsStarting >>> tracetools_traceStarting >>> test_interface_filesStarting >>> tracetools_readStarting >>> libyaml_vendor--- stderr: rosidl_typesupport_interface                                                                                                                PICO_GCC_TRIPLE defaulted to arm-none-eabi---Finished <<< rosidl_typesupport_interface [1.09s]--- stderr: rmw_implementation_cmakePICO_GCC_TRIPLE defaulted to arm-none-eabi---Finished <<< rmw_implementation_cmake [1.10s]--- stderr: test_interface_files                                                                                                                             PICO_GCC_TRIPLE defaulted to arm-none-eabi---Finished <<< test_interface_files [1.11s]Finished <<< tracetools_read [1.41s]                                                                                                                             Finished <<< rosidl_cli [1.66s]Starting >>> rosidl_adapterFinished <<< tracetools_trace [1.48s]Starting >>> tracetools_launchStarting >>> ros2trace                                                                                                                           --- stderr: tracetools                                                                                                                                 PICO_GCC_TRIPLE defaulted to arm-none-eabiPICO_GCC_TRIPLE defaulted to arm-none-eabiPICO_GCC_TRIPLE defaulted to arm-none-eabi---Finished <<< tracetools [2.13s]--- stderr: microcdr                                                                                                                                          PICO_GCC_TRIPLE defaulted to arm-none-eabiPICO_GCC_TRIPLE defaulted to arm-none-eabiPICO_GCC_TRIPLE defaulted to arm-none-eabiPICO_GCC_TRIPLE defaulted to arm-none-eabi---Finished <<< microcdr [2.53s]Starting >>> microxrcedds_clientFinished <<< tracetools_launch [1.18s]                                                                                                                       Starting >>> tracetools_testFinished <<< ros2trace [1.17s]--- stderr: rosidl_adapter                                                                                                                                            PICO_GCC_TRIPLE defaulted to arm-none-eabi---Finished <<< rosidl_adapter [1.61s]Starting >>> rosidl_parser--- stderr: rcutils                                                                                                                                               PICO_GCC_TRIPLE defaulted to arm-none-eabiPICO_GCC_TRIPLE defaulted to arm-none-eabiPICO_GCC_TRIPLE defaulted to arm-none-eabiIn file included from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/error_handling.c:35:/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/./error_handling_helpers.h: In function '__rcutils_convert_uint64_t_into_c_str':/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/./error_handling_helpers.h:109:48: warning: unused parameter 'number' [-Wunused-parameter]  109 | __rcutils_convert_uint64_t_into_c_str(uint64_t number, char * buffer, size_t buffer_size)      |                                       ~~~~~~~~~^~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/./error_handling_helpers.h:109:63: warning: unused parameter 'buffer' [-Wunused-parameter]  109 | __rcutils_convert_uint64_t_into_c_str(uint64_t number, char * buffer, size_t buffer_size)      |                                                        ~~~~~~~^~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/./error_handling_helpers.h:109:78: warning: unused parameter 'buffer_size' [-Wunused-parameter]  109 | __rcutils_convert_uint64_t_into_c_str(uint64_t number, char * buffer, size_t buffer_size)      |                                                                       ~~~~~~~^~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/./error_handling_helpers.h: In function '__rcutils_format_error_string':/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/./error_handling_helpers.h:142:28: warning: unused parameter 'error_string' [-Wunused-parameter]  142 |   rcutils_error_string_t * error_string,      |   ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/./error_handling_helpers.h:143:33: warning: unused parameter 'error_state' [-Wunused-parameter]  143 |   const rcutils_error_state_t * error_state)      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/error_handling.c: In function 'rcutils_get_error_string':/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/error_handling.c:240:38: warning: initializer-string for array of 'char' is too long  240 |     return (rcutils_error_string_t) {"error not set"};  // NOLINT(readability/braces)      |                                      ^~~~~~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/error_handling.c:240:38: note: (near initialization for '(anonymous).str')In file included from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/error_handling.c:35:At top level:/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/./error_handling_helpers.h:109:1: warning: '__rcutils_convert_uint64_t_into_c_str' defined but not used [-Wunused-function]  109 | __rcutils_convert_uint64_t_into_c_str(uint64_t number, char * buffer, size_t buffer_size)      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/./error_handling_helpers.h:91:1: warning: '__rcutils_reverse_str' defined but not used [-Wunused-function]   91 | __rcutils_reverse_str(char * string_in, size_t string_len)      | ^~~~~~~~~~~~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/logging.c: In function 'rcutils_get_env_var_zero_or_one':/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/logging.c:130:35: warning: unused parameter 'zero_semantic' [-Wunused-parameter]  130 |   const char * name, const char * zero_semantic,      |                      ~~~~~~~~~~~~~^~~~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/logging.c:131:16: warning: unused parameter 'one_semantic' [-Wunused-parameter]  131 |   const char * one_semantic)      |   ~~~~~~~~~~~~~^~~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/atomic_64bits.c:53:10: warning: conflicting types for built-in function '__atomic_load_8'; expected 'long long unsigned int(const volatile void *, int)' [-Wbuiltin-declaration-mismatch]   53 | uint64_t __atomic_load_8(uint64_t *mem, int model) {      |          ^~~~~~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/atomic_64bits.c:62:6: warning: conflicting types for built-in function '__atomic_store_8'; expected 'void(volatile void *, long long unsigned int,  int)' [-Wbuiltin-declaration-mismatch]   62 | void __atomic_store_8(uint64_t *mem, uint64_t val, int model) {      |      ^~~~~~~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/atomic_64bits.c:70:10: warning: conflicting types for built-in function '__atomic_exchange_8'; expected 'long long unsigned int(volatile void *, long long unsigned int,  int)' [-Wbuiltin-declaration-mismatch]   70 | uint64_t __atomic_exchange_8(uint64_t *mem, uint64_t val, int model) {      |          ^~~~~~~~~~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/atomic_64bits.c:80:10: warning: conflicting types for built-in function '__atomic_fetch_add_8'; expected 'long long unsigned int(volatile void *, long long unsigned int,  int)' [-Wbuiltin-declaration-mismatch]   80 | uint64_t __atomic_fetch_add_8(uint64_t *mem, uint64_t val, int model) {      |          ^~~~~~~~~~~~~~~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/time_unix.c:52:4: warning: #warning is a GCC extension   52 | #  warning no monotonic clock function available      |    ^~~~~~~/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/time_unix.c:52:4: warning: #warning no monotonic clock function available [-Wcpp]/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/time_unix.c: In function 'rcutils_system_time_now':/home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/uros/rcutils/src/time_unix.c:74:3: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]   74 |   clock_gettime(CLOCK_REALTIME, &timespec_now);      |   ^~~~~~~~~~~~~---Finished <<< rcutils [3.43s]Starting >>> rosidl_runtime_cStarting >>> rcl_logging_interfaceFinished <<< tracetools_test [0.99s]                                                                                                                                  --- stderr: microxrcedds_client                                                                                                              PICO_GCC_TRIPLE defaulted to arm-none-eabiPICO_GCC_TRIPLE defaulted to arm-none-eabiIn file included from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/portable.h:53,                 from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/FreeRTOS.h:107,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/multithread/multithread.h:33,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/core/session/stream/output_best_effort_stream.h:27,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/stream/output_best_effort_stream_internal.h:23,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/stream/output_best_effort_stream.c:1:/home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h:39:10: fatal error: pico.h: No such file or directory   39 | #include "pico.h"      |          ^~~~~~~~compilation terminated.In file included from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/portable.h:53,                 from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/FreeRTOS.h:107,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/multithread/multithread.h:33,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/core/session/stream/input_best_effort_stream.h:27,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/stream/input_best_effort_stream_internal.h:23,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/stream/input_best_effort_stream.c:1:/home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h:39:10: fatal error: pico.h: No such file or directory   39 | #include "pico.h"      |          ^~~~~~~~compilation terminated.In file included from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/portable.h:53,                 from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/FreeRTOS.h:107,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/multithread/multithread.h:33,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/core/session/stream/output_best_effort_stream.h:27,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/core/session/stream/stream_storage.h:23,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/stream/stream_storage_internal.h:23,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/stream/stream_storage.c:1:/home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h:39:10: fatal error: pico.h: No such file or directory   39 | #include "pico.h"      |          ^~~~~~~~compilation terminated.In file included from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/portable.h:53,                 from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/FreeRTOS.h:107,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/multithread/multithread.h:33,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/core/session/stream/output_reliable_stream.h:28,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/stream/output_reliable_stream_internal.h:23,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/stream/output_reliable_stream.c:1:/home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h:39:10: fatal error: pico.h: No such file or directory   39 | #include "pico.h"      |          ^~~~~~~~compilation terminated.In file included from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/portable.h:53,                 from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/FreeRTOS.h:107,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/multithread/multithread.h:33,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/core/session/stream/input_reliable_stream.h:28,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/stream/./input_reliable_stream_internal.h:23,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/stream/input_reliable_stream.c:4:/home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h:39:10: fatal error: pico.h: No such file or directory   39 | #include "pico.h"      |          ^~~~~~~~compilation terminated.gmake[2]: *** [CMakeFiles/microxrcedds_client.dir/build.make:107: CMakeFiles/microxrcedds_client.dir/src/c/core/session/stream/output_best_effort_stream.c.obj] Error 1gmake[2]: *** Waiting for unfinished jobs....gmake[2]: *** [CMakeFiles/microxrcedds_client.dir/build.make:93: CMakeFiles/microxrcedds_client.dir/src/c/core/session/stream/input_reliable_stream.c.obj] Error 1gmake[2]: *** [CMakeFiles/microxrcedds_client.dir/build.make:79: CMakeFiles/microxrcedds_client.dir/src/c/core/session/stream/input_best_effort_stream.c.obj] Error 1gmake[2]: *** [CMakeFiles/microxrcedds_client.dir/build.make:121: CMakeFiles/microxrcedds_client.dir/src/c/core/session/stream/output_reliable_stream.c.obj] Error 1gmake[2]: *** [CMakeFiles/microxrcedds_client.dir/build.make:135: CMakeFiles/microxrcedds_client.dir/src/c/core/session/stream/stream_storage.c.obj] Error 1In file included from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/portable.h:53,                 from /home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/include/FreeRTOS.h:107,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/profile/multithread/multithread.h:33,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/core/session/stream/output_best_effort_stream.h:27,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/core/session/stream/stream_storage.h:23,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/include/uxr/client/core/session/session.h:29,                 from /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/eProsima/Micro-XRCE-DDS-Client/src/c/core/session/session.c:1:/home/urosdev/pico_ws/uros_ws/../freertos/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h:39:10: fatal error: pico.h: No such file or directory   39 | #include "pico.h"      |          ^~~~~~~~compilation terminated.gmake[2]: *** [CMakeFiles/microxrcedds_client.dir/build.make:177: CMakeFiles/microxrcedds_client.dir/src/c/core/session/session.c.obj] Error 1gmake[1]: *** [CMakeFiles/Makefile2:86: CMakeFiles/microxrcedds_client.dir/all] Error 2gmake: *** [Makefile:139: all] Error 2---Failed   <<< microxrcedds_client [1.29s, exited with code 2]Aborted  <<< rosidl_parser [0.76s]Aborted  <<< rosidl_runtime_c [1.05s]                                                                                                                Aborted  <<< rcl_logging_interface [1.38s]                                                                           Aborted  <<< libyaml_vendor [5.41s]                                  Summary: 13 packages finished [5.92s]  1 package failed: microxrcedds_client  4 packages aborted: libyaml_vendor rcl_logging_interface rosidl_parser rosidl_runtime_c  12 packages had stderr output: libyaml_vendor microcdr microxrcedds_client rcl_logging_interface rcutils rmw_implementation_cmake rosidl_adapter rosidl_parser rosidl_runtime_c rosidl_typesupport_interface test_interface_files tracetools  50 packages not processed[ros2run]: Process exited with failure 2
The output of ros2 run micro_ros_setup build_firmware.sh "$(pwd)/my_toolchain.cmake" "$(pwd)/my_colcon.meta", when I include the Pico SDK:

Code:

Crosscompiled environment: cleaning pathBuilding firmware for generate_lib platform genericUsing provided meta: /home/urosdev/pico_ws/uros_ws/my_colcon.metaStarting >>> rcutils Starting >>> rosidl_cliStarting >>> rosidl_typesupport_interfaceStarting >>> microcdrStarting >>> rmw_implementation_cmakeStarting >>> tracetoolsStarting >>> tracetools_traceStarting >>> test_interface_filesStarting >>> tracetools_readStarting >>> libyaml_vendor--- stderr: microcdr                                                                                                                                  Using PICO_SDK_PATH from environment ('/pico/pico-sdk')PICO_SDK_PATH is /pico/pico-sdkDefaulting PICO_PLATFORM to rp2040 since not specified.PICO_GCC_TRIPLE defaulted to arm-none-eabiCMake Error at /pico/pico-sdk/pico_sdk_init.cmake:55 (add_subdirectory):  The binary directory    /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/build/microcdr/pico-sdk/pico-sdk  is already used to build a source directory.  It cannot be used to build  source directory    /pico/pico-sdk  Specify a unique binary directory name.Call Stack (most recent call first):  /home/urosdev/pico_ws/uros_ws/my_toolchain.cmake:33 (pico_sdk_init)  /home/urosdev/pico_ws/uros_ws/firmware/mcu_ws/build/microcdr/CMakeFiles/3.22.1/CMakeSystem.cmake:6 (include)  /pico/pico-sdk/CMakeLists.txt:10 (project)Using PICO_SDK_PATH from environment ('/pico/pico-sdk')PICO_SDK_PATH is /pico/pico-sdkDefaulting PICO_PLATFORM to rp2040 since not specified.Defaulting PICO platform compiler to pico_arm_gcc since not specified.PICO compiler is pico_arm_gccPICO_GCC_TRIPLE defaulted to arm-none-eabiCMake Error at /pico/pico-sdk/CMakeLists.txt:10 (project):  Language 'C' is currently being enabled.  Recursive call not allowed.CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguageCMake Error at /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerABI.cmake:49 (try_compile):  Failed to configure test project build system.Call Stack (most recent call first):  /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)  /pico/pico-sdk/CMakeLists.txt:10 (project)---Failed   <<< microcdr [0.66s, exited with code 1]Aborted  <<< rosidl_cli [0.68s]Aborted  <<< tracetools_trace [0.64s]Aborted  <<< tracetools_read [0.63s]Aborted  <<< rmw_implementation_cmake [0.66s]Aborted  <<< rosidl_typesupport_interface [0.67s]Aborted  <<< rcutils [0.69s]Aborted  <<< tracetools [0.65s]Aborted  <<< libyaml_vendor [0.64s]                                                                            Aborted  <<< test_interface_files [0.79s]                            Summary: 0 packages finished [1.12s]  1 package failed: microcdr  9 packages aborted: libyaml_vendor rcutils rmw_implementation_cmake rosidl_cli rosidl_typesupport_interface test_interface_files tracetools tracetools_read tracetools_trace  7 packages had stderr output: libyaml_vendor microcdr rcutils rmw_implementation_cmake rosidl_typesupport_interface test_interface_files tracetools  58 packages not processed[ros2run]: Process exited with failure 1
The rest of the code for this project can be found here: https://github.com/samyarsadat/ROS-Robo ... de/pico_ws

Statistics: Posted by samyarsadat87 — Sun May 05, 2024 11:11 pm — Replies 0 — Views 47



Viewing all articles
Browse latest Browse all 4674

Trending Articles