Skip to content

Commit 46bf03c

Browse files
authored
Merge branch 'master' into issue-5826-fix
2 parents cec0701 + d8a99ed commit 46bf03c

File tree

3,847 files changed

+690483
-19908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,847 files changed

+690483
-19908
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ body:
3939
label: Version
4040
description: What version of Arduino ESP32 are you running? If possible, consider updating to the latest version.
4141
options:
42-
- latest master
42+
- latest master (checkout manually)
43+
- latest development Release Candidate (RC-X)
4344
- v2.0.2
4445
- v2.0.1
4546
- v2.0.0
@@ -52,7 +53,7 @@ body:
5253
attributes:
5354
label: IDE Name
5455
description: What IDE are you using?
55-
placeholder: eg. Arduino IDE, PlatformIO, IDF component...
56+
placeholder: eg. Arduino IDE, PlatformIO, Sloeber...
5657
validations:
5758
required: true
5859
- type: input
@@ -101,8 +102,8 @@ body:
101102
id: sketch
102103
attributes:
103104
label: Sketch
104-
description: Please provide your sketch/code which was run
105-
placeholder: ex. related part of the code
105+
description: Please provide full minimal sketch/code which can be run to reproduce your issue
106+
placeholder: ex. Related part of the code to replicate the issue
106107
render: cpp
107108
validations:
108109
required: true

.github/PULL_REQUEST_TEMPLATE.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
*By completing this PR sufficiently, you help us to improve the quality of Release Notes*
1+
*By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes*
22

33
### Checklist
4-
1. [ ] Please provide specific title of the PR describing the change, including the component name (eg. *„Update of Documentation link on Readme.md“*)
5-
2. [ ] Please provide related links (eg. Issue, other Project, submodule PR..)
6-
3. [ ] Please check [Contributing guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html)
4+
1. [ ] Please provide specific title of the PR describing the change, including the component name (*eg. „Update of Documentation link on Readme.md“*)
5+
2. [ ] Please provide related links (*eg. Issue which will be closed by this Pull Request*)
6+
3. [ ] Please **update relevant Documentation** if applicable
7+
4. [ ] Please check [Contributing guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html)
78

89
*This entire section above can be deleted if all items are checked.*
910

1011
-----------
11-
## Summary
12-
Please describe your proposed PR and what it contains.
12+
## Description of Change
13+
Please describe your proposed Pull Request and it's impact.
1314

14-
## Impact
15-
Please describe impact of your PR and it's function.
15+
## Tests scenarios
16+
Please describe on what Hardware and Software combinations you have tested this Pull Request and how.
17+
18+
(*eg. I have tested my Pull Request on Arduino-esp32 core v2.0.2 with ESP32 and ESP32-S2 Board with this scenario*)
1619

