Skip to content

Commit 5077029

Browse files
authored
Merge branch 'espressif:master' into master
2 parents 28b3e1f + 40a39a3 commit 5077029

File tree

389 files changed

+10470
-5066
lines changed

Some content is hidden

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

389 files changed

+10470
-5066
lines changed

.github/scripts/on-release.sh

+84-103
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ RELEASE_PRE=`echo $EVENT_JSON | jq -r '.release.prerelease'`
2323
RELEASE_TAG=`echo $EVENT_JSON | jq -r '.release.tag_name'`
2424
RELEASE_BRANCH=`echo $EVENT_JSON | jq -r '.release.target_commitish'`
2525
RELEASE_ID=`echo $EVENT_JSON | jq -r '.release.id'`
26-
RELEASE_BODY=`echo $EVENT_JSON | jq -r '.release.body'`
2726

2827
OUTPUT_DIR="$GITHUB_WORKSPACE/build"
2928
PACKAGE_NAME="esp32-$RELEASE_TAG"
@@ -185,23 +184,29 @@ cp -f "$GITHUB_WORKSPACE/tools/gen_insights_package.py" "$PKG_DIR/tools/"
185184
cp -f "$GITHUB_WORKSPACE/tools/gen_insights_package.exe" "$PKG_DIR/tools/"
186185
cp -Rf "$GITHUB_WORKSPACE/tools/partitions" "$PKG_DIR/tools/"
187186
cp -Rf "$GITHUB_WORKSPACE/tools/ide-debug" "$PKG_DIR/tools/"
188-
cp -f $GITHUB_WORKSPACE/tools/platformio-build*.py "$PKG_DIR/tools/"
187+
cp -f "$GITHUB_WORKSPACE/tools/platformio-build.py" "$PKG_DIR/tools/"
189188

190189
# Remove unnecessary files in the package folder
191190
echo "Cleaning up folders ..."
192191
find "$PKG_DIR" -name '*.DS_Store' -exec rm -f {} \;
193192
find "$PKG_DIR" -name '*.git*' -type f -delete
194193

194+
##
195+
## TEMP WORKAROUND FOR RV32 LONG PATH ON WINDOWS
196+
##
197+
RVTC_NAME="riscv32-esp-elf-gcc"
198+
RVTC_NEW_NAME="esp-rv32"
199+
195200
# Replace tools locations in platform.txt
196201
echo "Generating platform.txt..."
197202
cat "$GITHUB_WORKSPACE/platform.txt" | \
198-
sed "s/version=.*/version=$ver$extent/g" | \
203+
sed "s/version=.*/version=$RELEASE_TAG/g" | \
199204
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' | \
200205
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' | \
201206
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' | \
202207
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' | \
203208
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' | \
204-
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' | \
209+
sed "s/tools.riscv32-esp-elf-gcc.path={runtime.platform.path}\\/tools\\/riscv32-esp-elf/tools.riscv32-esp-elf-gcc.path=\\{runtime.tools.$RVTC_NEW_NAME.path\\}/g" | \
205210
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' | \
206211
sed 's/tools.esptool_py.path={runtime.platform.path}\/tools\/esptool/tools.esptool_py.path=\{runtime.tools.esptool_py.path\}/g' | \
207212
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' | \
@@ -241,6 +246,81 @@ echo "Package Uploaded"
241246
echo "Download URL: $PACKAGE_URL"
242247
echo
243248

