Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ jobs:
strategy:
fail-fast: false
matrix:
idf_target: [ esp32, esp32s2, esp32s3, esp32c3, esp32c6]
idf_version: [ "espressif/idf:release-v4.4", "espressif/idf:release-v5.2" ]
idf_target: [ esp32, esp32s2, esp32s3, esp32c3, esp32c6, esp32p4]
idf_version: [ "espressif/idf:release-v4.4", "espressif/idf:release-v5.2", "espressif/idf:release-v5.5" ]
exclude:
# Skip IDF v4 + ESP32C6 combination
- idf_target: esp32c6
idf_version: espressif/idf:release-v4.4
# Skip IDF v4 + ESP32-P4 combination
- idf_target: esp32p4
idf_version: espressif/idf:release-v4.4
# Skip IDF v5.2 + ESP32-P4 combination
- idf_target: esp32p4
idf_version: espressif/idf:release-v5.2

container:
image: ${{ matrix.idf_version }}
Expand All @@ -38,7 +44,12 @@ jobs:
# This line avoids the error when using Python < 3.7 https://importlib-resources.readthedocs.io/en/latest/
pip3 install importlib-resources
# this installs the modules also for global python interpreter, needed for IDF v5
/usr/bin/pip3 install catkin_pkg lark-parser colcon-common-extensions empy==3.3.4 importlib-resources
# IDF 5.5 uses Python 3.12 which has externally-managed-environment protection
if [ "${{ matrix.idf_version }}" == "espressif/idf:release-v5.5" ]; then \
/usr/bin/pip3 install --break-system-packages catkin_pkg lark-parser colcon-common-extensions empy==3.3.4 importlib-resources; \
else \
/usr/bin/pip3 install catkin_pkg lark-parser colcon-common-extensions empy==3.3.4 importlib-resources; \
fi

# This line can be removed when https://github.com/colcon/colcon-python-setup-py/issues/56 is solved
- name: Patch setuptools
Expand All @@ -58,7 +69,7 @@ jobs:

- name: Build sample - low_consumption
shell: bash
if: matrix.idf_target != 'esp32c3' && matrix.idf_target != 'esp32s3' && matrix.idf_target != 'esp32c6'
if: matrix.idf_target != 'esp32c3' && matrix.idf_target != 'esp32s3' && matrix.idf_target != 'esp32c6' && matrix.idf_target != 'esp32p4'
run: |
. $IDF_PATH/export.sh
cd micro_ros_espidf_component/examples/low_consumption
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ jobs:
fail-fast: false
matrix:
branch: [rolling, jazzy, humble]
idf_target: [ esp32, esp32s2, esp32c3, esp32s3, esp32c6]
idf_version: [ "espressif/idf:release-v4.4", "espressif/idf:release-v5.2" ]
idf_target: [ esp32, esp32s2, esp32c3, esp32s3, esp32c6, esp32p4]
idf_version: [ "espressif/idf:release-v4.4", "espressif/idf:release-v5.2", "espressif/idf:release-v5.5" ]
exclude:
# Skip IDF v4 + ESP32C6 combination
- idf_target: esp32c6
idf_version: espressif/idf:release-v4.4
# Skip IDF v4 + ESP32-P4 combination
- idf_target: esp32p4
idf_version: espressif/idf:release-v4.4
# Skip IDF v5.2 + ESP32-P4 combination
- idf_target: esp32p4
idf_version: espressif/idf:release-v5.2


container:
Expand All @@ -43,7 +49,12 @@ jobs:
# This line avoids the error when using Python < 3.7 https://importlib-resources.readthedocs.io/en/latest/
pip3 install importlib-resources
# this installs the modules also for global python interpreter, needed for IDF v5
/usr/bin/pip3 install catkin_pkg lark-parser colcon-common-extensions importlib-resources
# IDF 5.5 uses Python 3.12 which has externally-managed-environment protection
if [ "${{ matrix.idf_version }}" == "espressif/idf:release-v5.5" ]; then \
/usr/bin/pip3 install --break-system-packages catkin_pkg lark-parser colcon-common-extensions importlib-resources; \
else \
/usr/bin/pip3 install catkin_pkg lark-parser colcon-common-extensions importlib-resources; \
fi

# This line can be removed when https://github.com/colcon/colcon-python-setup-py/issues/56 is solved
- name: Patch setuptools
Expand All @@ -63,7 +74,7 @@ jobs:

- name: Build sample - low_consumption
shell: bash
if: matrix.idf_target != 'esp32c3' && matrix.idf_target != 'esp32s3' && matrix.idf_target != 'esp32c6'
if: matrix.idf_target != 'esp32c3' && matrix.idf_target != 'esp32s3' && matrix.idf_target != 'esp32c6' && matrix.idf_target != 'esp32p4'
run: |
. $IDF_PATH/export.sh
cd micro_ros_espidf_component/examples/low_consumption
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# micro-ROS component for ESP-IDF

This component has been tested in ESP-IDF v4.4, and v5.2 with ESP32, ESP32-S2, ESP32-S3, ESP32-C3 and ESP32-C6.
This component has been tested in ESP-IDF v4.4, v5.2, and v5.5 with ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6 and ESP32-P4.

## Dependencies

