From 7a064f68513cff6e623da0068224fcc45923c84c Mon Sep 17 00:00:00 2001 From: Alex Lisitsyn Date: Thu, 12 Jan 2023 02:52:28 +0800 Subject: [PATCH] Add support for esp32c6 target --- .gitlab-ci.yml | 17 +++++++++++++---- build_all.sh | 7 ++++++- test/serial/mb_serial_master/README.md | 8 ++++---- .../mb_serial_master/main/Kconfig.projbuild | 13 ++++++++----- test/serial/mb_serial_slave/README.md | 8 ++++---- .../mb_serial_slave/main/Kconfig.projbuild | 13 ++++++++----- test/tcp/mb_tcp_master/README.md | 4 ++-- test/tcp/mb_tcp_slave/README.md | 4 ++-- 8 files changed, 47 insertions(+), 27 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2616e9a..d28fb41 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,7 +28,6 @@ after_script: # Just for cleaning space, no other causes - git clean -ffdx - # This template gets expanded multiple times, once for every IDF version. # IDF version is specified by setting the espressif/idf image tag. # @@ -59,26 +58,36 @@ build_idf_v4.2: image: espressif/idf:release-v4.2 variables: EXAMPLE_TARGETS: "esp32 esp32s2" + TEST_TARGETS: "esp32 esp32s2" build_idf_v4.3: extends: .build_template image: espressif/idf:release-v4.3 variables: EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3" + TEST_TARGETS: "esp32 esp32s2 esp32c3" build_idf_v4.4: extends: .build_template image: espressif/idf:release-v4.4 variables: EXAMPLE_TARGETS: "esp32 esp32s2 esp32s3 esp32c3" - TEST_TARGETS: "esp32 esp32s3" + TEST_TARGETS: "esp32 esp32s2 esp32s3 esp32c3" + +build_idf_v5.0: + extends: .build_template + image: espressif/idf:release-v5.0 + variables: + EXAMPLE_TARGETS: "esp32 esp32s2 esp32s3 esp32c2 esp32c3" + TEST_TARGETS: "esp32 esp32s2 esp32s3 esp32c2 esp32c3" + SKIP_GNU_MAKE_BUILD: 1 build_idf_latest: extends: .build_template image: espressif/idf:latest variables: - EXAMPLE_TARGETS: "esp32 esp32s2 esp32s3 esp32c3 esp32c2" - TEST_TARGETS: "esp32 esp32s3 esp32c2" + EXAMPLE_TARGETS: "esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6" + TEST_TARGETS: "esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6" # GNU Make based build system is not supported starting from IDF v5.0 SKIP_GNU_MAKE_BUILD: 1 diff --git a/build_all.sh b/build_all.sh index 6fe4402..0be0e57 100755 --- a/build_all.sh +++ b/build_all.sh @@ -59,10 +59,15 @@ function build_for_targets echo "${STARS}" echo "Building in $PWD with CMake for ${IDF_TARGET}" + preview_target= + if [[ ${IDF_TARGET} == "esp32c6" ]] + then + preview_target="--preview" + fi if [[ ${IDF_TARGET} != "esp32" ]] then # IDF 4.0 doesn't support idf.py set-target, and only supports esp32. - idf.py set-target "${IDF_TARGET}" + idf.py ${preview_target} set-target "${IDF_TARGET}" fi idf.py build || die "CMake build in ${PWD} has failed for ${IDF_TARGET}" idf.py fullclean diff --git a/test/serial/mb_serial_master/README.md b/test/serial/mb_serial_master/README.md index 01e65ce..31679a0 100644 --- a/test/serial/mb_serial_master/README.md +++ b/test/serial/mb_serial_master/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C2 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C2 | ESP32-C6 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | # Modbus Master Example @@ -96,8 +96,8 @@ Define the communication mode parameter for master and slave in Kconfig - CONFIG Configure the slave address for each slave in the Modbus segment (the CONFIG_MB_SLAVE_ADDR in Kconfig). ``` -------------------------------------------------------------------------------------------------------------------------- - | UART Interface | #define | Default ESP32 Pin | Default pins for | External RS485 Driver Pin | - | | | | ESP32-S2(S3, C3, C2) | | + | UART Interface | #define | Default pins for | Default pins for | External RS485 Driver Pin | + | | | ESP32 (C6) | ESP32-S2 (S3, C3, C2) | | | ----------------------|--------------------|-----------------------|-----------------------|---------------------------| | Transmit Data (TxD) | CONFIG_MB_UART_TXD | GPIO23 | GPIO9 | DI | | Receive Data (RxD) | CONFIG_MB_UART_RXD | GPIO22 | GPIO8 | RO | diff --git a/test/serial/mb_serial_master/main/Kconfig.projbuild b/test/serial/mb_serial_master/main/Kconfig.projbuild index eae846f..3d9f150 100644 --- a/test/serial/mb_serial_master/main/Kconfig.projbuild +++ b/test/serial/mb_serial_master/main/Kconfig.projbuild @@ -4,8 +4,8 @@ menu "Modbus Example Configuration" int "UART port number" range 0 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 default 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 - range 0 1 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 - default 1 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 + range 0 1 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C6 + default 1 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C6 help UART communication port number for Modbus example. @@ -19,7 +19,8 @@ menu "Modbus Example Configuration" config MB_UART_RXD int "UART RXD pin number" range 0 34 if IDF_TARGET_ESP32 - default 22 if IDF_TARGET_ESP32 + range 0 23 if IDF_TARGET_ESP32C6 + default 22 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C6 range 0 46 if IDF_TARGET_ESP32S2 range 0 47 if IDF_TARGET_ESP32S3 range 0 19 if IDF_TARGET_ESP32C3 @@ -32,7 +33,8 @@ menu "Modbus Example Configuration" config MB_UART_TXD int "UART TXD pin number" range 0 34 if IDF_TARGET_ESP32 - default 23 if IDF_TARGET_ESP32 + range 0 23 if IDF_TARGET_ESP32C6 + default 23 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C6 range 0 46 if IDF_TARGET_ESP32S2 range 0 47 if IDF_TARGET_ESP32S3 range 0 19 if IDF_TARGET_ESP32C3 @@ -45,7 +47,8 @@ menu "Modbus Example Configuration" config MB_UART_RTS int "UART RTS pin number" range 0 34 if IDF_TARGET_ESP32 - default 18 if IDF_TARGET_ESP32 + range 0 23 if IDF_TARGET_ESP32C6 + default 18 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C6 range 0 46 if IDF_TARGET_ESP32S2 range 0 47 if IDF_TARGET_ESP32S3 range 0 19 if IDF_TARGET_ESP32C3 diff --git a/test/serial/mb_serial_slave/README.md b/test/serial/mb_serial_slave/README.md index 5d5515f..ea3c978 100644 --- a/test/serial/mb_serial_slave/README.md +++ b/test/serial/mb_serial_slave/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C2 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C2 | ESP32-C6 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | # Modbus Slave Example @@ -46,8 +46,8 @@ Select Modbus Example Configuration menu item. Configure the UART pins used for modbus communication using the command and table below. ``` -------------------------------------------------------------------------------------------------------------------------- - | UART Interface | #define | Default ESP32 Pin | Default pins for | External RS485 Driver Pin | - | | | | ESP32-S2(S3, C3, C2) | | + | UART Interface | #define | Default pins for | Default pins for | External RS485 Driver Pin | + | | | ESP32 (C6) | ESP32-S2 (S3, C3, C2) | | | ----------------------|--------------------|-----------------------|-----------------------|---------------------------| | Transmit Data (TxD) | CONFIG_MB_UART_TXD | GPIO23 | GPIO9 | DI | | Receive Data (RxD) | CONFIG_MB_UART_RXD | GPIO22 | GPIO8 | RO | diff --git a/test/serial/mb_serial_slave/main/Kconfig.projbuild b/test/serial/mb_serial_slave/main/Kconfig.projbuild index b249c4e..d661d2b 100644 --- a/test/serial/mb_serial_slave/main/Kconfig.projbuild +++ b/test/serial/mb_serial_slave/main/Kconfig.projbuild @@ -4,8 +4,8 @@ menu "Modbus Example Configuration" int "UART port number" range 0 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 default 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 - range 0 1 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 - default 1 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 + range 0 1 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C6 + default 1 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C6 help UART communication port number for Modbus example. @@ -19,7 +19,8 @@ menu "Modbus Example Configuration" config MB_UART_RXD int "UART RXD pin number" range 0 34 if IDF_TARGET_ESP32 - default 22 if IDF_TARGET_ESP32 + range 0 23 if IDF_TARGET_ESP32C6 + default 22 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C6 range 0 46 if IDF_TARGET_ESP32S2 range 0 47 if IDF_TARGET_ESP32S3 range 0 19 if IDF_TARGET_ESP32C3 @@ -32,7 +33,8 @@ menu "Modbus Example Configuration" config MB_UART_TXD int "UART TXD pin number" range 0 34 if IDF_TARGET_ESP32 - default 23 if IDF_TARGET_ESP32 + range 0 23 if IDF_TARGET_ESP32C6 + default 23 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C6 range 0 46 if IDF_TARGET_ESP32S2 range 0 47 if IDF_TARGET_ESP32S3 range 0 19 if IDF_TARGET_ESP32C3 @@ -45,7 +47,8 @@ menu "Modbus Example Configuration" config MB_UART_RTS int "UART RTS pin number" range 0 34 if IDF_TARGET_ESP32 - default 18 if IDF_TARGET_ESP32 + range 0 23 if IDF_TARGET_ESP32C6 + default 18 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C6 range 0 46 if IDF_TARGET_ESP32S2 range 0 47 if IDF_TARGET_ESP32S3 range 0 19 if IDF_TARGET_ESP32C3 diff --git a/test/tcp/mb_tcp_master/README.md b/test/tcp/mb_tcp_master/README.md index eaffef5..2d51649 100644 --- a/test/tcp/mb_tcp_master/README.md +++ b/test/tcp/mb_tcp_master/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C2 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C2 | ESP32-C6 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | # Modbus TCP Master Example diff --git a/test/tcp/mb_tcp_slave/README.md b/test/tcp/mb_tcp_slave/README.md index 126119c..fa55b3d 100644 --- a/test/tcp/mb_tcp_slave/README.md +++ b/test/tcp/mb_tcp_slave/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C2 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C2 | ESP32-C6 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | # Modbus Slave Example