Merge branch 'feature/support_for_esp32c6_target' into 'master'

Add support for esp32c6 target

See merge request idf/esp-modbus!28
This commit is contained in:
Alex Lisitsyn
2023-01-12 02:52:29 +08:00
8 changed files with 47 additions and 27 deletions

View File

@ -28,7 +28,6 @@ after_script:
# Just for cleaning space, no other causes # Just for cleaning space, no other causes
- git clean -ffdx - git clean -ffdx
# This template gets expanded multiple times, once for every IDF version. # This template gets expanded multiple times, once for every IDF version.
# IDF version is specified by setting the espressif/idf image tag. # 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 image: espressif/idf:release-v4.2
variables: variables:
EXAMPLE_TARGETS: "esp32 esp32s2" EXAMPLE_TARGETS: "esp32 esp32s2"
TEST_TARGETS: "esp32 esp32s2"
build_idf_v4.3: build_idf_v4.3:
extends: .build_template extends: .build_template
image: espressif/idf:release-v4.3 image: espressif/idf:release-v4.3
variables: variables:
EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3" EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3"
TEST_TARGETS: "esp32 esp32s2 esp32c3"
build_idf_v4.4: build_idf_v4.4:
extends: .build_template extends: .build_template
image: espressif/idf:release-v4.4 image: espressif/idf:release-v4.4
variables: variables:
EXAMPLE_TARGETS: "esp32 esp32s2 esp32s3 esp32c3" 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: build_idf_latest:
extends: .build_template extends: .build_template
image: espressif/idf:latest image: espressif/idf:latest
variables: variables:
EXAMPLE_TARGETS: "esp32 esp32s2 esp32s3 esp32c3 esp32c2" EXAMPLE_TARGETS: "esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6"
TEST_TARGETS: "esp32 esp32s3 esp32c2" TEST_TARGETS: "esp32 esp32s2 esp32s3 esp32c3 esp32c2 esp32c6"
# GNU Make based build system is not supported starting from IDF v5.0 # GNU Make based build system is not supported starting from IDF v5.0
SKIP_GNU_MAKE_BUILD: 1 SKIP_GNU_MAKE_BUILD: 1

View File

@ -59,10 +59,15 @@ function build_for_targets
echo "${STARS}" echo "${STARS}"
echo "Building in $PWD with CMake for ${IDF_TARGET}" echo "Building in $PWD with CMake for ${IDF_TARGET}"
preview_target=
if [[ ${IDF_TARGET} == "esp32c6" ]]
then
preview_target="--preview"
fi
if [[ ${IDF_TARGET} != "esp32" ]] if [[ ${IDF_TARGET} != "esp32" ]]
then then
# IDF 4.0 doesn't support idf.py set-target, and only supports esp32. # 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 fi
idf.py build || die "CMake build in ${PWD} has failed for ${IDF_TARGET}" idf.py build || die "CMake build in ${PWD} has failed for ${IDF_TARGET}"
idf.py fullclean idf.py fullclean

View File

@ -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 # 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). 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 | | UART Interface | #define | Default pins for | Default pins for | External RS485 Driver Pin |
| | | | ESP32-S2(S3, C3, C2) | | | | | ESP32 (C6) | ESP32-S2 (S3, C3, C2) | |
| ----------------------|--------------------|-----------------------|-----------------------|---------------------------| | ----------------------|--------------------|-----------------------|-----------------------|---------------------------|
| Transmit Data (TxD) | CONFIG_MB_UART_TXD | GPIO23 | GPIO9 | DI | | Transmit Data (TxD) | CONFIG_MB_UART_TXD | GPIO23 | GPIO9 | DI |
| Receive Data (RxD) | CONFIG_MB_UART_RXD | GPIO22 | GPIO8 | RO | | Receive Data (RxD) | CONFIG_MB_UART_RXD | GPIO22 | GPIO8 | RO |

View File

