Skip to content

Commit 874219b

Browse files
authored
Merge branch 'master' into uart_onreceive_example_improvement
2 parents 47a9de3 + 8d121e0 commit 874219b

File tree

21 files changed

+187
-271
lines changed

21 files changed

+187
-271
lines changed

.github/scripts/on-push-idf.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
CHECK_REQUIREMENTS="./components/arduino-esp32/.github/scripts/sketch_utils.sh check_requirements"
6+
7+
# Export IDF environment
8+
. ${IDF_PATH}/export.sh
9+
10+
# Find all examples in ./components/arduino-esp32/idf_component_examples
11+
idf_component_examples=$(find ./components/arduino-esp32/idf_component_examples -mindepth 1 -maxdepth 1 -type d)
12+
13+
for example in $idf_component_examples; do
14+
if [ -f "$example"/ci.json ]; then
15+
# If the target is listed as false, skip the sketch. Otherwise, include it.
16+
is_target=$(jq -r --arg target "$IDF_TARGET" '.targets[$target]' "$example"/ci.json)
17+
if [[ "$is_target" == "false" ]]; then
18+
printf "\n\033[93mSkipping %s for target %s\033[0m\n\n" "$example" "$IDF_TARGET"
19+
continue
20+
fi
21+
fi
22+
23+
idf.py -C "$example" set-target "$IDF_TARGET"
24+
25+
has_requirements=$(${CHECK_REQUIREMENTS} "$example" "$example/sdkconfig")
26+
if [ "$has_requirements" -eq 0 ]; then
27+
printf "\n\033[93m%s does not meet the requirements for %s. Skipping...\033[0m\n\n" "$example" "$IDF_TARGET"
28+
continue
29+
fi
30+
31+
printf "\n\033[95mBuilding %s\033[0m\n\n" "$example"
32+
idf.py -C "$example" -DEXTRA_COMPONENT_DIRS="$PWD/components" build
33+
done

.github/scripts/on-release.sh

+14
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ PACKAGE_JSON_MERGE="$GITHUB_WORKSPACE/.github/scripts/merge_packages.py"
3535
PACKAGE_JSON_TEMPLATE="$GITHUB_WORKSPACE/package/package_esp32_index.template.json"
3636
PACKAGE_JSON_DEV="package_esp32_dev_index.json"
3737
PACKAGE_JSON_REL="package_esp32_index.json"
38+
PACKAGE_JSON_DEV_CN="package_esp32_dev_index_cn.json"
39+
PACKAGE_JSON_REL_CN="package_esp32_index_cn.json"
3840

3941
echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPACE, Ref: $GITHUB_REF"
4042
echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID"
@@ -339,9 +341,13 @@ jq_arg=".packages[0].platforms[0].version = \"$RELEASE_TAG\" | \
339341
# Generate package JSONs
340342
echo "Generating $PACKAGE_JSON_DEV ..."
341343
cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV"
344+
# On MacOS the sed command won't skip the first match. Use gsed instead.
345+
sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_DEV" > "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
342346
if [ "$RELEASE_PRE" == "false" ]; then
343347
echo "Generating $PACKAGE_JSON_REL ..."
344348
cat "$PACKAGE_JSON_TEMPLATE" | jq "$jq_arg" > "$OUTPUT_DIR/$PACKAGE_JSON_REL"
349+
# On MacOS the sed command won't skip the first match. Use gsed instead.
350+
sed '0,/github\.com\/espressif\//!s|github\.com/espressif/|dl.espressif.cn/github_assets/espressif/|g' "$OUTPUT_DIR/$PACKAGE_JSON_REL" > "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
345351
fi
346352

347353
# Figure out the last release or pre-release
@@ -373,12 +379,14 @@ echo
373379
if [ -n "$prev_any_release" ] && [ "$prev_any_release" != "null" ]; then
374380
echo "Merging with JSON from $prev_any_release ..."
375381
merge_package_json "$prev_any_release/$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV"
382+
merge_package_json "$prev_any_release/$PACKAGE_JSON_DEV_CN" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN"
376383
fi
377384

