Skip to content

Commit c8e0c1f

Browse files
AmronosNarukara
andcommitted
Add Support for ESP-IDF v5.5
Co-authored-by: Narukara <narukara17@gmail.com> Co-authored-by: @YanKE01
1 parent fa748f0 commit c8e0c1f

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

.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]
27+
idf_version: [v5.2, v5.3, v5.4, v5.5]
2828

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

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,14 @@ execute_process(
7171
${submake} -j -f libmicroros.mk
7272
X_CC=${CMAKE_C_COMPILER}
7373
X_AR=${CMAKE_AR}
74-
X_STRIP=${CMAKE_STRIP}
75-
X_CFLAGS=${CMAKE_C_FLAGS}
7674
X_CXX=${CMAKE_CXX_COMPILER}
77-
X_CXXFLAGS=${CMAKE_CXX_FLAGS}
7875
C_STANDARD=${CMAKE_C_STANDARD}
7976
MIDDLEWARE=${MIDDLEWARE}
8077
BUILD_DIR=${CMAKE_BINARY_DIR}
8178
IDF_INCLUDES=${IDF_INCLUDES}
8279
IDF_PATH=${IDF_PATH}
8380
IDF_TARGET=${IDF_TARGET}
8481
APP_COLCON_META=${APP_COLCON_META}
85-
IDF_VERSION_MAJOR=${IDF_VERSION_MAJOR}
86-
IDF_VERSION_MINOR=${IDF_VERSION_MINOR}
8782
EXTRA_ROS_PACKAGES=${EXTRA_ROS_PACKAGES}
8883
)
8984
if(libmicroros_ret AND NOT libmicroros_ret EQUAL 0)

README.md

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

44
# micro-ROS component for ESP-IDF
55

6-
This component has been tested in ESP-IDF v5.2, v5.3, and v5.4 with ESP32, ESP32-S2, ESP32-S3, ESP32-C3 and ESP32-C6.
6+
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.
77

88
## Dependencies
99

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

6565
```bash
66-
docker run --name micro-ros-espidf-component -it espressif/idf:release-v5.4 bash
66+
docker run --name micro-ros-espidf-component -it espressif/idf:release-v5.5 bash
6767

6868
git clone -b rolling https://github.com/micro-ROS/micro_ros_espidf_component.git
6969
cd micro_ros_espidf_component/

libmicroros.mk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ else
1010
BUILD_TYPE = Release
1111
endif
1212

13-
CFLAGS_INTERNAL := $(X_CFLAGS) -ffunction-sections -fdata-sections
14-
CXXFLAGS_INTERNAL := $(X_CXXFLAGS) -ffunction-sections -fdata-sections
15-
1613
all: $(EXTENSIONS_DIR)/libmicroros.a
1714

1815
clean:
@@ -27,8 +24,6 @@ $(EXTENSIONS_DIR)/esp32_toolchain.cmake: $(EXTENSIONS_DIR)/esp32_toolchain.cmake
2724
cat $(EXTENSIONS_DIR)/esp32_toolchain.cmake.in | \
2825
sed "s/@CMAKE_C_COMPILER@/$(subst /,\/,$(X_CC))/g" | \
2926
sed "s/@CMAKE_CXX_COMPILER@/$(subst /,\/,$(X_CXX))/g" | \
30-
sed "s/@CFLAGS@/$(subst /,\/,$(CFLAGS_INTERNAL))/g" | \
31-
sed "s/@CXXFLAGS@/$(subst /,\/,$(CXXFLAGS_INTERNAL))/g" | \
3227
sed "s/@IDF_TARGET@/$(subst /,\/,$(IDF_TARGET))/g" | \
3328
sed "s/@IDF_PATH@/$(subst /,\/,$(IDF_PATH))/g" | \
3429
sed "s/@BUILD_CONFIG_DIR@/$(subst /,\/,$(BUILD_DIR)/config)/g" \

network_interfaces/uros_ethernet_netif.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,31 @@ esp_err_t uros_network_interface_initialize(void)
7474
ESP_ERROR_CHECK(esp_event_loop_create_default());
7575
esp_netif_config_t cfg = ESP_NETIF_DEFAULT_ETH();
7676
esp_netif_t *eth_netif = esp_netif_new(&cfg);
77-
// Set default handlers to process TCP/IP stuffs
77+
// Set default handlers to process TCP/IP stuffs (removed in ESP-IDF 5.5+)
78+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 5, 0)
7879
ESP_ERROR_CHECK(esp_eth_set_default_handlers(eth_netif));
80+
#endif
7981
// Register user defined event handers
8082
ESP_ERROR_CHECK(esp_event_handler_register(ETH_EVENT, ESP_EVENT_ANY_ID, &eth_event_handler, NULL));
8183
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_ETH_GOT_IP, &got_ip_event_handler, NULL));
8284

8385
eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG();
86+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)
87+
eth_esp32_emac_config_t esp32_emac_config = ETH_ESP32_EMAC_DEFAULT_CONFIG();
88+
#endif
8489
eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG();
8590
phy_config.phy_addr = CONFIG_MICRO_ROS_ETH_PHY_ADDR;
8691
phy_config.reset_gpio_num = CONFIG_MICRO_ROS_ETH_PHY_RST_GPIO;
8792
#if CONFIG_MICRO_ROS_USE_INTERNAL_ETHERNET
93+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 5, 0)
8894
mac_config.smi_mdc_gpio_num = CONFIG_MICRO_ROS_ETH_MDC_GPIO;
8995
mac_config.smi_mdio_gpio_num = CONFIG_MICRO_ROS_ETH_MDIO_GPIO;
9096
esp_eth_mac_t *mac = esp_eth_mac_new_esp32(&mac_config);
97+
#else
98+
esp32_emac_config.smi_gpio.mdc_num = CONFIG_MICRO_ROS_ETH_MDC_GPIO;
99+
esp32_emac_config.smi_gpio.mdio_num = CONFIG_MICRO_ROS_ETH_MDIO_GPIO;
100+
esp_eth_mac_t *mac = esp_eth_mac_new_esp32(&esp32_emac_config, &mac_config);
101+
#endif
91102
#if CONFIG_MICRO_ROS_ETH_PHY_IP101
92103
esp_eth_phy_t *phy = esp_eth_phy_new_ip101(&phy_config);
93104
#elif CONFIG_MICRO_ROS_ETH_PHY_RTL8201
@@ -161,4 +172,4 @@ esp_err_t uros_network_interface_initialize(void)
161172
return ESP_OK;
162173
}
163174

164-
#endif
175+
#endif

0 commit comments

Comments
 (0)