1720
## Related links
1821
Please provide links to related issue, PRs etc.
22+
23+
(*eg. Closes #number of issue*)

.github/scripts/install-platformio-esp32.sh

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/bin/bash
22

33
export PLATFORMIO_ESP32_PATH="$HOME/.platformio/packages/framework-arduinoespressif32"
4-
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git#feature/arduino-idf-master"
4+
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git"
55

6-
XTENSA32_TOOLCHAIN_VERSION="8.4.0+2021r2-patch2"
7-
XTENSA32S2_TOOLCHAIN_VERSION="8.4.0+2021r2-patch2"
8-
RISCV_TOOLCHAIN_VERSION="8.4.0+2021r2-patch2"
6+
TOOLCHAIN_VERSION="8.4.0+2021r2-patch3"
97
ESPTOOLPY_VERSION="~1.30100.0"
108
ESPRESSIF_ORGANIZATION_NAME="espressif"
119

@@ -30,9 +28,12 @@ replace_script+="data['packages']['toolchain-xtensa-esp32']['owner']='$ESPRESSIF
3028
replace_script+="data['packages']['toolchain-xtensa-esp32s2']['owner']='$ESPRESSIF_ORGANIZATION_NAME';"
3129
replace_script+="data['packages']['toolchain-riscv32-esp']['owner']='$ESPRESSIF_ORGANIZATION_NAME';"
3230
# Update versions to use the upstream
33-
replace_script+="data['packages']['toolchain-xtensa-esp32']['version']='$XTENSA32_TOOLCHAIN_VERSION';"
34-
replace_script+="data['packages']['toolchain-xtensa-esp32s2']['version']='$XTENSA32S2_TOOLCHAIN_VERSION';"
35-
replace_script+="data['packages']['toolchain-riscv32-esp']['version']='$RISCV_TOOLCHAIN_VERSION';"
31+
replace_script+="data['packages']['toolchain-xtensa-esp32']['version']='$TOOLCHAIN_VERSION';"
32+
replace_script+="data['packages']['toolchain-xtensa-esp32s2']['version']='$TOOLCHAIN_VERSION';"
33+
replace_script+="data['packages']['toolchain-riscv32-esp']['version']='$TOOLCHAIN_VERSION';"
34+
# Add ESP32-S3 Toolchain
35+
replace_script+="data['packages'].update({'toolchain-xtensa-esp32s3':{'type':'toolchain','optional':True,'owner':'$ESPRESSIF_ORGANIZATION_NAME','version':'$TOOLCHAIN_VERSION'}});"
36+
replace_script+="data['packages']['toolchain-xtensa-esp32'].update({'optional':False});"
3637
# esptool.py may require an upstream version (for now platformio is the owner)
3738
replace_script+="data['packages']['tool-esptoolpy']['version']='$ESPTOOLPY_VERSION';"
3839
# Save results

.github/scripts/on-push.sh

+21-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44

5+
export ARDUINO_BUILD_DIR="$HOME/.arduino/build.tmp"
6+
57
function build(){
68
local target=$1
79
local fqbn=$2
@@ -58,11 +60,12 @@ fi
5860

5961
SCRIPTS_DIR="./.github/scripts"
6062
if [ "$BUILD_PIO" -eq 0 ]; then
61-
source ./.github/scripts/install-arduino-ide.sh
63+
source ${SCRIPTS_DIR}/install-arduino-ide.sh
6264
source ${SCRIPTS_DIR}/install-arduino-core-esp32.sh
6365

6466
FQBN_ESP32="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
6567
FQBN_ESP32S2="espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app"
68+
FQBN_ESP32S3="espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app"
6669
FQBN_ESP32C3="espressif:esp32:esp32c3:PartitionScheme=huge_app"
6770

6871
SKETCHES_ESP32="\
@@ -76,11 +79,12 @@ if [ "$BUILD_PIO" -eq 0 ]; then
7679
$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino\
7780
"
7881

79-
build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
82+
build "esp32s3" $FQBN_ESP32S3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
8083
build "esp32s2" $FQBN_ESP32S2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
8184
build "esp32c3" $FQBN_ESP32C3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
85+
build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
8286
else
83-
source ./${SCRIPTS_DIR}/install-platformio-esp32.sh
87+
source ${SCRIPTS_DIR}/install-platformio-esp32.sh
8488
# PlatformIO ESP32 Test
8589
BOARD="esp32dev"
8690
OPTIONS="board_build.partitions = huge_app.csv"
@@ -96,6 +100,20 @@ else
96100
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
97101

98102
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32s2" --project-option="board_build.partitions = huge_app.csv"
103+
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32c3" --project-option="board_build.partitions = huge_app.csv"
104+
105+
echo "Hacking in S3 support ..."
106+
replace_script="import json; import os;"
107+
replace_script+="fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+');"
108+
replace_script+="data=json.load(fp);"
109+
replace_script+="data['packages']['toolchain-xtensa-esp32']['optional']=True;"
110+
replace_script+="data['packages']['toolchain-xtensa-esp32s3']['optional']=False;"
111+
replace_script+="data['packages']['tool-esptoolpy']['owner']='tasmota';"
112+
replace_script+="data['packages']['tool-esptoolpy']['version']='https://github.com/tasmota/esptool/releases/download/v3.3/esptool-3.3.zip';"
113+
replace_script+="fp.seek(0);fp.truncate();json.dump(data, fp, indent=2);fp.close()"
114+
python -c "$replace_script"
115+
116+
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32s3" --project-option="board_build.partitions = huge_app.csv"
99117

100118
#build_pio_sketches "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries"
101119
fi

.github/scripts/on-release.sh

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ mkdir -p "$PKG_DIR/tools"
172172
# Copy all core files to the package folder
173173
echo "Copying files for packaging ..."
174174
cp -f "$GITHUB_WORKSPACE/boards.txt" "$PKG_DIR/"
175+
cp -f "$GITHUB_WORKSPACE/package.json" "$PKG_DIR/"
175176
cp -f "$GITHUB_WORKSPACE/programmers.txt" "$PKG_DIR/"
176177
cp -Rf "$GITHUB_WORKSPACE/cores" "$PKG_DIR/"
177178
cp -Rf "$GITHUB_WORKSPACE/libraries" "$PKG_DIR/"

.github/scripts/sketch_utils.sh

+15-7
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <fqbn> <path-to-i
77
return 1
88
fi
99

10-
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
1110
local ide_path=$1
1211
local usr_path=$2
1312
local fqbn=$3
1413
local sketch=$4
1514
local xtra_opts=$5
1615
local win_opts=$6
1716

18-
build_dir="$(dirname $sketch)/build"
17+
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
18+
if [ -z "$ARDUINO_BUILD_DIR" ]; then
19+
build_dir="$(dirname $sketch)/build"
20+
else
21+
build_dir="$ARDUINO_BUILD_DIR"
22+
fi
23+
24+
echo $sketch
25+
26+
rm -rf "$build_dir"
1927
mkdir -p "$build_dir"
2028
mkdir -p "$ARDUINO_CACHE_DIR"
2129
$ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
@@ -32,13 +40,13 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <fqbn> <path-to-i
3240
$win_opts $xtra_opts "$sketch"
3341
}
3442

35-
function count_sketches(){ # count_sketches <path> <target>
43+
function count_sketches(){ # count_sketches <path> [target]
3644
local path=$1
3745
local target=$2
3846

39-
if [ $# -lt 2 ]; then
47+
if [ $# -lt 1 ]; then
4048
echo "ERROR: Illegal number of parameters"
41-
echo "USAGE: ${0} count <path> <target>"
49+
echo "USAGE: ${0} count <path> [target]"
4250
fi
4351

4452
rm -rf sketches.txt
@@ -47,15 +55,15 @@ function count_sketches(){ # count_sketches <path> <target>
4755
return 0
4856
fi
4957

50-
local sketches=$(find $path -name *.ino)
58+
local sketches=$(find $path -name *.ino | sort)
5159
local sketchnum=0
5260
for sketch in $sketches; do
5361
local sketchdir=$(dirname $sketch)
5462
local sketchdirname=$(basename $sketchdir)
5563
local sketchname=$(basename $sketch)
5664
if [[ "$sketchdirname.ino" != "$sketchname" ]]; then
5765
continue
58-
elif [[ -f "$sketchdir/.skip.$target" ]]; then
66+
elif [[ -n $target ]] && [[ -f "$sketchdir/.skip.$target" ]]; then
5967
continue
6068
else
6169
echo $sketch >> sketches.txt

.github/scripts/tests_build.sh

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
SCRIPTS_DIR="./.github/scripts"
4+
BUILD_CMD=""
5+
6+
if [ $# -eq 3 ]; then
7+
chunk_build=1
8+
elif [ $# -eq 2 ]; then
9+
chunk_build=0
10+
else
11+
echo "ERROR: Illegal number of parameters"
12+
echo "USAGE:
13+
${0} <target> <sketch_dir>
14+
${0} <target> <chunk> <total_chunks>
15+
"
16+
exit 0
17+
fi
18+
19+
target=$1
20+
21+
case "$target" in
22+
"esp32") fqbn="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
23+
;;
24+
"esp32s2") fqbn="espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app"
25+
;;
26+
"esp32c3") fqbn="espressif:esp32:esp32c3:PartitionScheme=huge_app"
27+
;;
28+
"esp32s3") fqbn="espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app"
29+
;;
30+
esac
31+
32+
if [ -z $fqbn ]; then
33+
echo "Unvalid chip $1"
34+
exit 0
35+
fi
36+
37+
source ${SCRIPTS_DIR}/install-arduino-ide.sh
38+
source ${SCRIPTS_DIR}/install-arduino-core-esp32.sh
39+
40+
args="$ARDUINO_IDE_PATH $ARDUINO_USR_PATH \"$fqbn\""
41+
42+
if [ $chunk_build -eq 1 ]; then
43+
chunk_index=$2
44+
chunk_max=$3
45+
46+
if [ "$chunk_index" -gt "$chunk_max" ] && [ "$chunk_max" -ge 2 ]; then
47+
chunk_index=$chunk_max
48+
fi
49+
BUILD_CMD="${SCRIPTS_DIR}/sketch_utils.sh chunk_build"
50+
args+=" $target $PWD/tests $chunk_index $chunk_max"
51+
else
52+
sketchdir=$2
53+
BUILD_CMD="${SCRIPTS_DIR}/sketch_utils.sh build"
54+
args+=" $PWD/tests/$sketchdir/$sketchdir.ino"
55+
fi
56+
57+
${BUILD_CMD} ${args}
58+

.github/scripts/tests_run.sh

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/bash
2+
3+
target=$1
4+
chunk_idex=$2
5+
chunks_num=$3
6+
7+
SCRIPTS_DIR="./.github/scripts"
8+
COUNT_SKETCHES="${SCRIPTS_DIR}/sketch_utils.sh count"
9+
10+
source ${SCRIPTS_DIR}/install-arduino-ide.sh
11+
12+
if [ "$chunks_num" -le 0 ]; then
13+
echo "ERROR: Chunks count must be positive number"
14+
return 1
15+
fi
16+
if [ "$chunk_idex" -ge "$chunks_num" ] && [ "$chunks_num" -ge 2 ]; then
17+
echo "ERROR: Chunk index must be less than chunks count"
18+
return 1
19+
fi
20+
21+
set +e
22+
${COUNT_SKETCHES} $PWD/tests $target
23+
sketchcount=$?
24+
set -e
25+
sketches=$(cat sketches.txt)
26+
rm -rf sketches.txt
27+
28+
chunk_size=$(( $sketchcount / $chunks_num ))
29+
all_chunks=$(( $chunks_num * $chunk_size ))
30+
if [ "$all_chunks" -lt "$sketchcount" ]; then
31+
chunk_size=$(( $chunk_size + 1 ))
32+
fi
33+
34+
start_index=0
35+
end_index=0
36+
if [ "$chunk_idex" -ge "$chunks_num" ]; then
37+
start_index=$chunk_idex
38+
end_index=$sketchcount
39+
else
40+
start_index=$(( $chunk_idex * $chunk_size ))
41+
if [ "$sketchcount" -le "$start_index" ]; then
42+
echo "Skipping job"
43+
return 0
44+
fi
45+
46+
end_index=$(( $(( $chunk_idex + 1 )) * $chunk_size ))
47+
if [ "$end_index" -gt "$sketchcount" ]; then
48+
end_index=$sketchcount
49+
fi
50+
fi
51+
52+
start_num=$(( $start_index + 1 ))
53+
sketchnum=0
54+
55+
for sketch in $sketches; do
56+
sketchdir=$(dirname $sketch)
57+
sketchdirname=$(basename $sketchdir)
58+
sketchname=$(basename $sketch)
59+
sketchnum=$(($sketchnum + 1))
60+
if [ "$sketchnum" -le "$start_index" ] \
61+
|| [ "$sketchnum" -gt "$end_index" ]; then
62+
continue
63+
fi
64+
echo ""
65+
echo "Test for Sketch Index $(($sketchnum - 1)) - $sketchdirname"
66+
pytest tests -k test_$sketchdirname --junit-xml=tests/$sketchdirname/$sketchdirname.xml
67+
result=$?
68+
if [ $result -ne 0 ]; then
69+
return $result
70+
fi
71+
done

.github/scripts/update-version.sh

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# For reference: add tools for all boards by replacing one line in each board
4+
# "[board].upload.tool=esptool_py" to "[board].upload.tool=esptool_py\n[board].upload.tool.default=esptool_py\n[board].upload.tool.network=esp_ota"
5+
#cat boards.txt | sed "s/\([a-zA-Z0-9_\-]*\)\.upload\.tool\=esptool_py/\1\.upload\.tool\=esptool_py\\n\1\.upload\.tool\.default\=esptool_py\\n\1\.upload\.tool\.network\=esp_ota/"
6+
7+
if [ ! $# -eq 3 ]; then
8+
echo "Bad number of arguments: $#" >&2
9+
echo "usage: $0 <major> <minor> <patch>" >&2
10+
exit 1
11+
fi
12+
13+
re='^[0-9]+$'
14+
if [[ ! $1 =~ $re ]] || [[ ! $2 =~ $re ]] || [[ ! $3 =~ $re ]] ; then
15+
echo "error: Not a valid version: $1.$2.$3" >&2
16+
echo "usage: $0 <major> <minor> <patch>" >&2
17+
exit 1
18+
fi
19+
20+
ESP_ARDUINO_VERSION_MAJOR="$1"
21+
ESP_ARDUINO_VERSION_MINOR="$2"
22+
ESP_ARDUINO_VERSION_PATCH="$3"
23+
ESP_ARDUINO_VERSION="$ESP_ARDUINO_VERSION_MAJOR.$ESP_ARDUINO_VERSION_MINOR.$ESP_ARDUINO_VERSION_PATCH"
24+
25+
echo "New Arduino Version: $ESP_ARDUINO_VERSION"
26+
27+
echo "Updating platform.txt..."
28+
cat platform.txt | sed "s/version=.*/version=$ESP_ARDUINO_VERSION/g" > __platform.txt && mv __platform.txt platform.txt
29+
30+
echo "Updating package.json..."
31+
cat package.json | sed "s/.*\"version\":.*/ \"version\": \"$ESP_ARDUINO_VERSION\",/g" > __package.json && mv __package.json package.json
32+
33+
echo "Updating cores/esp32/esp_arduino_version.h..."
34+
cat cores/esp32/esp_arduino_version.h | \
35+
sed "s/#define ESP_ARDUINO_VERSION_MAJOR.*/#define ESP_ARDUINO_VERSION_MAJOR $ESP_ARDUINO_VERSION_MAJOR/g" | \
36+
sed "s/#define ESP_ARDUINO_VERSION_MINOR.*/#define ESP_ARDUINO_VERSION_MINOR $ESP_ARDUINO_VERSION_MINOR/g" | \
37+
sed "s/#define ESP_ARDUINO_VERSION_PATCH.*/#define ESP_ARDUINO_VERSION_PATCH $ESP_ARDUINO_VERSION_PATCH/g" > __esp_arduino_version.h && mv __esp_arduino_version.h cores/esp32/esp_arduino_version.h
38+
39+
exit 0

0 commit comments

Comments
 (0)