378385
if [ "$RELEASE_PRE" == "false" ]; then
379386
if [ -n "$prev_release" ] && [ "$prev_release" != "null" ]; then
380387
echo "Merging with JSON from $prev_release ..."
381388
merge_package_json "$prev_release/$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL"
389+
merge_package_json "$prev_release/$PACKAGE_JSON_REL_CN" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN"
382390
fi
383391
fi
384392

@@ -388,6 +396,8 @@ echo "Installing arduino-cli ..."
388396
export PATH="/home/runner/bin:$PATH"
389397
source "${SCRIPTS_DIR}/install-arduino-cli.sh"
390398

399+
# For the Chinese mirror, we can't test the package JSONs as the Chinese mirror might not be updated yet.
400+
391401
echo "Testing $PACKAGE_JSON_DEV install ..."
392402

393403
echo "Installing esp32 ..."
@@ -445,11 +455,15 @@ fi
445455
echo "Uploading $PACKAGE_JSON_DEV ..."
446456
echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV")"
447457
echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV")"
458+
echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
459+
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_DEV" "$OUTPUT_DIR/$PACKAGE_JSON_DEV_CN")"
448460
echo
449461
if [ "$RELEASE_PRE" == "false" ]; then
450462
echo "Uploading $PACKAGE_JSON_REL ..."
451463
echo "Download URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL")"
452464
echo "Pages URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL")"
465+
echo "Download CN URL: $(git_safe_upload_asset "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
466+
echo "Pages CN URL: $(git_safe_upload_to_pages "$PACKAGE_JSON_REL" "$OUTPUT_DIR/$PACKAGE_JSON_REL_CN")"
453467
echo
454468
fi
455469

.github/scripts/sketch_utils.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function check_requirements { # check_requirements <sketchdir> <sdkconfig_path>
1616
local requirements_or
1717

1818
if [ ! -f "$sdkconfig_path" ] || [ ! -f "$sketchdir/ci.json" ]; then
19-
echo "ERROR: sdkconfig or ci.json not found" 1>&2
19+
echo "WARNING: sdkconfig or ci.json not found. Assuming requirements are met." 1>&2
2020
# Return 1 on error to force the sketch to be built and fail. This way the
2121
# CI will fail and the user will know that the sketch has a problem.
2222
else

.github/workflows/push.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ on:
3131
- "!libraries/**.properties"
3232
- "!libraries/**.py"
3333
- "package/**"
34+
- "idf_component_examples/**"
3435
- "tools/**.py"
3536
- "platform.txt"
3637
- "programmers.txt"
@@ -45,7 +46,6 @@ on:
4546
- "!.github/scripts/tests_*"
4647
- "!.github/scripts/upload_*"
4748
- "variants/esp32/**/*"
48-
- "variants/esp32c2/**/*"
4949
- "variants/esp32c3/**/*"
5050
- "variants/esp32c6/**/*"
5151
- "variants/esp32h2/**/*"
@@ -124,7 +124,7 @@ jobs:
124124
- 'idf_component.yml'
125125
- 'Kconfig.projbuild'
126126
- 'CMakeLists.txt'
127-
- "variants/esp32c2/**/*"
127+
- "idf_component_examples/**"
128128
129129
- name: Set chunks
130130
id: set-chunks
@@ -267,15 +267,23 @@ jobs:
267267
submodules: recursive
268268
path: components/arduino-esp32
269269

270+
- name: Setup jq
271+
uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
272+
270273
- name: Build
271274
env:
272275
IDF_TARGET: ${{ matrix.idf_target }}
273276
shell: bash
274277
run: |
275-
. ${IDF_PATH}/export.sh
276-
idf.py create-project test
277-
echo CONFIG_FREERTOS_HZ=1000 > test/sdkconfig.defaults
278-
idf.py -C test -DEXTRA_COMPONENT_DIRS=$PWD/components build
278+
chmod a+x ./components/arduino-esp32/.github/scripts/*
279+
./components/arduino-esp32/.github/scripts/on-push-idf.sh
280+
281+
- name: Upload generated sdkconfig files for debugging
282+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
283+
if: always()
284+
with:
285+
name: sdkconfig-${{ matrix.idf_target }}
286+
path: ./components/arduino-esp32/idf_component_examples/**/sdkconfig
279287

280288
# Save artifacts to gh-pages
281289
save-master-artifacts:

boards.txt

+19-8
Original file line numberDiff line numberDiff line change
@@ -6007,12 +6007,12 @@ twatchs3.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB)
60076007
twatchs3.menu.UploadMode.cdc.upload.use_1200bps_touch=true
60086008
twatchs3.menu.UploadMode.cdc.upload.wait_for_upload_port=true
60096009

