Skip to content

Commit 58e2ad0

Browse files
authored
Merge branch 'master' into patch-1
2 parents e8c30be + 6f7a1ca commit 58e2ad0

File tree

9,417 files changed

+8052
-2097920
lines changed

Some content is hidden

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

9,417 files changed

+8052
-2097920
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v2.0.14
4445
- v2.0.13
4546
- v2.0.12
4647
- v2.0.11

.github/pytools/Sign-File.ps1

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
[CmdletBinding()]
2+
param (
3+
[Parameter()]
4+
[String]
5+
$Path
6+
)
7+
8+
9+
function FindSignTool {
10+
$SignTool = "signtool.exe"
11+
if (Get-Command $SignTool -ErrorAction SilentlyContinue) {
12+
return $SignTool
13+
}
14+
$SignTool = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\x64\signtool.exe"
15+
if (Test-Path -Path $SignTool -PathType Leaf) {
16+
return $SignTool
17+
}
18+
$SignTool = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\x86\signtool.exe"
19+
if (Test-Path -Path $SignTool -PathType Leaf) {
20+
return $SignTool
21+
}
22+
$sdkVers = "10.0.22000.0", "10.0.20348.0", "10.0.19041.0", "10.0.17763.0"
23+
Foreach ($ver in $sdkVers)
24+
{
25+
$SignTool = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\${ver}\x64\signtool.exe"
26+
if (Test-Path -Path $SignTool -PathType Leaf) {
27+
return $SignTool
28+
}
29+
}
30+
"signtool.exe not found"
31+
Exit 1
32+
}
33+
34+
function SignEsptool {
35+
param(
36+
[Parameter()]
37+
[String]
38+
$Path
39+
)
40+
41+
$SignTool = FindSignTool
42+
"Using: $SignTool"
43+
$CertificateFile = [system.io.path]::GetTempPath() + "certificate.pfx"
44+
45+
if ($null -eq $env:CERTIFICATE) {
46+
"CERTIFICATE variable not set, unable to sign the file"
47+
Exit 1
48+
}
49+
50+
if ("" -eq $env:CERTIFICATE) {
51+
"CERTIFICATE variable is empty, unable to sign the file"
52+
Exit 1
53+
}
54+
55+
$SignParameters = @("sign", "/tr", 'http://timestamp.digicert.com', "/td", "SHA256", "/f", $CertificateFile, "/fd", "SHA256")
56+
if ($env:CERTIFICATE_PASSWORD) {
57+
"CERTIFICATE_PASSWORD detected, using the password"
58+
$SignParameters += "/p"
59+
$SignParameters += $env:CERTIFICATE_PASSWORD
60+
}
61+
$SignParameters += $Path
62+
63+
[byte[]]$CertificateBytes = [convert]::FromBase64String($env:CERTIFICATE)
64+
[IO.File]::WriteAllBytes($CertificateFile, $CertificateBytes)
65+
66+
&$SignTool $SignParameters
67+
68+
if (0 -eq $LASTEXITCODE) {
69+
Remove-Item $CertificateFile
70+
} else {
71+
Remove-Item $CertificateFile
72+
"Signing failed"
73+
Exit 1
74+
}
75+
76+
}
77+
78+
SignEsptool ${Path}

.github/pytools/espressif.ico

115 KB
Binary file not shown.

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
export PLATFORMIO_ESP32_PATH="$HOME/.platformio/packages/framework-arduinoespressif32"
44
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git"
55

6-
TOOLCHAIN_VERSION="8.4.0+2021r2-patch5"
7-
ESPTOOLPY_VERSION="~1.40400.0"
6+
TOOLCHAIN_VERSION="12.2.0+20230208"
7+
ESPTOOLPY_VERSION="~1.40501.0"
88
ESPRESSIF_ORGANIZATION_NAME="espressif"
99

