Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dcfb8bc

Browse files
authoredMar 17, 2025··
Merge branch 'master' into release/v3.3.x
2 parents 254c1be + 8e62997 commit dcfb8bc

23 files changed

+270
-176
lines changed
 

‎.github/scripts/set_push_chunks.sh

Lines changed: 90 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,93 @@
22

33
build_all=false
44
chunks_count=0
5+
last_check_files=""
6+
last_check_result=""
7+
gh_output=""
8+
9+
# Define the file patterns
10+
core_files=(
11+
'\.github/.*'
12+
'cores/.*'
13+
'package/.*'
14+
'tools/.*'
15+
'platform\.txt'
16+
'programmers\.txt'
17+
'variants/esp32/.*'
18+
'variants/esp32c3/.*'
19+
'variants/esp32c6/.*'
20+
'variants/esp32h2/.*'
21+
'variants/esp32p4/.*'
22+
'variants/esp32s2/.*'
23+
'variants/esp32s3/.*'
24+
)
25+
library_files=(
26+
'libraries/.*/examples/.*'
27+
'libraries/.*/src/.*'
28+
)
29+
networking_files=(
30+
'libraries/Network/src/.*'
31+
)
32+
fs_files=(
33+
'libraries/FS/src/.*'
34+
)
35+
static_sketches_files=(
36+
'libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure\.ino'
37+
'libraries/BLE/examples/Server/Server\.ino'
38+
'libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer\.ino'
39+
'libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics\.ino'
40+
'libraries/NetworkClientSecure/src/.*'
41+
'libraries/BLE/src/.*'
42+
'libraries/Insights/src/.*'
43+
)
44+
idf_files=(
45+
'idf_component\.yml'
46+
'Kconfig\.projbuild'
47+
'CMakeLists\.txt'
48+
'variants/esp32c2/.*'
49+
)
50+
51+
# Function to check if any files match the patterns
52+
check_files() {
53+
local patterns=("$@")
54+
local files_found=""
55+
for pattern in "${patterns[@]}"; do
56+
echo "Checking pattern: $pattern"
57+
matched_files=$(echo "$gh_output" | grep -E "$pattern")
58+
echo "matched_files: $matched_files"
59+
files_found+="$matched_files "
60+
done
61+
62+
last_check_files=$(echo "$files_found" | xargs)
63+
if [[ -n $last_check_files ]]; then
64+
last_check_result="true"
65+
else
66+
last_check_result="false"
67+
fi
68+
echo "last_check_result: $last_check_result"
69+
}
70+
71+
if [[ $IS_PR != 'true' ]]; then
72+
gh_output=$(gh api repos/espressif/arduino-esp32/commits/"$GITHUB_SHA" --jq '.files[].filename')
73+
else
74+
gh_output=$(gh pr diff "$PR_NUM" --name-only)
75+
fi
76+
echo "gh_output: $gh_output"
77+
78+
# Output the results
79+
check_files "${core_files[@]}"
80+
CORE_CHANGED=$last_check_result
81+
check_files "${library_files[@]}"
82+
LIB_CHANGED=$last_check_result
83+
LIB_FILES=$last_check_files
84+
check_files "${networking_files[@]}"
85+
NETWORKING_CHANGED=$last_check_result
86+
check_files "${fs_files[@]}"
87+
FS_CHANGED=$last_check_result
88+
check_files "${static_sketches_files[@]}"
89+
STATIC_SKETCHES_CHANGED=$last_check_result
90+
check_files "${idf_files[@]}"
91+
IDF_CHANGED=$last_check_result
592

693
if [[ $CORE_CHANGED == 'true' ]] || [[ $IS_PR != 'true' ]]; then
794
echo "Core files changed or not a PR. Building all."
@@ -76,9 +163,9 @@ chunks+="]"
76163

77164
{
78165
echo "build_all=$build_all"
79-
echo "build_libraries=$BUILD_LIBRARIES"
80-
echo "build_static_sketches=$BUILD_STATIC_SKETCHES"
81-
echo "build_idf=$BUILD_IDF"
166+
echo "build_libraries=$LIB_CHANGED"
167+
echo "build_static_sketches=$STATIC_SKETCHES_CHANGED"
168+
echo "build_idf=$IDF_CHANGED"
82169
echo "chunk_count=$chunks_count"
83170
echo "chunks=$chunks"
84171
} >> "$GITHUB_OUTPUT"

‎.github/scripts/sketch_utils.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
249249
build_dir="$ARDUINO_BUILD_DIR"
250250
elif [ "$len" -eq 1 ]; then
251251
# build_dir="$sketchdir/build"
252-
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
252+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build.tmp"
253253
fi
254254

