Skip to content
Draft
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
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ jobs:
strategy:
fail-fast: false
matrix:
idf_target: [esp32, esp32s2, esp32s3, esp32c3, esp32c6]
idf_target: [esp32, esp32s2, esp32s3, esp32c3, esp32c6, esp32p4]
idf_version: [v5.2, v5.3, v5.4, v5.5]
exclude:
- idf_target: esp32p4
idf_version: v5.2

container:
image: "espressif/idf:release-${{ matrix.idf_version }}"
Expand Down Expand Up @@ -59,7 +62,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
7 changes: 5 additions & 2 deletions Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ menu "Ethernet Configuration"

choice MICRO_ROS_ETHERNET_TYPE
prompt "Ethernet Type"
default MICRO_ROS_USE_INTERNAL_ETHERNET if IDF_TARGET_ESP32
default MICRO_ROS_USE_INTERNAL_ETHERNET if IDF_TARGET_ESP32 || IDF_TARGET_ESP32P4
default MICRO_ROS_USE_W5500
help
Select which kind of Ethernet will be used in the example.

config MICRO_ROS_USE_INTERNAL_ETHERNET
depends on IDF_TARGET_ESP32
depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32P4
select ETH_USE_ESP32_EMAC
bool "Internal EMAC"
help
Expand Down Expand Up @@ -140,12 +140,14 @@ menu "Ethernet Configuration"

config MICRO_ROS_ETH_MDC_GPIO
int "SMI MDC GPIO number"
default 31 if IDF_TARGET_ESP32P4
default 23
help
Set the GPIO number used by SMI MDC.

config MICRO_ROS_ETH_MDIO_GPIO
int "SMI MDIO GPIO number"
default 52 if IDF_TARGET_ESP32P4
default 18
help
Set the GPIO number used by SMI MDIO.
Expand Down Expand Up @@ -203,6 +205,7 @@ menu "Ethernet Configuration"

config MICRO_ROS_ETH_PHY_RST_GPIO
int "PHY Reset GPIO number"
default 51 if IDF_TARGET_ESP32P4
default 5
help
Set the GPIO number used to reset PHY chip.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, and v5.5 with ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6, and ESP32-P4.

## Dependencies

Expand Down Expand Up @@ -40,7 +40,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|esp32c6]
# 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 Expand Up @@ -76,7 +76,7 @@ cd micro_ros_espidf_component/
pip install catkin_pkg colcon-common-extensions lark

cd examples/int32_publisher
# Set target board [esp32|esp32s2|esp32s3|esp32c3|esp32c6]
# 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
9 changes: 9 additions & 0 deletions idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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]"
Loading