Expand Down Expand Up @@ -34,7 +34,7 @@ In order to test a int32_publisher example:
```bash
. $IDF_PATH/export.sh
cd examples/int32_publisher
# Set target board [esp32|esp32s2|esp32s3|esp32c3]
# Set target board [esp32|esp32s2|esp32s3|esp32c3|esp32c6|esp32p4]
idf.py set-target esp32
idf.py menuconfig
# Set your micro-ROS configuration and WiFi credentials under micro-ROS Settings
Expand Down
17 changes: 15 additions & 2 deletions esp32_toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ set(CMAKE_SYSTEM_NAME Generic)
set(idf_target "@IDF_TARGET@")
set(idf_path "@IDF_PATH@")

set(RISCV_TARGETS "esp32c3" "esp32c6")
set(RISCV_TARGETS "esp32c3" "esp32c6" "esp32p4")
set(RISCV_HARD_FLOAT_TARGETS "esp32p4")

if("${idf_target}" IN_LIST RISCV_TARGETS)
set(CMAKE_SYSTEM_PROCESSOR riscv)
set(FLAGS "-ffunction-sections -fdata-sections" CACHE STRING "" FORCE)
if("${idf_target}" IN_LIST RISCV_HARD_FLOAT_TARGETS)
# ESP32-P4 uses hardware floating point
set(FLAGS "-march=rv32imafc -mabi=ilp32f -ffunction-sections -fdata-sections" CACHE STRING "" FORCE)
else()
# ESP32-C3/C6 use soft-float
set(FLAGS "-ffunction-sections -fdata-sections" CACHE STRING "" FORCE)
endif()
else()
set(CMAKE_SYSTEM_PROCESSOR xtensa)
set(FLAGS "-mlongcalls -ffunction-sections -fdata-sections" CACHE STRING "" FORCE)
Expand All @@ -35,3 +42,9 @@ include_directories(
"@BUILD_CONFIG_DIR@"
${idf_path}/components/soc/${idf_target}/include
)

if("${idf_target}" IN_LIST RISCV_TARGETS)
include_directories(
${idf_path}/components/riscv/include
)
endif()
2 changes: 2 additions & 0 deletions examples/addtwoints_server/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
managed_components
dependencies.lock
sdkconfig
sdkconfig.old
2 changes: 2 additions & 0 deletions examples/handle_static_types/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
managed_components
dependencies.lock
sdkconfig
sdkconfig.old
2 changes: 2 additions & 0 deletions examples/int32_publisher/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
managed_components
dependencies.lock
sdkconfig
sdkconfig.old
2 changes: 2 additions & 0 deletions examples/int32_publisher_custom_transport/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
managed_components
dependencies.lock
sdkconfig
sdkconfig.old
2 changes: 2 additions & 0 deletions examples/int32_publisher_embeddedrtps/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
managed_components
dependencies.lock
sdkconfig
sdkconfig.old
2 changes: 2 additions & 0 deletions examples/int32_sub_pub/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
managed_components
dependencies.lock
sdkconfig
sdkconfig.old
2 changes: 2 additions & 0 deletions examples/low_consumption/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
managed_components
dependencies.lock
sdkconfig
sdkconfig.old
2 changes: 2 additions & 0 deletions examples/multithread_publisher/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
managed_components
dependencies.lock
sdkconfig
sdkconfig.old
2 changes: 2 additions & 0 deletions examples/parameters/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
managed_components
dependencies.lock
sdkconfig
sdkconfig.old
2 changes: 2 additions & 0 deletions examples/ping_pong/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
managed_components
dependencies.lock
sdkconfig
sdkconfig.old
10 changes: 10 additions & 0 deletions idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dependencies:
espressif/esp_wifi_remote:
version: ">=0.10,<2.0"
rules:
- if: "target in [esp32p4]"
espressif/esp_hosted:
version: "~2"
rules:
- if: "target in [esp32p4]"

15 changes: 8 additions & 7 deletions libmicroros.mk
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,21 @@ ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET),esp32s2 esp32c3 esp32c6))
cd ..; \
rm -rf $(UROS_DIR)/atomic_workaround;
endif
ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET),esp32))
# ESP32-S3, ESP32-P4, ESP32: only need workaround in IDF 5.5
ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET),esp32s3 esp32p4 esp32))
@if [ $(IDF_VERSION_MAJOR) -eq 5 ] && [ $(IDF_VERSION_MINOR) -eq 5 ]; then \
echo $(UROS_DIR)/atomic_workaround; \
mkdir $(UROS_DIR)/atomic_workaround; cd $(UROS_DIR)/atomic_workaround; \
$(X_AR) x $(UROS_DIR)/install/lib/librcutils.a; \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_fetch_add_8; \
if [ $(IDF_VERSION_MAJOR) -ge 5 ] && [ $(IDF_VERSION_MINOR) -ge 3 ]; then \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_load_8; \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_store_8; \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_exchange_8; \
fi; \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_load_8; \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_store_8; \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_exchange_8; \
$(X_AR) rc -s librcutils.a *.obj; \
cp -rf librcutils.a $(UROS_DIR)/install/lib/librcutils.a; \
cd ..; \
rm -rf $(UROS_DIR)/atomic_workaround;
rm -rf $(UROS_DIR)/atomic_workaround; \
fi
endif

$(EXTENSIONS_DIR)/libmicroros.a: $(EXTENSIONS_DIR)/micro_ros_src/install patch_atomic
Expand Down