1010
echo "Installing Python Wheel ..."
@@ -30,9 +30,15 @@ replace_script+="data['packages']['toolchain-riscv32-esp']['owner']='$ESPRESSIF_
3030
# Update versions to use the upstream
3131
replace_script+="data['packages']['toolchain-xtensa-esp32']['version']='$TOOLCHAIN_VERSION';"
3232
replace_script+="data['packages']['toolchain-xtensa-esp32s2']['version']='$TOOLCHAIN_VERSION';"
33+
replace_script+="data['packages']['toolchain-xtensa-esp32s3']['version']='$TOOLCHAIN_VERSION';"
3334
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'}});"
35+
# Add new "framework-arduinoespressif32-libs" package
36+
# Read "package_esp32_index.template.json" to extract a url to a zip package for "esp32-arduino-libs"
37+
replace_script+="fpackage=open(os.path.join('package', 'package_esp32_index.template.json'), 'r+');"
38+
replace_script+="package_data=json.load(fpackage);"
39+
replace_script+="fpackage.close();"
40+
replace_script+="libs_package_archive_url=next(next(system['url'] for system in tool['systems'] if system['host'] == 'x86_64-pc-linux-gnu') for tool in package_data['packages'][0]['tools'] if tool['name'] == 'esp32-arduino-libs');"
41+
replace_script+="data['packages'].update({'framework-arduinoespressif32-libs':{'type':'framework','optional':False,'version':libs_package_archive_url}});"
3642
replace_script+="data['packages']['toolchain-xtensa-esp32'].update({'optional':False});"
3743
# esptool.py may require an upstream version (for now platformio is the owner)
3844
replace_script+="data['packages']['tool-esptoolpy']['version']='$ESPTOOLPY_VERSION';"

.github/scripts/on-push.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ if [ "$BUILD_PIO" -eq 0 ]; then
6868
FQBN_ESP32S2="espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=huge_app"
6969
FQBN_ESP32S3="espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=huge_app"
7070
FQBN_ESP32C3="espressif:esp32:esp32c3:PartitionScheme=huge_app"
71+
FQBN_ESP32C6="espressif:esp32:esp32c6:PartitionScheme=huge_app"
72+
FQBN_ESP32H2="espressif:esp32:esp32h2:PartitionScheme=huge_app"
7173

7274
SKETCHES_ESP32="\
7375
$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino\
@@ -85,6 +87,8 @@ if [ "$BUILD_PIO" -eq 0 ]; then
8587
build "esp32s3" $FQBN_ESP32S3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
8688
build "esp32s2" $FQBN_ESP32S2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
8789
build "esp32c3" $FQBN_ESP32C3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
90+
build "esp32c6" $FQBN_ESP32C6 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
91+
build "esp32h2" $FQBN_ESP32H2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
8892
build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
8993
else
9094
source ${SCRIPTS_DIR}/install-platformio-esp32.sh

.github/scripts/on-release.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ cp -f "$GITHUB_WORKSPACE/tools/gen_insights_package.py" "$PKG_DIR/tools/"
185185
cp -f "$GITHUB_WORKSPACE/tools/gen_insights_package.exe" "$PKG_DIR/tools/"
186186
cp -Rf "$GITHUB_WORKSPACE/tools/partitions" "$PKG_DIR/tools/"
187187
cp -Rf "$GITHUB_WORKSPACE/tools/ide-debug" "$PKG_DIR/tools/"
188-
cp -Rf "$GITHUB_WORKSPACE/tools/sdk" "$PKG_DIR/tools/"
189188
cp -f $GITHUB_WORKSPACE/tools/platformio-build*.py "$PKG_DIR/tools/"
190189

191190
# Remove unnecessary files in the package folder
@@ -197,10 +196,13 @@ find "$PKG_DIR" -name '*.git*' -type f -delete
197196
echo "Generating platform.txt..."
198197
cat "$GITHUB_WORKSPACE/platform.txt" | \
199198
sed "s/version=.*/version=$ver$extent/g" | \
199+
sed 's/tools.esp32-arduino-libs.path={runtime.platform.path}\/tools\/esp32-arduino-libs/tools.esp32-arduino-libs.path=\{runtime.tools.esp32-arduino-libs.path\}/g' | \
200200
sed 's/tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf/tools.xtensa-esp32-elf-gcc.path=\{runtime.tools.xtensa-esp32-elf-gcc.path\}/g' | \
201201
sed 's/tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s2-elf/tools.xtensa-esp32s2-elf-gcc.path=\{runtime.tools.xtensa-esp32s2-elf-gcc.path\}/g' | \
202202
sed 's/tools.xtensa-esp32s3-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s3-elf/tools.xtensa-esp32s3-elf-gcc.path=\{runtime.tools.xtensa-esp32s3-elf-gcc.path\}/g' | \
203+
sed 's/tools.xtensa-esp-elf-gdb.path={runtime.platform.path}\/tools\/xtensa-esp-elf-gdb/tools.xtensa-esp-elf-gdb.path=\{runtime.tools.xtensa-esp-elf-gdb.path\}/g' | \
203204
sed 's/tools.riscv32-esp-elf-gcc.path={runtime.platform.path}\/tools\/riscv32-esp-elf/tools.riscv32-esp-elf-gcc.path=\{runtime.tools.riscv32-esp-elf-gcc.path\}/g' | \
205+
sed 's/tools.riscv32-esp-elf-gdb.path={runtime.platform.path}\/tools\/riscv32-esp-elf-gdb/tools.riscv32-esp-elf-gdb.path=\{runtime.tools.riscv32-esp-elf-gdb.path\}/g' | \
204206
sed 's/tools.esptool_py.path={runtime.platform.path}\/tools\/esptool/tools.esptool_py.path=\{runtime.tools.esptool_py.path\}/g' | \
205207
sed 's/debug.server.openocd.path={runtime.platform.path}\/tools\/openocd-esp32\/bin\/openocd/debug.server.openocd.path=\{runtime.tools.openocd-esp32.path\}\/bin\/openocd/g' | \
206208
sed 's/debug.server.openocd.scripts_dir={runtime.platform.path}\/tools\/openocd-esp32\/share\/openocd\/scripts\//debug.server.openocd.scripts_dir=\{runtime.tools.openocd-esp32.path\}\/share\/openocd\/scripts\//g' | \