6010-
twatchs3.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS)
6011-
twatchs3.menu.PartitionScheme.fatflash.build.partitions=ffat
6012-
twatchs3.menu.PartitionScheme.fatflash.upload.maximum_size=2097152
60136010
twatchs3.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS)
60146011
twatchs3.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB
60156012
twatchs3.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
6013+
twatchs3.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS)
6014+
twatchs3.menu.PartitionScheme.fatflash.build.partitions=ffat
6015+
twatchs3.menu.PartitionScheme.fatflash.upload.maximum_size=2097152
60166016
twatchs3.menu.PartitionScheme.rainmaker=RainMaker
60176017
twatchs3.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
60186018
twatchs3.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080
@@ -6076,6 +6076,10 @@ twatchs3.menu.Revision.Radio_SX1280=Radio-SX1280
60766076
twatchs3.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280
60776077
twatchs3.menu.Revision.Radio_CC1101=Radio-CC1101
60786078
twatchs3.menu.Revision.Radio_CC1101.build.board=LILYGO_LORA_CC1101
6079+
twatchs3.menu.Revision.Radio_LR1121=Radio-LR1121
6080+
twatchs3.menu.Revision.Radio_LR1121.build.board=LILYGO_LORA_LR1121
6081+
twatchs3.menu.Revision.Radio_SI4432=Radio-SI4432
6082+
twatchs3.menu.Revision.Radio_SI4432.build.board=LILYGO_LORA_SI4432
60796083

60806084
##############################################################
60816085

@@ -6231,13 +6235,16 @@ twatch_ultra.menu.EraseFlash.none.upload.erase_cmd=
62316235
twatch_ultra.menu.EraseFlash.all=Enabled
62326236
twatch_ultra.menu.EraseFlash.all.upload.erase_cmd=-e
62336237

6234-
twatch_ultra.menu.Revision.Radio_SX1280=Radio-SX1280
6235-
twatch_ultra.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280
62366238
twatch_ultra.menu.Revision.Radio_SX1262=Radio-SX1262
62376239
twatch_ultra.menu.Revision.Radio_SX1262.build.board=LILYGO_LORA_SX1262
6240+
twatch_ultra.menu.Revision.Radio_SX1280=Radio-SX1280
6241+
twatch_ultra.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280
62386242
twatch_ultra.menu.Revision.Radio_CC1101=Radio-CC1101
62396243
twatch_ultra.menu.Revision.Radio_CC1101.build.board=LILYGO_LORA_CC1101
6240-
6244+
twatch_ultra.menu.Revision.Radio_LR1121=Radio-LR1121
6245+
twatch_ultra.menu.Revision.Radio_LR1121.build.board=LILYGO_LORA_LR1121
6246+
twatch_ultra.menu.Revision.Radio_SI4432=Radio-SI4432
6247+
twatch_ultra.menu.Revision.Radio_SI4432.build.board=LILYGO_LORA_SI4432
62416248

62426249
##############################################################
62436250

@@ -6393,12 +6400,16 @@ tlora_pager.menu.EraseFlash.all=Enabled
63936400
tlora_pager.menu.EraseFlash.all.upload.erase_cmd=-e
63946401

63956402