@ -4,8 +4,8 @@ menu "Modbus Example Configuration"
int "UART port number" int "UART port number"
range 0 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 range 0 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3
default 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 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 default 1 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C6
help help
UART communication port number for Modbus example. UART communication port number for Modbus example.
@ -19,7 +19,8 @@ menu "Modbus Example Configuration"
config MB_UART_RXD config MB_UART_RXD
int "UART RXD pin number" int "UART RXD pin number"
range 0 34 if IDF_TARGET_ESP32 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 46 if IDF_TARGET_ESP32S2
range 0 47 if IDF_TARGET_ESP32S3 range 0 47 if IDF_TARGET_ESP32S3
range 0 19 if IDF_TARGET_ESP32C3 range 0 19 if IDF_TARGET_ESP32C3
@ -32,7 +33,8 @@ menu "Modbus Example Configuration"
config MB_UART_TXD config MB_UART_TXD
int "UART TXD pin number" int "UART TXD pin number"
range 0 34 if IDF_TARGET_ESP32 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 46 if IDF_TARGET_ESP32S2
range 0 47 if IDF_TARGET_ESP32S3 range 0 47 if IDF_TARGET_ESP32S3
range 0 19 if IDF_TARGET_ESP32C3 range 0 19 if IDF_TARGET_ESP32C3
@ -45,7 +47,8 @@ menu "Modbus Example Configuration"
config MB_UART_RTS config MB_UART_RTS
int "UART RTS pin number" int "UART RTS pin number"
range 0 34 if IDF_TARGET_ESP32 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 46 if IDF_TARGET_ESP32S2
range 0 47 if IDF_TARGET_ESP32S3 range 0 47 if IDF_TARGET_ESP32S3
range 0 19 if IDF_TARGET_ESP32C3 range 0 19 if IDF_TARGET_ESP32C3

View File

@ -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 # 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. 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 | | UART Interface | #define | Default pins for | Default pins for | External RS485 Driver Pin |
| | | | ESP32-S2(S3, C3, C2) | | | | | ESP32 (C6) | ESP32-S2 (S3, C3, C2) | |
| ----------------------|--------------------|-----------------------|-----------------------|---------------------------| | ----------------------|--------------------|-----------------------|-----------------------|---------------------------|
| Transmit Data (TxD) | CONFIG_MB_UART_TXD | GPIO23 | GPIO9 | DI | | Transmit Data (TxD) | CONFIG_MB_UART_TXD | GPIO23 | GPIO9 | DI |
| Receive Data (RxD) | CONFIG_MB_UART_RXD | GPIO22 | GPIO8 | RO | | Receive Data (RxD) | CONFIG_MB_UART_RXD | GPIO22 | GPIO8 | RO |

View File

@ -4,8 +4,8 @@ menu "Modbus Example Configuration"
int "UART port number" int "UART port number"
range 0 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3 range 0 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3
default 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 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 default 1 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C6
help help
UART communication port number for Modbus example. UART communication port number for Modbus example.
@ -19,7 +19,8 @@ menu "Modbus Example Configuration"
config MB_UART_RXD config MB_UART_RXD
int "UART RXD pin number" int "UART RXD pin number"
range 0 34 if IDF_TARGET_ESP32 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 46 if IDF_TARGET_ESP32S2
range 0 47 if IDF_TARGET_ESP32S3 range 0 47 if IDF_TARGET_ESP32S3
range 0 19 if IDF_TARGET_ESP32C3 range 0 19 if IDF_TARGET_ESP32C3
@ -32,7 +33,8 @@ menu "Modbus Example Configuration"
config MB_UART_TXD config MB_UART_TXD
int "UART TXD pin number" int "UART TXD pin number"
range 0 34 if IDF_TARGET_ESP32 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 46 if IDF_TARGET_ESP32S2
range 0 47 if IDF_TARGET_ESP32S3 range 0 47 if IDF_TARGET_ESP32S3
range 0 19 if IDF_TARGET_ESP32C3 range 0 19 if IDF_TARGET_ESP32C3
@ -45,7 +47,8 @@ menu "Modbus Example Configuration"
config MB_UART_RTS config MB_UART_RTS
int "UART RTS pin number" int "UART RTS pin number"
range 0 34 if IDF_TARGET_ESP32 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 46 if IDF_TARGET_ESP32S2
range 0 47 if IDF_TARGET_ESP32S3 range 0 47 if IDF_TARGET_ESP32S3
range 0 19 if IDF_TARGET_ESP32C3 range 0 19 if IDF_TARGET_ESP32C3

View File

@ -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 # Modbus TCP Master Example

View File

@ -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 # Modbus Slave Example