.github/scripts/sketch_utils.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
7474
esp32s2_opts="PSRAM=enabled,PartitionScheme=huge_app"
7575
esp32s3_opts="PSRAM=opi,USBMode=default,PartitionScheme=huge_app"
7676
esp32c3_opts="PartitionScheme=huge_app"
77+
esp32c6_opts="PartitionScheme=huge_app"
78+
esp32h2_opts="PartitionScheme=huge_app"
7779

7880
# Select the common part of the FQBN based on the target. The rest will be
7981
# appended depending on the passed options.
@@ -91,6 +93,12 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
9193
"esp32s3")
9294
fqbn="espressif:esp32:esp32s3:${options:-$esp32s3_opts}"
9395
;;
96+
"esp32c6")
97+
fqbn="espressif:esp32:esp32c6:${options:-$esp32c6_opts}"
98+
;;
99+
"esp32h2")
100+
fqbn="espressif:esp32:esp32h2:${options:-$esp32h2_opts}"
101+
;;
94102
esac
95103

96104
# Make it look like a JSON array.

.github/scripts/upload_py_tools.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
CHANGED_FILES=$1
3+
echo "Pushing '$CHANGED_FILES' as $GITHUB_ACTOR"
4+
git config --global github.user "$GITHUB_ACTOR"
5+
git config --global user.name "$GITHUB_ACTOR"
6+
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
7+
for tool in $CHANGED_FILES; do
8+
git add tools/$tool.exe
9+
done
10+
git commit -m "Push binary to tools"
11+
git push