6396-
tlora_pager.menu.Revision.Radio_SX1280=Radio-SX1280
6397-
tlora_pager.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280
63986403
tlora_pager.menu.Revision.Radio_SX1262=Radio-SX1262
63996404
tlora_pager.menu.Revision.Radio_SX1262.build.board=LILYGO_LORA_SX1262
6405+
tlora_pager.menu.Revision.Radio_SX1280=Radio-SX1280
6406+
tlora_pager.menu.Revision.Radio_SX1280.build.board=LILYGO_LORA_SX1280
64006407
tlora_pager.menu.Revision.Radio_CC1101=Radio-CC1101
64016408
tlora_pager.menu.Revision.Radio_CC1101.build.board=LILYGO_LORA_CC1101
6409+
tlora_pager.menu.Revision.Radio_LR1121=Radio-LR1121
6410+
tlora_pager.menu.Revision.Radio_LR1121.build.board=LILYGO_LORA_LR1121
6411+
tlora_pager.menu.Revision.Radio_SI4432=Radio-SI4432
6412+
tlora_pager.menu.Revision.Radio_SI4432.build.board=LILYGO_LORA_SI4432
64026413

64036414
##############################################################
64046415

idf_component_examples/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/
2+
managed_components/
3+
dependencies.lock
4+
sdkconfig

idf_component_examples/esp_matter_light/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(PROJECT_VER_NUMBER 1)
88
# This should be done before using the IDF_TARGET variable.
99
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
1010

11+
idf_build_set_property(MINIMAL_BUILD ON)
1112
project(arduino_managed_component_light)
1213

1314
# WARNING: This is just an example for using key for decrypting the encrypted OTA image
@@ -20,7 +21,7 @@ if(CONFIG_IDF_TARGET_ESP32C2)
2021
include(relinker)
2122
endif()
2223

23-
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
24+
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++2a;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
2425
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
2526
# For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various
2627
# flags that depend on -Wformat

idf_component_examples/esp_matter_light/README.md

+16-5
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,22 @@ Use ESP-IDF 5.1.4 from https://github.com/espressif/esp-idf/tree/release/v5.1
5959
This example has been tested with Arduino Core 3.0.4
6060

6161
The project will download all necessary components, including the Arduino Core.
62-
Run `idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.<SOC>.idf" -p <PORT> flash monitor`
62+
Execute this sequence:
63+
`<remove build folder> using linux rm command or Windows rmdir command`
64+
`idf.py set-target <SoC_Target>`
65+
`idf.py -D SDKCONFIG_DEFAULTS="sdkconfig_file1;sdkconfig_file2;sdkconfig_fileX" -p <PORT> flash monitor`
6366

6467
Example for ESP32-S3/Linux | macOS:
6568
```
66-
idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32s3" -p /dev/ttyACM0 flash monitor
69+
rm -rf build
70+
idf.py set-target esp32s3
71+
idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults" -p /dev/ttyACM0 flash monitor
6772
```
6873
Example for ESP32-C3/Windows:
6974
```
70-
idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32c3" -p com3 flash monitor
75+
rmdir /s/q build
76+
idf.py set-target esp32c3
77+
idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults" -p com3 flash monitor
7178
```
7279

7380
It may be necessary to delete some folders and files before running `idf.py`
@@ -95,11 +102,15 @@ In order to build the application that will use Thread Networking instead of Wi-
95102

96103
Example for ESP32-C6/Linux | macOS:
97104
```
98-
idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.c6_thread" -p /dev/ttyACM0 flash monitor
105+
rm -rf build
106+
idf.py set-target esp32c6
107+
idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.c6_thread" -p /dev/ttyACM0 flash monitor
99108
```
100109
Example for ESP32-C6/Windows:
101110
```
102-
idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.c6_thread" -p com3 flash monitor
111+
rmdir /s/q build
112+
idf.py set-targt esp32c6
113+
idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.c6_thread" -p com3 flash monitor
103114
```
104115

105116
It may be necessary to delete some folders and files before running `idf.py`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"targets": {
3+
"esp32c2": false,
4+
"esp32s2": false
5+
},
6+
"requires": [
7+
"CONFIG_SOC_WIFI_SUPPORTED=y",
8+
"CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y",
9+
"CONFIG_MBEDTLS_HKDF_C=y"
10+
]
11+
}

0 commit comments

Comments
 (0)