diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 035942bc..0b95c279 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: idf_target: [esp32, esp32s2, esp32s3, esp32c3, esp32c6] - idf_version: [v5.2, v5.3, v5.4, v5.5] + idf_version: [v5.2, v5.3, v5.4, v5.5, v6.0] container: image: "espressif/idf:release-${{ matrix.idf_version }}" diff --git a/README.md b/README.md index a7a50a0f..1b1eedc3 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ # micro-ROS component for ESP-IDF -This component has been tested in ESP-IDF v5.2, v5.3, v5.4, and v5.5 with ESP32, ESP32-S2, ESP32-S3, ESP32-C3 and ESP32-C6. +This component has been tested in ESP-IDF v5.2, v5.3, v5.4, v5.5, and v6.0 with ESP32, ESP32-S2, ESP32-S3, ESP32-C3 and ESP32-C6. ## Dependencies @@ -67,7 +67,7 @@ docker run -it --rm --net=host microros/micro-ros-agent:rolling udp4 --port 8888 It's possible to build this example application using the official Espressif [docker images](https://hub.docker.com/r/espressif/idf), following the same steps: ```bash -docker run --name micro-ros-espidf-component -it espressif/idf:release-v5.5 bash +docker run --name micro-ros-espidf-component -it espressif/idf:release-v6.0 bash git clone -b rolling https://github.com/micro-ROS/micro_ros_espidf_component.git cd micro_ros_espidf_component/ diff --git a/esp32_toolchain.cmake.in b/esp32_toolchain.cmake.in index 5bc33a7c..d07e11db 100644 --- a/esp32_toolchain.cmake.in +++ b/esp32_toolchain.cmake.in @@ -15,6 +15,11 @@ else() set(FLAGS "-mlongcalls -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) endif() +include("@BUILD_CONFIG_DIR@/sdkconfig.cmake" OPTIONAL) +if(CONFIG_LIBC_PICOLIBC) + set(FLAGS "${FLAGS} --specs=picolibc.specs" CACHE STRING "" FORCE) +endif() + set(CMAKE_CROSSCOMPILING 1) set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) set(PLATFORM_NAME "LwIP") @@ -26,10 +31,14 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_C_COMPILER @CMAKE_C_COMPILER@) set(CMAKE_CXX_COMPILER @CMAKE_CXX_COMPILER@) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS} ${IDF_INCLUDES}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti ${FLAGS} ${IDF_INCLUDES}") +if(NOT MICROROS_TOOLCHAIN_FLAGS_APPLIED) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS} ${IDF_INCLUDES}" CACHE STRING "" FORCE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti ${FLAGS} ${IDF_INCLUDES}" CACHE STRING "" FORCE) + set(MICROROS_TOOLCHAIN_FLAGS_APPLIED TRUE CACHE INTERNAL "micro-ROS toolchain flags were applied") +endif() -add_compile_definitions(ESP_PLATFORM LWIP_IPV4 LWIP_IPV6 PLATFORM_NAME_FREERTOS) +# Keep `__STDC_WANT_LIB_EXT1__=1` until micro-ROS/rcutils includes ros2/rcutils#555. +add_compile_definitions(ESP_PLATFORM LWIP_IPV4 LWIP_IPV6 PLATFORM_NAME_FREERTOS __STDC_WANT_LIB_EXT1__=1) include_directories( "@BUILD_CONFIG_DIR@" diff --git a/examples/int32_publisher_custom_transport_usbcdc/components/esp_usbcdc_logging/idf_component.yml b/examples/int32_publisher_custom_transport_usbcdc/components/esp_usbcdc_logging/idf_component.yml index 9e845ef0..50d19734 100644 --- a/examples/int32_publisher_custom_transport_usbcdc/components/esp_usbcdc_logging/idf_component.yml +++ b/examples/int32_publisher_custom_transport_usbcdc/components/esp_usbcdc_logging/idf_component.yml @@ -1,6 +1,10 @@ ## IDF Component Manager Manifest File dependencies: espressif/esp_tinyusb: "^1.4.4" + espressif/usb: + version: "*" + rules: + - if: "idf_version >=6.0.0" ## Required IDF version idf: version: ">=5.0" diff --git a/examples/int32_publisher_custom_transport_usbcdc/components/esp_usbcdc_transport/idf_component.yml b/examples/int32_publisher_custom_transport_usbcdc/components/esp_usbcdc_transport/idf_component.yml index 9e845ef0..50d19734 100644 --- a/examples/int32_publisher_custom_transport_usbcdc/components/esp_usbcdc_transport/idf_component.yml +++ b/examples/int32_publisher_custom_transport_usbcdc/components/esp_usbcdc_transport/idf_component.yml @@ -1,6 +1,10 @@ ## IDF Component Manager Manifest File dependencies: espressif/esp_tinyusb: "^1.4.4" + espressif/usb: + version: "*" + rules: + - if: "idf_version >=6.0.0" ## Required IDF version idf: version: ">=5.0" diff --git a/network_interfaces/uros_wlan_netif.c b/network_interfaces/uros_wlan_netif.c index b2a8460a..f2f5a35d 100644 --- a/network_interfaces/uros_wlan_netif.c +++ b/network_interfaces/uros_wlan_netif.c @@ -85,7 +85,11 @@ static void wifi_init_sta(void) }, }; ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); +#else ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); +#endif ESP_ERROR_CHECK(esp_wifi_start() ); ESP_LOGI(TAG, "wifi_init_sta finished.");