.github/workflows/build_py_tools.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Build Python Tools
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'tools/get.py'
7+
- 'tools/espota.py'
8+
- 'tools/gen_esp32part.py'
9+
- 'tools/gen_insights_package.py'
10+
11+
jobs:
12+
find-changed-tools:
13+
name: Check if tools have been changed
14+
runs-on: ubuntu-20.04
15+
outputs:
16+
any_changed: ${{ steps.verify-changed-files.outputs.any_changed }}
17+
all_changed_files: ${{ steps.verify-changed-files.outputs.all_changed_files }}
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 2
23+
ref: ${{ github.event.pull_request.head.ref }}
24+
- name: Verify Python Tools Changed
25+
uses: tj-actions/changed-files@v36
26+
id: verify-changed-files
27+
with:
28+
fetch_depth: '2'
29+
since_last_remote_commit: 'true'
30+
files: |
31+
tools/get.py
32+
tools/espota.py
33+
tools/gen_esp32part.py
34+
tools/gen_insights_package.py
35+
- name: List all changed files
36+
shell: bash
37+
run: |
38+
for file in ${{ steps.verify-changed-files.outputs.all_changed_files }}; do
39+
echo "$file was changed"
40+
done
41+
42+
build-pytools-binaries:
43+
name: Build python tools binaries for ${{ matrix.os }}
44+
runs-on: ${{ matrix.os }}
45+
needs: find-changed-tools
46+
if: needs.find-changed-tools.outputs.any_changed == 'true'
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
os: [windows-latest, macos-latest, ubuntu-20.04, ARM, ARM64]
51+
include:
52+
- os: windows-latest
53+
TARGET: win64
54+
EXTEN: .exe
55+
SEPARATOR: ';'
56+
- os: macos-latest
57+
TARGET: macos
58+
SEPARATOR: ':'
59+
- os: ubuntu-20.04
60+
TARGET: linux-amd64
61+
SEPARATOR: ':'
62+
- os: ARM
63+
CONTAINER: python:3.8-bullseye
64+
TARGET: arm
65+
SEPARATOR: ':'
66+
- os: ARM64
67+
CONTAINER: python:3.8-bullseye
68+
TARGET: arm64
69+
SEPARATOR: ':'
70+
container: ${{ matrix.CONTAINER }} # use python container on ARM
71+
env:
72+
DISTPATH: pytools-${{ matrix.TARGET }}
73+
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi"
74+
steps:
75+
- name: List changed tools
76+
shell: bash
77+
run: |
78+
CHANGED_FILES=()
79+
for file in ${{ needs.find-changed-tools.outputs.all_changed_files }}; do
80+
file="${file#*\/}"
81+
file="${file%\.*}"
82+
CHANGED_FILES+=("$file")
83+
done
84+
CHANGED_FILES="${CHANGED_FILES[@]}"
85+
echo "CHANGED_TOOLS=$CHANGED_FILES" >> "$GITHUB_ENV"
86+
for tool in ${{ env.CHANGED_TOOLS }}; do
87+
echo "tool $tool was changed"
88+
done
89+
- name: Checkout repository
90+
uses: actions/checkout@v3
91+
with:
92+
ref: ${{ github.event.pull_request.head.ref }}
93+
- name: Set up Python 3.8
94+
# Skip setting python on ARM because of missing compatibility: https://github.com/actions/setup-python/issues/108
95+
if: matrix.os != 'ARM' && matrix.os != 'ARM64'
96+
uses: actions/setup-python@master
97+
with:
98+
python-version: 3.8
99+
- name: Install dependencies
100+
run: |
101+
python -m pip install --upgrade pip
102+
pip install pyinstaller requests
103+
- name: Build with PyInstaller
104+
shell: bash
105+
run: |
106+
for tool in ${{ env.CHANGED_TOOLS }}; do
107+
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=.github/pytools/espressif.ico tools/$tool.py
108+
done
109+
- name: Sign binaries
110+
if: matrix.os == 'windows-latest'
111+
env:
112+
CERTIFICATE: ${{ secrets.CERTIFICATE }}
113+
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
114+
shell: pwsh
115+
run: |
116+
$data = Write-Output ${{ env.CHANGED_TOOLS }}
117+
foreach ( $node in $data )
118+
{
119+
./.github/pytools/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/$node.exe
120+
}
121+
- name: Test binaries
122+
shell: bash
123+
run: |
124+
for tool in ${{ env.CHANGED_TOOLS }}; do
125+
./${{ env.DISTPATH }}/$tool${{ matrix.EXTEN }} -h
126+
done
127+
- name: Push binary to tools
128+
if: matrix.os == 'windows-latest'
129+
env:
130+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
131+
shell: bash
132+
run: |
133+
for tool in ${{ env.CHANGED_TOOLS }}; do
134+
cp -f ./${{ env.DISTPATH }}/$tool.exe tools/$tool.exe
135+
done
136+
bash .github/scripts/upload_py_tools.sh "${{ env.CHANGED_TOOLS }}"
137+
- name: Archive artifact
138+
uses: actions/upload-artifact@master
139+
with:
140+
name: ${{ env.DISTPATH }}
141+
path: ${{ env.DISTPATH }}

.github/workflows/hil.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
strategy:
4949
matrix:
50-
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3']
50+
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2']
5151
chunks: ${{fromJson(needs.gen_chunks.outputs.chunks)}}
5252
steps:
5353
- name: Checkout Repository
@@ -66,17 +66,12 @@ jobs:
6666
Test:
6767
needs: [gen_chunks, Build]
6868
name: ${{matrix.chip}}-Test#${{matrix.chunks}}
69-
runs-on:
70-
- ESP32
71-
- ESP32-S2
72-
- ESP32-S3
73-
- ESP32-C3
74-
7569
strategy:
7670
fail-fast: false
7771
matrix:
78-
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3']
72+
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2']
7973
chunks: ${{fromJson(needs.gen_chunks.outputs.chunks)}}
74+
runs-on: [arduino, "${{matrix.chip}}"]
8075
container:
8176
image: python:3.10.1-bullseye
8277
options: --privileged
@@ -94,7 +89,7 @@ jobs:
9489
- name: Install dependencies
9590
run: |
9691
pip install -U pip
97-
pip install -r tests/requirements.txt
92+
pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
9893
apt update && apt install -y -qq jq
9994
10095
- name: Run Tests

.github/workflows/lib.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
- esp32s2
3737
- esp32c3
3838
- esp32s3
39+
- esp32c6
40+
- esp32h2
3941

4042
include:
4143
- target: esp32
@@ -46,6 +48,10 @@ jobs:
4648
fqbn: espressif:esp32:esp32c3
4749
- target: esp32s3
4850
fqbn: espressif:esp32:esp32s3
51+
- target: esp32c6
52+
fqbn: espressif:esp32:esp32c6
53+
- target: esp32h2
54+
fqbn: espressif:esp32:esp32h2
4955

5056

5157
steps:

0 commit comments

Comments
 (0)