Skip to content

Commit e811475

Browse files
committed
Add support for esp-idf v6.0
1 parent fc2749c commit e811475

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
idf_target: [esp32, esp32s2, esp32s3, esp32c3, esp32c6]
27-
idf_version: [v5.2, v5.3, v5.4, v5.5]
27+
idf_version: [v5.2, v5.3, v5.4, v5.5, v6.0]
2828

2929
container:
3030
image: "espressif/idf:release-${{ matrix.idf_version }}"

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# micro-ROS component for ESP-IDF
99

10-
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.
10+
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.
1111

1212
## Dependencies
1313

@@ -67,7 +67,7 @@ docker run -it --rm --net=host microros/micro-ros-agent:rolling udp4 --port 8888
6767
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:
6868

6969
```bash
70-
docker run --name micro-ros-espidf-component -it espressif/idf:release-v5.5 bash
70+
docker run --name micro-ros-espidf-component -it espressif/idf:release-v6.0 bash
7171

7272
git clone -b rolling https://github.com/micro-ROS/micro_ros_espidf_component.git
7373
cd micro_ros_espidf_component/

‎esp32_toolchain.cmake.in‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ else()
1515
set(FLAGS "-mlongcalls -ffunction-sections -fdata-sections" CACHE STRING "" FORCE)
1616
endif()
1717

18+
include("@BUILD_CONFIG_DIR@/sdkconfig.cmake" OPTIONAL)
19+
if(CONFIG_LIBC_PICOLIBC)
20+
set(FLAGS "${FLAGS} --specs=picolibc.specs" CACHE STRING "" FORCE)
21+
endif()
22+
1823
set(CMAKE_CROSSCOMPILING 1)
1924
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
2025
set(PLATFORM_NAME "LwIP")
@@ -26,10 +31,11 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
2631
set(CMAKE_C_COMPILER @CMAKE_C_COMPILER@)
2732
set(CMAKE_CXX_COMPILER @CMAKE_CXX_COMPILER@)
2833

29-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS} ${IDF_INCLUDES}")
30-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti ${FLAGS} ${IDF_INCLUDES}")
34+
set(CMAKE_C_FLAGS "${FLAGS} ${IDF_INCLUDES}" CACHE STRING "" FORCE)
35+
set(CMAKE_CXX_FLAGS "-fno-exceptions -fno-rtti ${FLAGS} ${IDF_INCLUDES}" CACHE STRING "" FORCE)
3136

32-
add_compile_definitions(ESP_PLATFORM LWIP_IPV4 LWIP_IPV6 PLATFORM_NAME_FREERTOS)
37+
# Workaround for https://github.com/ros2/rcutils/issues/552
38+
add_compile_definitions(ESP_PLATFORM LWIP_IPV4 LWIP_IPV6 PLATFORM_NAME_FREERTOS __STDC_WANT_LIB_EXT1__=1)
3339

3440
include_directories(
3541
"@BUILD_CONFIG_DIR@"

‎network_interfaces/uros_wlan_netif.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ static void wifi_init_sta(void)
8585
},
8686
};
8787
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
88+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0)
89+
ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) );
90+
#else
8891
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
92+
#endif
8993
ESP_ERROR_CHECK(esp_wifi_start() );
9094

9195
ESP_LOGI(TAG, "wifi_init_sta finished.");

0 commit comments

Comments
 (0)