255255
output_file="$HOME/.arduino/cli_compile_output.txt"
@@ -259,7 +259,7 @@ function build_sketch { # build_sketch <ide_path> <user_path> <path-to-ino> [ext
259259
for i in $(seq 0 $((len - 1))); do
260260
if [ "$len" -ne 1 ]; then
261261
# build_dir="$sketchdir/build$i"
262-
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
262+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build$i.tmp"
263263
fi
264264
rm -rf "$build_dir"
265265
mkdir -p "$build_dir"

‎.github/scripts/tests_run.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ function run_test {
2727
fi
2828

2929
if [ "$len" -eq 1 ]; then
30-
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build.tmp/sdkconfig"
30+
sdkconfig_path="$HOME/.arduino/tests/$target/$sketchname/build.tmp/sdkconfig"
3131
else
32-
sdkconfig_path="$HOME/.arduino/tests/$sketchname/build0.tmp/sdkconfig"
32+
sdkconfig_path="$HOME/.arduino/tests/$target/$sketchname/build0.tmp/sdkconfig"
3333
fi
3434

3535
if [ -f "$sketchdir"/ci.json ]; then
@@ -45,7 +45,7 @@ function run_test {
4545
fi
4646

4747
if [ ! -f "$sdkconfig_path" ]; then
48-
printf "\033[93mSketch %s not built\nMight be due to missing target requirements or build failure\033[0m\n" "$sketchname"
48+
printf "\033[93mSketch %s build not found in %s\nMight be due to missing target requirements or build failure\033[0m\n" "$(dirname "$sdkconfig_path")" "$sketchname"
4949
printf "\n\n\n"
5050
return 0
5151
fi
@@ -60,7 +60,7 @@ function run_test {
6060

6161
if [ "$len" -eq 1 ]; then
6262
# build_dir="$sketchdir/build"
63-
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
63+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build.tmp"
6464
report_file="$sketchdir/$target/$sketchname.xml"
6565
fi
6666

@@ -83,7 +83,7 @@ function run_test {
8383

8484
if [ "$len" -ne 1 ]; then
8585
# build_dir="$sketchdir/build$i"
86-
build_dir="$HOME/.arduino/tests/$sketchname/build$i.tmp"
86+
build_dir="$HOME/.arduino/tests/$target/$sketchname/build$i.tmp"
8787
report_file="$sketchdir/$target/$sketchname$i.xml"
8888
fi
8989

‎.github/workflows/build_py_tools.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ jobs:
3030
echo "Make sure you are using a branch inside the repository and not a fork."
3131
3232
- name: Verify Python Tools Changed
33-
uses: tj-actions/changed-files@v41
3433
id: verify-changed-files
35-
with:
36-
fetch_depth: "2"
37-
since_last_remote_commit: "true"
38-
files: |
39-
tools/get.py
40-
tools/espota.py
41-
tools/gen_esp32part.py
42-
tools/gen_insights_package.py
34+
run: |
35+
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r ^HEAD -- tools/get.py tools/espota.py tools/gen_esp32part.py tools/gen_insights_package.py | xargs)
36+
echo "all_changed_files=$CHANGED_FILES" >> $GITHUB_OUTPUT
37+
if [ -n "$CHANGED_FILES" ]; then
38+
echo "any_changed=true" >> $GITHUB_OUTPUT
39+
else
40+
echo "any_changed=false" >> $GITHUB_OUTPUT
41+
fi
42+
4343
- name: List all changed files
4444
shell: bash
4545
run: |

‎.github/workflows/pre-commit.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,22 @@ jobs:
5858

5959
- name: Get changed files
6060
id: changed-files
61-
uses: tj-actions/changed-files@v42.0.2
61+
env:
62+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
PR_NUM: ${{ github.event.pull_request.number }}
64+
IS_PR: ${{ github.event_name == 'pull_request' }}
65+
GITHUB_SHA: ${{ github.sha }}
66+
run: |
67+
if [[ $IS_PR != 'true' ]]; then
68+
files_changed=$(gh api repos/espressif/arduino-esp32/commits/"$GITHUB_SHA" --jq '.files[].filename' | xargs)
69+
else
70+
files_changed=$(gh pr diff "$PR_NUM" --name-only | xargs)
71+
fi
72+
echo "all_changed_files=$files_changed" >> $GITHUB_OUTPUT
73+
echo "Changed files:"
74+
for file in $files_changed; do
75+
echo " $file"
76+
done
6277
6378
- name: Run pre-commit hooks in changed files
6479
run: pre-commit run --color=always --show-diff-on-failure --files ${{ steps.changed-files.outputs.all_changed_files }}

‎.github/workflows/push.yml

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ on:
4545
- "!.github/scripts/tests_*"
4646
- "!.github/scripts/upload_*"
4747
- "variants/esp32/**/*"
48-
- "variants/esp32s2/**/*"
49-
- "variants/esp32s3/**/*"
5048
- "variants/esp32c2/**/*"
5149
- "variants/esp32c3/**/*"
50+
- "variants/esp32c5/**/*"
5251
- "variants/esp32c6/**/*"
5352
- "variants/esp32h2/**/*"
54-
- "variants/esp32c5/**/*"
53+
- "variants/esp32p4/**/*"
54+
- "variants/esp32s2/**/*"
55+
- "variants/esp32s3/**/*"
5556

5657
concurrency:
5758
group: build-${{github.event.pull_request.number || github.ref}}
@@ -86,58 +87,13 @@ jobs:
8687
with:
8788
fetch-depth: 2
8889

89-
- name: Get changed files
90-
id: changed-files
91-
uses: tj-actions/changed-files@v44
92-
with:
93-
files_yaml: |
94-
core:
95-
- '.github/**'
96-
- 'cores/**'
97-
- 'package/**'
98-
- 'tools/**'
99-
- 'platform.txt'
100-
- 'programmers.txt'
101-
- "variants/esp32/**/*"
102-
- "variants/esp32s2/**/*"
103-
- "variants/esp32s3/**/*"
104-
- "variants/esp32c3/**/*"
105-
- "variants/esp32c6/**/*"
106-
- "variants/esp32h2/**/*"
107-
libraries:
108-
- 'libraries/**/examples/**'
109-
- 'libraries/**/src/**'
110-
networking:
111-
- 'libraries/Network/src/**'
112-
fs:
113-
- 'libraries/FS/src/**'
114-
static_sketeches:
115-
- 'libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino'
116-
- 'libraries/BLE/examples/Server/Server.ino'
117-
- 'libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino'
118-
- 'libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics.ino'
119-
- 'libraries/NetworkClientSecure/src/**'
120-
- 'libraries/BLE/src/**'
121-
- 'libraries/Insights/src/**'
122-
idf:
123-
- 'idf_component.yml'
124-
- 'Kconfig.projbuild'
125-
- 'CMakeLists.txt'
126-
- "variants/esp32c2/**/*"
127-
12890
- name: Set chunks
12991
id: set-chunks
13092
env:
131-
LIB_FILES: ${{ steps.changed-files.outputs.libraries_all_changed_files }}
13293
IS_PR: ${{ github.event_name == 'pull_request' }}
94+
PR_NUM: ${{ github.event.pull_request.number }}
13395
MAX_CHUNKS: ${{ env.MAX_CHUNKS }}
134-
BUILD_IDF: ${{ steps.changed-files.outputs.idf_any_changed == 'true' }}
135-
BUILD_LIBRARIES: ${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
136-
BUILD_STATIC_SKETCHES: ${{ steps.changed-files.outputs.static_sketeches_any_changed == 'true' }}
137-
FS_CHANGED: ${{ steps.changed-files.outputs.fs_any_changed == 'true' }}
138-
NETWORKING_CHANGED: ${{ steps.changed-files.outputs.networking_any_changed == 'true' }}
139-
CORE_CHANGED: ${{ steps.changed-files.outputs.core_any_changed == 'true' }}
140-
LIB_CHANGED: ${{ steps.changed-files.outputs.libraries_any_changed == 'true' }}
96+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14197
run: |
14298
bash ./.github/scripts/set_push_chunks.sh
14399

‎.github/workflows/tests_build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
with:
2727
key: tests-${{ env.id }}-bin
2828
path: |
29-
~/.arduino/tests/**/build*.tmp/*.bin
30-
~/.arduino/tests/**/build*.tmp/*.elf
31-
~/.arduino/tests/**/build*.tmp/*.json
32-
~/.arduino/tests/**/build*.tmp/sdkconfig
29+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
30+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
31+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.json
32+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/sdkconfig
3333
3434
- name: Evaluate if tests should be built
3535
id: check-build
@@ -73,18 +73,18 @@ jobs:
7373
with:
7474
key: tests-${{ env.id }}-bin
7575
path: |
76-
~/.arduino/tests/**/build*.tmp/*.bin
77-
~/.arduino/tests/**/build*.tmp/*.elf
78-
~/.arduino/tests/**/build*.tmp/*.json
79-
~/.arduino/tests/**/build*.tmp/sdkconfig
76+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
77+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
78+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.json
79+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/sdkconfig
8080
8181
- name: Upload ${{ inputs.chip }} ${{ inputs.type }} binaries as artifacts
8282
uses: actions/upload-artifact@v4
8383
with:
8484
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
8585
overwrite: true
8686
path: |
87-
~/.arduino/tests/**/build*.tmp/*.bin
88-
~/.arduino/tests/**/build*.tmp/*.elf
89-
~/.arduino/tests/**/build*.tmp/*.json
90-
~/.arduino/tests/**/build*.tmp/sdkconfig
87+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.bin
88+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.elf
89+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/*.json
90+
~/.arduino/tests/${{ inputs.chip }}/**/build*.tmp/sdkconfig

‎.github/workflows/tests_hw.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ defaults:
2222
jobs:
2323
hardware-test:
2424
name: Hardware ${{ inputs.chip }} ${{ inputs.type }} tests
25-
runs-on: [arduino, "${{ inputs.chip }}"]
25+
runs-on: ["arduino", "${{ inputs.chip }}"]
2626
env:
2727
id: ${{ github.event.pull_request.number || github.ref }}-${{ github.event.pull_request.head.sha || github.sha }}-${{ inputs.chip }}-${{ inputs.type }}
2828
container:
2929
image: python:3.10.1-bullseye
30-
options: --privileged
30+
options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw"
3131
steps:
32+
- name: Clean workspace
33+
run: |
34+
rm -rf ./*
35+
rm -rf ~/.arduino/tests
36+
3237
- name: Check if already passed
3338
id: cache-results
3439
if: github.event.pull_request.number != null
@@ -81,7 +86,12 @@ jobs:
8186
with:
8287
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
8388
path: |
84-
~/.arduino/tests
89+
~/.arduino/tests/${{ inputs.chip }}
90+
91+
- name: List binaries
92+
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
93+
run: |
94+
ls -laR ~/.arduino/tests
8595
8696
- name: Run Tests
8797
if: ${{ steps.check-tests.outputs.enabled == 'true' }}

‎.github/workflows/tests_qemu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
with:
118118
name: tests-bin-${{ inputs.chip }}-${{ inputs.type }}
119119
path: |
120-
~/.arduino/tests
120+
~/.arduino/tests/${{ inputs.chip }}
121121
122122
- name: Run Tests
123123
if: ${{ steps.check-tests.outputs.enabled == 'true' }}

‎.github/workflows/tests_wokwi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ jobs:
276276
run-id: ${{ github.event.workflow_run.id }}
277277
name: tests-bin-${{ matrix.chip }}-${{ matrix.type }}
278278
path: |
279-
~/.arduino/tests
279+
~/.arduino/tests/${{ matrix.chip }}
280280
281281
- name: Run Tests
282282
if: ${{ steps.check-tests.outputs.enabled == 'true' }}

‎README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Arduino core for the ESP32, ESP32-P4, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6 and ESP32-H2
1+
# Arduino core for the ESP32, ESP32-C3, ESP32-C6, ESP32-H2, ESP32-P4, ESP32-S2 and ESP32-S3.
22

33
[![Build Status](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/push.yml?branch=master&event=push&label=Compilation%20Tests)](https://github.com/espressif/arduino-esp32/actions/workflows/push.yml?query=branch%3Amaster+event%3Apush)
44
[![Verbose Build Status](https://img.shields.io/github/actions/workflow/status/espressif/arduino-esp32/push.yml?branch=master&event=schedule&label=Compilation%20Tests%20(Verbose))](https://github.com/espressif/arduino-esp32/actions/workflows/push.yml?query=branch%3Amaster+event%3Aschedule)
@@ -67,16 +67,17 @@ Here are the ESP32 series supported by the Arduino-ESP32 project:
6767
| **SoC** | **Stable** | **Development** | **Datasheet** |
6868
|----------|:----------:|:---------------:|:-------------------------------------------------------------------------------------------------:|
6969
| ESP32 | Yes | Yes | [ESP32](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf) |
70-
| ESP32-S2 | Yes | Yes | [ESP32-S2](https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf) |
7170
| ESP32-C3 | Yes | Yes | [ESP32-C3](https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf) |
72-
| ESP32-S3 | Yes | Yes | [ESP32-S3](https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf) |
7371
| ESP32-C6 | Yes | Yes | [ESP32-C6](https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf) |
7472
| ESP32-H2 | Yes | Yes | [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) |
7573
| ESP32-P4 | Yes | Yes | [ESP32-P4](https://www.espressif.com/sites/default/files/documentation/esp32-p4_datasheet_en.pdf) |
74+
| ESP32-S2 | Yes | Yes | [ESP32-S2](https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf) |
75+
| ESP32-S3 | Yes | Yes | [ESP32-S3](https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf) |
7676

7777
> [!NOTE]
78-
> ESP32-C2 is also supported by Arduino-ESP32 but requires rebuilding the static libraries. This is not trivial and requires a good understanding of the ESP-IDF
79-
> build system. For more information, see the [Lib Builder documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/lib_builder.html).
78+
> ESP32-C2 is also supported by Arduino-ESP32 but requires using Arduino as an ESP-IDF component or rebuilding the static libraries.
79+
> For more information, see the [Arduino as an ESP-IDF component documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/esp-idf_component.html) or the
80+
> [Lib Builder documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/lib_builder.html), respectively.
8081
8182
For more details visit the [supported chips](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html#supported-soc-s) documentation page.
8283

‎cores/esp32/esp32-hal-uart.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -597,17 +597,11 @@ uart_t *uartBegin(
597597
uartEnd(uart_nr);
598598
} else {
599599
bool retCode = true;
600-
UART_MUTEX_LOCK();
601600
//User may just want to change some parameters, such as baudrate, data length, parity, stop bits or pins
602601
if (uart->_baudrate != baudrate) {
603-
if (ESP_OK != uart_set_baudrate(uart_nr, baudrate)) {
604-
log_e("UART%d changing baudrate failed.", uart_nr);
605-
retCode = false;
606-
} else {
607-
log_v("UART%d changed baudrate to %d", uart_nr, baudrate);
608-
uart->_baudrate = baudrate;
609-
}
602+
retCode = uartSetBaudRate(uart, baudrate);
610603
}
604+
UART_MUTEX_LOCK();
611605
uart_word_length_t data_bits = (config & 0xc) >> 2;
612606
uart_parity_t parity = config & 0x3;
613607
uart_stop_bits_t stop_bits = (config & 0x30) >> 4;
@@ -984,10 +978,11 @@ void uartFlushTxOnly(uart_t *uart, bool txOnly) {
984978
UART_MUTEX_UNLOCK();
985979
}
986980

987-
void uartSetBaudRate(uart_t *uart, uint32_t baud_rate) {
981+
bool uartSetBaudRate(uart_t *uart, uint32_t baud_rate) {
988982
if (uart == NULL) {
989-
return;
983+
return false;
990984
}
985+
bool retCode = true;
991986
UART_MUTEX_LOCK();
992987
#if SOC_UART_SUPPORT_XTAL_CLK // ESP32-S3, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-H2 and ESP32-P4
993988
soc_module_clk_t newClkSrc = UART_SCLK_XTAL;
@@ -1005,12 +1000,14 @@ void uartSetBaudRate(uart_t *uart, uint32_t baud_rate) {
10051000
uart_ll_set_sclk(UART_LL_GET_HW(uart->num), newClkSrc);
10061001
#endif
10071002
if (uart_set_baudrate(uart->num, baud_rate) == ESP_OK) {
1008-
log_v("Setting UART%d baud rate to %d.", uart->num, baud_rate);
1003+
log_v("Setting UART%d baud rate to %ld.", uart->num, baud_rate);
10091004
uart->_baudrate = baud_rate;
10101005
} else {
1011-
log_e("Setting UART%d baud rate to %d has failed.", uart->num, baud_rate);
1006+
retCode = false;
1007+
log_e("Setting UART%d baud rate to %ld has failed.", uart->num, baud_rate);
10121008
}
10131009
UART_MUTEX_UNLOCK();
1010+
return retCode;
10141011
}
10151012

10161013
uint32_t uartGetBaudRate(uart_t *uart) {

‎cores/esp32/esp32-hal-uart.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void uartWriteBuf(uart_t *uart, const uint8_t *data, size_t len);
5858
void uartFlush(uart_t *uart);
5959
void uartFlushTxOnly(uart_t *uart, bool txOnly);
6060

61-
void uartSetBaudRate(uart_t *uart, uint32_t baud_rate);
61+
bool uartSetBaudRate(uart_t *uart, uint32_t baud_rate);
6262
uint32_t uartGetBaudRate(uart_t *uart);
6363

6464
void uartSetRxInvert(uart_t *uart, bool invert);

‎docs/en/boards/boards.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ The ESP32 is divided by family:
1818

1919
* ESP32
2020
* Wi-Fi, BT and BLE 4
21-
* ESP32-S2
22-
* Wi-Fi only
23-
* ESP32-S3
24-
* Wi-Fi and BLE 5
2521
* ESP32-C3
2622
* Wi-Fi and BLE 5
2723
* ESP32-C6
2824
* Wi-Fi, BLE 5 and IEEE 802.15.4
2925
* ESP32-H2
3026
* BLE 5 and IEEE 802.15.4
27+
* ESP32-P4
28+
* 400 MHz Dual Core RISC-V CPU, 40 MHz ULP Co-processor, single-precision FPU and AI extensions.
29+
* ESP32-S2
30+
* Wi-Fi only
31+
* ESP32-S3
32+
* Wi-Fi and BLE 5
3133

3234
For each family, we have SoC variants with some differentiation. The differences are more about the embedded flash and its size and the number of the cores (dual or single).
3335

‎docs/en/common/datasheet.inc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@ Datasheet
22
---------
33

44
* `ESP32`_ (Datasheet)
5-
* `ESP32-S2`_ (Datasheet)
5+
* `ESP32-C2`_ (Datasheet)
66
* `ESP32-C3`_ (Datasheet)
7-
* `ESP32-S3`_ (Datasheet)
87
* `ESP32-C6`_ (Datasheet)
98
* `ESP32-H2`_ (Datasheet)
9+
* `ESP32-P4`_ (Datasheet)
10+
* `ESP32-S2`_ (Datasheet)
11+
* `ESP32-S3`_ (Datasheet)
1012

1113
.. _Espressif Product Selector: https://products.espressif.com/
1214
.. _ESP32: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
13-
.. _ESP32-S2: https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf
15+
.. _ESP32-C2: https://www.espressif.com/sites/default/files/documentation/esp8684_datasheet_en.pdf
1416
.. _ESP32-C3: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf
15-
.. _ESP32-S3: https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf
1617
.. _ESP32-C6: https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf
1718
.. _ESP32-H2: https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf
19+
.. _ESP32-P4: https://www.espressif.com/sites/default/files/documentation/esp32-p4_datasheet_en.pdf
20+
.. _ESP32-S2: https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf
21+
.. _ESP32-S3: https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf

‎docs/en/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ ESP32-C3 target, you would run:
318318
319319
./.github/scripts/tests_build.sh -s uart -t esp32c3
320320
321-
You should see the output of the build process and the test binary should be generated in the ``~/.arduino/tests/<test_name>/build.tmp`` folder.
321+
You should see the output of the build process and the test binary should be generated in the ``~/.arduino/tests/<target_chip>/<test_name>/build.tmp`` folder.
322322

323323
Now that the test is built, you can run it in the target board. Connect the target board to your computer and run:
324324

@@ -339,7 +339,7 @@ The test will run on the target board and you should see the output of the test
339339
lucassvaz@Lucas--MacBook-Pro esp32 % ./.github/scripts/tests_run.sh -s uart -t esp32c3
340340
Sketch uart test type: validation
341341
Running test: uart -- Config: Default
342-
pytest tests --build-dir /Users/lucassvaz/.arduino/tests/uart/build.tmp -k test_uart --junit-xml=/Users/lucassvaz/Espressif/Arduino/hardware/espressif/esp32/tests/validation/uart/esp32c3/uart.xml --embedded-services esp,arduino
342+
pytest tests --build-dir /Users/lucassvaz/.arduino/tests/esp32c3/uart/build.tmp -k test_uart --junit-xml=/Users/lucassvaz/Espressif/Arduino/hardware/espressif/esp32/tests/validation/uart/esp32c3/uart.xml --embedded-services esp,arduino
343343
=============================================================================================== test session starts ================================================================================================
344344
platform darwin -- Python 3.12.3, pytest-8.2.2, pluggy-1.5.0
345345
rootdir: /Users/lucassvaz/Espressif/Arduino/hardware/espressif/esp32/tests

‎docs/en/getting_started.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,18 @@ Here are the ESP32 series supported by the Arduino-ESP32 project:
3838
SoC Stable Development Datasheet
3939
========== ====== =========== =================================
4040
ESP32 Yes Yes `ESP32`_
41-
ESP32-S2 Yes Yes `ESP32-S2`_
4241
ESP32-C3 Yes Yes `ESP32-C3`_
43-
ESP32-S3 Yes Yes `ESP32-S3`_
4442
ESP32-C6 Yes Yes `ESP32-C6`_
4543
ESP32-H2 Yes Yes `ESP32-H2`_
44+
ESP32-P4 Yes Yes `ESP32-P4`_
45+
ESP32-S2 Yes Yes `ESP32-S2`_
46+
ESP32-S3 Yes Yes `ESP32-S3`_
4647
========== ====== =========== =================================
4748

4849
.. note::
49-
ESP32-C2 is also supported by Arduino-ESP32 but requires rebuilding the static libraries.
50-
This is not trivial and requires a good understanding of the ESP-IDF build system.
51-
For more information, see the `Lib Builder documentation <lib_builder.html>`_.
50+
ESP32-C2 is also supported by Arduino-ESP32 but requires using Arduino as an ESP-IDF component or rebuilding the static libraries.
51+
For more information, see the `Arduino as an ESP-IDF component documentation <esp-idf_component.html>`_ or the
52+
`Lib Builder documentation <lib_builder.html>`_, respectively.
5253

5354
See `Boards <boards/boards.html>`_ for more details about ESP32 development boards.
5455

‎docs/en/lib_builder.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ Set the build target(chip). ex. 'esp32s3'
151151
This build command will build for the ESP32-S3 target. You can specify other targets.
152152

153153
* esp32
154-
* esp32s2
155-
* esp32s3
156154
* esp32c2
157155
* esp32c3
158156
* esp32c6
159157
* esp32h2
160158
* esp32p4
159+
* esp32s2
160+
* esp32s3
161161

162162
Set Build Type
163163
^^^^^^^^^^^^^^

‎docs/en/libraries.rst

Lines changed: 57 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,68 @@ Supported Peripherals
99

1010
Currently, the Arduino ESP32 supports the following peripherals with Arduino APIs.
1111

12-
+---------------+-------+-------+-------+-------+-------+-------+-------+
13-
| Peripheral | ESP32 | S2 | C3 | S3 | C6 | H2 | Notes |
14-
+===============+=======+=======+=======+=======+=======+=======+=======+
15-
| ADC | Yes | Yes | Yes | Yes | Yes | Yes | |
16-
+---------------+-------+-------+-------+-------+-------+-------+-------+
17-
| BT Classic | Yes | N/A | N/A | N/A | N/A | N/A | |
18-
+---------------+-------+-------+-------+-------+-------+-------+-------+
19-
| BLE | Yes | N/A | Yes | Yes | Yes | Yes | |
20-
+---------------+-------+-------+-------+-------+-------+-------+-------+
21-
| DAC | Yes | Yes | N/A | N/A | N/A | N/A | |
22-
+---------------+-------+-------+-------+-------+-------+-------+-------+
23-
| Ethernet | Yes | N/A | N/A | N/A | N/A | N/A | (*) |
24-
+---------------+-------+-------+-------+-------+-------+-------+-------+
25-
| GPIO | Yes | Yes | Yes | Yes | Yes | Yes | |
26-
+---------------+-------+-------+-------+-------+-------+-------+-------+
27-
| Hall Sensor | N/A | N/A | N/A | N/A | N/A | N/A | |
28-
+---------------+-------+-------+-------+-------+-------+-------+-------+
29-
| I2C | Yes | Yes | Yes | Yes | Yes | Yes | |
30-
+---------------+-------+-------+-------+-------+-------+-------+-------+
31-
| I2S | Yes | Yes | Yes | Yes | Yes | Yes | |
32-
+---------------+-------+-------+-------+-------+-------+-------+-------+
33-
| LEDC | Yes | Yes | Yes | Yes | Yes | Yes | |
34-
+---------------+-------+-------+-------+-------+-------+-------+-------+
35-
| Motor PWM | No | N/A | N/A | N/A | N/A | N/A | |
36-
+---------------+-------+-------+-------+-------+-------+-------+-------+
37-
| Pulse Counter | No | No | No | No | No | No | |
38-
+---------------+-------+-------+-------+-------+-------+-------+-------+
39-
| RMT | Yes | Yes | Yes | Yes | Yes | Yes | |
40-
+---------------+-------+-------+-------+-------+-------+-------+-------+
41-
| SDIO | No | No | No | No | No | No | |
42-
+---------------+-------+-------+-------+-------+-------+-------+-------+
43-
| SDMMC | Yes | N/A | N/A | Yes | N/A | N/A | |
44-
+---------------+-------+-------+-------+-------+-------+-------+-------+
45-
| Timer | Yes | Yes | Yes | Yes | Yes | Yes | |
46-
+---------------+-------+-------+-------+-------+-------+-------+-------+
47-
| Temp. Sensor | N/A | Yes | Yes | Yes | Yes | Yes | |
48-
+---------------+-------+-------+-------+-------+-------+-------+-------+
49-
| Touch | Yes | Yes | N/A | Yes | N/A | N/A | |
50-
+---------------+-------+-------+-------+-------+-------+-------+-------+
51-
| TWAI | No | No | No | No | No | No | |
52-
+---------------+-------+-------+-------+-------+-------+-------+-------+
53-
| UART | Yes | Yes | Yes | Yes | Yes | Yes | |
54-
+---------------+-------+-------+-------+-------+-------+-------+-------+
55-
| USB | N/A | Yes | Yes | Yes | Yes | Yes | (**) |
56-
+---------------+-------+-------+-------+-------+-------+-------+-------+
57-
| Wi-Fi | Yes | Yes | Yes | Yes | Yes | N/A | |
58-
+---------------+-------+-------+-------+-------+-------+-------+-------+
12+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
13+
| Peripheral | ESP32 | C3 | C6 | H2 | P4 | S2 | S3 | Notes |
14+
+===============+=======+=======+=======+=======+=======+=======+=======+=======+
15+
| ADC | Yes | Yes | Yes | Yes | Yes | Yes | Yes | (1) |
16+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
17+
| BT Classic | Yes | N/A | N/A | N/A | N/A | N/A | N/A | |
18+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
19+
| BLE | Yes | Yes | Yes | Yes | No | N/A | Yes | |
20+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
21+
| DAC | Yes | N/A | N/A | N/A | Yes | Yes | N/A | |
22+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
23+
| Ethernet | Yes | N/A | N/A | N/A | Yes | N/A | N/A | (2) |
24+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
25+
| GPIO | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
26+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
27+
| Hall Sensor | N/A | N/A | N/A | N/A | N/A | N/A | N/A | |
28+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
29+
| I2C | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
30+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
31+
| I2S | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
32+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
33+
| LEDC | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
34+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
35+
| MIPI | N/A | N/A | N/A | N/A | No | N/A | N/A | |
36+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
37+
| Motor PWM | No | N/A | N/A | N/A | N/A | N/A | N/A | |
38+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
39+
| MSPI | N/A | N/A | N/A | N/A | No | N/A | N/A | |
40+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
41+
| Pulse Counter | No | No | No | No | No | No | No | |
42+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
43+
| RMT | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
44+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
45+
| SDIO | No | No | No | No | No | No | No | |
46+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
47+
| SDMMC | Yes | N/A | N/A | N/A | N/A | N/A | Yes | |
48+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
49+
| Timer | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
50+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
51+
| Temp. Sensor | N/A | Yes | Yes | Yes | Yes | Yes | Yes | |
52+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
53+
| Touch | Yes | N/A | N/A | N/A | Yes | Yes | Yes | |
54+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
55+
| TWAI | No | No | No | No | No | No | No | |
56+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
57+
| UART | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
58+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
59+
| USB | N/A | Yes | Yes | Yes | Yes | Yes | Yes | (3) |
60+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
61+
| Wi-Fi | Yes | Yes | Yes | N/A | Yes | Yes | Yes | (4) |
62+
+---------------+-------+-------+-------+-------+-------+-------+-------+-------+
5963

6064
Notes
6165
^^^^^
6266

63-
(*) SPI Ethernet is supported by all ESP32 families and RMII only for ESP32.
67+
(1) ESP32-P4 calibration schemes not supported yet in IDF and ADC Continuous also lacks IDF support.
6468

65-
(**) ESP32-C3, C6, H2 only support USB CDC/JTAG
69+
(2) SPI Ethernet is supported by all ESP32 families and RMII only for ESP32 and ESP32-P4.
70+
71+
(3) ESP32-C3, C6, H2 only support USB CDC/JTAG
72+
73+
(4) ESP32-P4 only supports Wi-Fi through another SoC by using ``esp_hosted``.
6674

6775
.. note:: Some peripherals are not available for all ESP32 families. To see more details about it, see the corresponding SoC at `Product Selector <https://products.espressif.com>`_ page.
6876

‎package/package_esp32_index.template.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,22 @@
2626
"name": "ESP32 Dev Board"
2727
},
2828
{
29-
"name": "ESP32-S2 Dev Board"
29+
"name": "ESP32-C3 Dev Board"
3030
},
3131
{
32-
"name": "ESP32-S3 Dev Board"
32+
"name": "ESP32-C6 Dev Board"
3333
},
3434
{
35-
"name": "ESP32-C3 Dev Board"
35+
"name": "ESP32-H2 Dev Board"
36+
},
37+
{
38+
"name": "ESP32-P4 Dev Board"
39+
},
40+
{
41+
"name": "ESP32-S2 Dev Board"
42+
},
43+
{
44+
"name": "ESP32-S3 Dev Board"
3645
},
3746
{
3847
"name": "Arduino Nano ESP32"

‎tests/validation/i2c_master/i2c_master.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void rtc_run_clock() {
162162
ds1307_get_time(&read_sec, &read_min, &read_hour, &read_day, &read_month, &read_year);
163163

164164
//Check time
165-
TEST_ASSERT_UINT8_WITHIN(2, start_sec + 5, read_sec);
165+
TEST_ASSERT_NOT_EQUAL(start_sec, read_sec); //Seconds should have changed
166166
TEST_ASSERT_EQUAL(start_min, read_min);
167167
TEST_ASSERT_EQUAL(start_hour, read_hour);
168168
TEST_ASSERT_EQUAL(start_day, read_day);

‎tests/validation/uart/diagram.esp32.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"type": "board-esp32-devkit-c-v4",
88
"id": "esp",
9-
"attrs": { "cpuFrequency": "40" }
9+
"attrs": { "cpuFrequency": "120" }
1010
}
1111
],
1212
"connections": [

‎tests/validation/uart/uart.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public:
5353
: uart_num(num), serial(serial_ref), peeked_char(-1), default_rx_pin(rx_pin), default_tx_pin(tx_pin), recv_msg("") {}
5454

5555
void begin(unsigned long baudrate) {
56+
// pinMode will force enabling the internal pullup resistor (IDF 5.3.2 Change)
57+
pinMode(default_rx_pin, INPUT_PULLUP);
5658
serial.begin(baudrate, SERIAL_8N1, default_rx_pin, default_tx_pin);
5759
while (!serial) {
5860
delay(10);
@@ -365,6 +367,8 @@ void change_pins_test(void) {
365367

366368
if (TEST_UART_NUM == 1) {
367369
UARTTestConfig &config = *uart_test_configs[0];
370+
// pinMode will force enabling the internal pullup resistor (IDF 5.3.2 Change)
371+
pinMode(NEW_RX1, INPUT_PULLUP);
368372
config.serial.setPins(NEW_RX1, NEW_TX1);
369373
TEST_ASSERT_EQUAL(NEW_RX1, uart_get_RxPin(config.uart_num));
370374
TEST_ASSERT_EQUAL(NEW_TX1, uart_get_TxPin(config.uart_num));

0 commit comments

Comments
 (0)
Please sign in to comment.