249+
##
250+
## LIBS PACKAGE ZIP
251+
##
252+
253+
LIBS_PROJ_NAME="esp32-arduino-libs"
254+
LIBS_PKG_DIR="$OUTPUT_DIR/$LIBS_PROJ_NAME"
255+
LIBS_PACKAGE_ZIP="$LIBS_PROJ_NAME-$RELEASE_TAG.zip"
256+
257+
# Get the libs package URL from the template
258+
LIBS_PACKAGE_SRC_ZIP="$OUTPUT_DIR/src-$LIBS_PROJ_NAME.zip"
259+
LIBS_PACKAGE_SRC_URL=`cat $PACKAGE_JSON_TEMPLATE | jq -r ".packages[0].tools[] | select(.name==\"$LIBS_PROJ_NAME\") | .systems[0].url"`
260+
261+
# Download the libs package
262+
echo "Downloading the libs archive ..."
263+
curl -o "$LIBS_PACKAGE_SRC_ZIP" -LJO --url "$LIBS_PACKAGE_SRC_URL" || exit 1
264+
265+
# Extract the libs package
266+
echo "Extracting the archive ..."
267+
unzip -q -d "$OUTPUT_DIR" "$LIBS_PACKAGE_SRC_ZIP" || exit 1
268+
EXTRACTED_DIR=`ls "$OUTPUT_DIR" | grep "^$LIBS_PROJ_NAME"`
269+
mv "$OUTPUT_DIR/$EXTRACTED_DIR" "$LIBS_PKG_DIR" || exit 1
270+
271+
# Remove unnecessary files in the package folder
272+
echo "Cleaning up folders ..."
273+
find "$LIBS_PKG_DIR" -name '*.DS_Store' -exec rm -f {} \;
274+
find "$LIBS_PKG_DIR" -name '*.git*' -type f -delete
275+
276+
# Compress package folder
277+
echo "Creating ZIP ..."
278+
pushd "$OUTPUT_DIR" >/dev/null
279+
zip -qr "$LIBS_PACKAGE_ZIP" "$LIBS_PROJ_NAME"
280+
if [ $? -ne 0 ]; then echo "ERROR: Failed to create $LIBS_PACKAGE_ZIP ($?)"; exit 1; fi
281+
282+
# Calculate SHA-256
283+
echo "Calculating SHA sum ..."
284+
LIBS_PACKAGE_PATH="$OUTPUT_DIR/$LIBS_PACKAGE_ZIP"
285+
LIBS_PACKAGE_SHA=`shasum -a 256 "$LIBS_PACKAGE_ZIP" | cut -f 1 -d ' '`
286+
LIBS_PACKAGE_SIZE=`get_file_size "$LIBS_PACKAGE_ZIP"`
287+
popd >/dev/null
288+
rm -rf "$LIBS_PKG_DIR"
289+
echo "'$LIBS_PACKAGE_ZIP' Created! Size: $LIBS_PACKAGE_SIZE, SHA-256: $LIBS_PACKAGE_SHA"
290+
echo
291+
292+
# Upload package to release page
293+
echo "Uploading libs package to release page ..."
294+
LIBS_PACKAGE_URL=`git_safe_upload_asset "$LIBS_PACKAGE_PATH"`
295+
echo "Libs Package Uploaded"
296+
echo "Libs Download URL: $LIBS_PACKAGE_URL"
297+
echo
298+
299+
# Construct JQ argument with libs package data
300+
libs_jq_arg="\
301+
(.packages[0].tools[] | select(.name==\"$LIBS_PROJ_NAME\")).systems[].url = \"$LIBS_PACKAGE_URL\" |\
302+
(.packages[0].tools[] | select(.name==\"$LIBS_PROJ_NAME\")).systems[].archiveFileName = \"$LIBS_PACKAGE_ZIP\" |\
303+
(.packages[0].tools[] | select(.name==\"$LIBS_PROJ_NAME\")).systems[].size = \"$LIBS_PACKAGE_SIZE\" |\
304+
(.packages[0].tools[] | select(.name==\"$LIBS_PROJ_NAME\")).systems[].checksum = \"SHA-256:$LIBS_PACKAGE_SHA\""
305+
306+
# Update template values for the libs package and store it in the build folder
307+
cat "$PACKAGE_JSON_TEMPLATE" | jq "$libs_jq_arg" > "$OUTPUT_DIR/package-$LIBS_PROJ_NAME.json"
308+
# Overwrite the template location with the newly edited one
309+
PACKAGE_JSON_TEMPLATE="$OUTPUT_DIR/package-$LIBS_PROJ_NAME.json"
310+
311+
##
312+
## TEMP WORKAROUND FOR RV32 LONG PATH ON WINDOWS
313+
##
314+
RVTC_VERSION=`cat $PACKAGE_JSON_TEMPLATE | jq -r ".packages[0].platforms[0].toolsDependencies[] | select(.name == \"$RVTC_NAME\") | .version" | cut -d '_' -f 2`
315+
RVTC_VERSION=`date -j -f '%Y%m%d' "$RVTC_VERSION" '+%y%m'`
316+
rvtc_jq_arg="\
317+
(.packages[0].platforms[0].toolsDependencies[] | select(.name==\"$RVTC_NAME\")).version = \"$RVTC_VERSION\" |\
318+
(.packages[0].platforms[0].toolsDependencies[] | select(.name==\"$RVTC_NAME\")).name = \"$RVTC_NEW_NAME\" |\
319+
(.packages[0].tools[] | select(.name==\"$RVTC_NAME\")).version = \"$RVTC_VERSION\" |\
320+
(.packages[0].tools[] | select(.name==\"$RVTC_NAME\")).name = \"$RVTC_NEW_NAME\""
321+
cat "$PACKAGE_JSON_TEMPLATE" | jq "$rvtc_jq_arg" > "$OUTPUT_DIR/package-$LIBS_PROJ_NAME-rvfix.json"
322+
PACKAGE_JSON_TEMPLATE="$OUTPUT_DIR/package-$LIBS_PROJ_NAME-rvfix.json"
323+
244324
##
245325
## PACKAGE JSON
246326
##
@@ -268,21 +348,13 @@ if [ $? -ne 0 ]; then echo "ERROR: Get Releases Failed! ($?)"; exit 1; fi
268348
set +e
269349
prev_release=$(echo "$releasesJson" | jq -e -r ". | map(select(.draft == false and .prerelease == false)) | sort_by(.published_at | - fromdateiso8601) | .[0].tag_name")
270350
prev_any_release=$(echo "$releasesJson" | jq -e -r ". | map(select(.draft == false)) | sort_by(.published_at | - fromdateiso8601) | .[0].tag_name")
271-
prev_branch_release=$(echo "$releasesJson" | jq -e -r ". | map(select(.draft == false and .prerelease == false and .target_commitish == \"$RELEASE_BRANCH\")) | sort_by(.published_at | - fromdateiso8601) | .[0].tag_name")
272-
prev_branch_any_release=$(echo "$releasesJson" | jq -e -r ". | map(select(.draft == false and .target_commitish == \"$RELEASE_BRANCH\")) | sort_by(.published_at | - fromdateiso8601) | .[0].tag_name")
273351
shopt -s nocasematch
274352
if [ "$prev_release" == "$RELEASE_TAG" ]; then
275353
prev_release=$(echo "$releasesJson" | jq -e -r ". | map(select(.draft == false and .prerelease == false)) | sort_by(.published_at | - fromdateiso8601) | .[1].tag_name")
276354
fi
277355
if [ "$prev_any_release" == "$RELEASE_TAG" ]; then
278356
prev_any_release=$(echo "$releasesJson" | jq -e -r ". | map(select(.draft == false)) | sort_by(.published_at | - fromdateiso8601) | .[1].tag_name")
279357
fi
280-
if [ "$prev_branch_release" == "$RELEASE_TAG" ]; then
281-
prev_branch_release=$(echo "$releasesJson" | jq -e -r ". | map(select(.draft == false and .prerelease == false and .target_commitish == \"$RELEASE_BRANCH\")) | sort_by(.published_at | - fromdateiso8601) | .[1].tag_name")
282-
fi
283-
if [ "$prev_branch_any_release" == "$RELEASE_TAG" ]; then
284-
prev_branch_any_release=$(echo "$releasesJson" | jq -e -r ". | map(select(.draft == false and .target_commitish == \"$RELEASE_BRANCH\")) | sort_by(.published_at | - fromdateiso8601) | .[1].tag_name")
285-
fi
286358
shopt -u nocasematch
287359
set -e
288360

@@ -315,97 +387,6 @@ if [ "$RELEASE_PRE" == "false" ]; then
315387
echo
316388
fi
317389

318-
##
319-
## RELEASE NOTES
320-
##
321-
322-
# Create release notes
323-
echo "Preparing release notes ..."
324-
releaseNotes=""
325-
326-
# Process annotated tags
327-
relNotesRaw=`git -C "$GITHUB_WORKSPACE" show -s --format=%b $RELEASE_TAG`
328-
readarray -t msgArray <<<"$relNotesRaw"
329-
arrLen=${#msgArray[@]}
330-
if [ $arrLen > 3 ] && [ "${msgArray[0]:0:3}" == "tag" ]; then
331-
ind=3
332-
while [ $ind -lt $arrLen ]; do
333-
if [ $ind -eq 3 ]; then
334-
releaseNotes="#### ${msgArray[ind]}"
335-
releaseNotes+=$'\r\n'
336-
else
337-
oneLine="$(echo -e "${msgArray[ind]}" | sed -e 's/^[[:space:]]*//')"
338-
if [ ${#oneLine} -gt 0 ]; then
339-
if [ "${oneLine:0:2}" == "* " ]; then oneLine=$(echo ${oneLine/\*/-}); fi
340-
if [ "${oneLine:0:2}" != "- " ]; then releaseNotes+="- "; fi
341-
releaseNotes+="$oneLine"
342-
releaseNotes+=$'\r\n'
343-
fi
344-
fi
345-
let ind=$ind+1
346-
done
347-
fi
348-
349-
# Append Commit Messages
350-
echo
351-
echo "Previous Branch Release: $prev_branch_release"
352-
echo "Previous Branch (any)release: $prev_branch_any_release"
353-
echo
354-
commitFile="$OUTPUT_DIR/commits.txt"
355-
COMMITS_SINCE_RELEASE="$prev_branch_any_release"
356-
if [ "$RELEASE_PRE" == "false" ]; then
357-
COMMITS_SINCE_RELEASE="$prev_branch_release"
358-
fi
359-
if [ ! -z "$COMMITS_SINCE_RELEASE" ] && [ "$COMMITS_SINCE_RELEASE" != "null" ]; then
360-
echo "Getting commits since $COMMITS_SINCE_RELEASE ..."
361-
git -C "$GITHUB_WORKSPACE" log --oneline -n 500 "$COMMITS_SINCE_RELEASE..HEAD" > "$commitFile"
362-
elif [ "$RELEASE_BRANCH" != "master" ]; then
363-
echo "Getting all commits on branch '$RELEASE_BRANCH' ..."
364-
git -C "$GITHUB_WORKSPACE" log --oneline -n 500 --cherry-pick --left-only --no-merges HEAD...origin/master > "$commitFile"
365-
else
366-
echo "Getting all commits on master ..."
367-
git -C "$GITHUB_WORKSPACE" log --oneline -n 500 --no-merges > "$commitFile"
368-
fi
369-
releaseNotes+=$'\r\n##### Commits\r\n'
370-
IFS=$'\n'
371-
for next in `cat $commitFile`
372-
do
373-
IFS=' ' read -r commitId commitMsg <<< "$next"
374-
commitLine="- [$commitId](https://github.com/$GITHUB_REPOSITORY/commit/$commitId) $commitMsg"
375-
releaseNotes+="$commitLine"
376-
releaseNotes+=$'\r\n'
377-
done
378-
rm -f $commitFile
379-
380-
# Prepend the original release body
381-
if [ "${RELEASE_BODY: -1}" == $'\r' ]; then
382-
RELEASE_BODY="${RELEASE_BODY:0:-1}"
383-
else
384-
RELEASE_BODY="$RELEASE_BODY"
385-
fi
386-
RELEASE_BODY+=$'\r\n'
387-
releaseNotes="$RELEASE_BODY$releaseNotes"
388-
389-
# Update release page
390-
echo "Updating release notes ..."
391-
releaseNotes=$(printf '%s' "$releaseNotes" | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))')
392-
releaseNotes=${releaseNotes:1:-1}
393-
curlData="{\"body\": \"$releaseNotes\"}"
394-
releaseData=`curl --data "$curlData" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID?access_token=$GITHUB_TOKEN" 2>/dev/null`
395-
if [ $? -ne 0 ]; then echo "ERROR: Updating Release Failed: $?"; exit 1; fi
396-
echo "Release notes successfully updated"
397-
echo
398-
399-
##
400-
## SUBMODULE VERSIONS
401-
##
402-
403-
# Upload submodules versions
404-
echo "Generating submodules.txt ..."
405-
git -C "$GITHUB_WORKSPACE" submodule status > "$OUTPUT_DIR/submodules.txt"
406-
echo "Uploading submodules.txt ..."
407-
echo "Download URL: "`git_safe_upload_asset "$OUTPUT_DIR/submodules.txt"`
408-
echo ""
409390
set +e
410391

411392
##

.github/workflows/push.yml

+27-27
Original file line numberDiff line numberDiff line change
@@ -82,30 +82,30 @@ jobs:
8282
- name: Build Sketches
8383
run: bash ./.github/scripts/on-push.sh 1 1 #equal and non-zero to trigger PIO
8484

85-
# build-esp-idf-component:
86-
# name: Build with ESP-IDF ${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
87-
# runs-on: ubuntu-20.04
88-
# strategy:
89-
# matrix:
90-
# # The version names here correspond to the versions of espressif/idf Docker image.
91-
# # See https://hub.docker.com/r/espressif/idf/tags and
92-
# # https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html
93-
# # for details.
94-
# idf_ver: ["release-v4.4"]
95-
# idf_target: ["esp32", "esp32s2", "esp32s3", "esp32c3"]
96-
# container: espressif/idf:${{ matrix.idf_ver }}
97-
# steps:
98-
# - name: Check out arduino-esp32 as a component
99-
# uses: actions/checkout@v3
100-
# with:
101-
# submodules: recursive
102-
# path: components/arduino-esp32
103-
# - name: Build
104-
# env:
105-
# IDF_TARGET: ${{ matrix.idf_target }}
106-
# shell: bash
107-
# run: |
108-
# . ${IDF_PATH}/export.sh
109-
# idf.py create-project test
110-
# echo CONFIG_FREERTOS_HZ=1000 > test/sdkconfig.defaults
111-
# idf.py -C test -DEXTRA_COMPONENT_DIRS=$PWD/components build
85+
build-esp-idf-component:
86+
name: Build with ESP-IDF ${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
87+
runs-on: ubuntu-20.04
88+
strategy:
89+
matrix:
90+
# The version names here correspond to the versions of espressif/idf Docker image.
91+
# See https://hub.docker.com/r/espressif/idf/tags and
92+
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html
93+
# for details.
94+
idf_ver: ["release-v5.1"]
95+
idf_target: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c6", "esp32h2"]
96+
container: espressif/idf:${{ matrix.idf_ver }}
97+
steps:
98+
- name: Check out arduino-esp32 as a component
99+
uses: actions/checkout@v3
100+
with:
101+
submodules: recursive
102+
path: components/arduino-esp32
103+
- name: Build
104+
env:
105+
IDF_TARGET: ${{ matrix.idf_target }}
106+
shell: bash
107+
run: |
108+
. ${IDF_PATH}/export.sh
109+
idf.py create-project test
110+
echo CONFIG_FREERTOS_HZ=1000 > test/sdkconfig.defaults
111+
idf.py -C test -DEXTRA_COMPONENT_DIRS=$PWD/components build

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ set(includedirs
209209

210210
set(srcs ${CORE_SRCS} ${LIBRARY_SRCS} ${BLE_SRCS})
211211
set(priv_includes cores/esp32/libb64)
212-
set(requires spi_flash mbedtls mdns wifi_provisioning wpa_supplicant esp_adc esp_eth http_parser)
212+
set(requires spi_flash mbedtls wifi_provisioning wpa_supplicant esp_adc esp_eth http_parser)
213213
set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support bt esp_hid)
214214

215215
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Arduino core for the ESP32, ESP32-S2, ESP32-S3 and ESP32-C3
1+
# Arduino core for the ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6 and ESP32-H2
22

33
![Build Status](https://github.com/espressif/arduino-esp32/workflows/ESP32%20Arduino%20CI/badge.svg) [![Documentation Status](https://readthedocs.com/projects/espressif-arduino-esp32/badge/?version=latest)](https://docs.espressif.com/projects/arduino-esp32/en/latest/?badge=latest)
44
[![External Libraries Test](https://github.com/espressif/arduino-esp32/actions/workflows/lib.yml/badge.svg?branch=master&event=schedule)](https://github.com/espressif/arduino-esp32/actions/workflows/lib.yml?link=http://https://github.com/espressif/arduino-esp32/blob/master/LIBRARIES_TEST.md)

0 commit comments

Comments
 (0)