Skip to content

Commit be7d72b

Browse files
authored
Merge branch 'master' into feature/docker
2 parents 9a74157 + 6026f5f commit be7d72b

22 files changed

+1151
-44
lines changed

.github/workflows/cron.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
matrix:
2828
idf_branch: [release/v5.1, release/v4.4] #, release/v3.3]
2929
steps:
30-
- uses: actions/checkout@v3
30+
- uses: actions/checkout@v4
3131
with:
3232
fetch-depth: 0
3333
- name: Install dependencies
@@ -41,8 +41,14 @@ jobs:
4141
run: |
4242
git checkout ${{ matrix.idf_branch }} || echo "Using master branch"
4343
bash ./tools/cron.sh
44+
- name: Upload build
45+
if: failure()
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: build
49+
path: build
4450
- name: Upload archive
45-
uses: actions/upload-artifact@v3
51+
uses: actions/upload-artifact@v4
4652
with:
4753
name: artifacts
4854
path: dist

.github/workflows/push.yml

+14-7
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,21 @@ jobs:
2020
target: [esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c6, esp32h2]
2121
fail-fast: false
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
- name: Install dependencies
2525
run: bash ./tools/prepare-ci.sh
2626
- name: Build Libs for ${{ matrix.target }}
2727
run: bash ./build.sh -e -t ${{ matrix.target }}
28+
- name: Upload build
29+
if: failure()
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: build-${{ matrix.target }}
33+
path: build
2834
- name: Upload archive
29-
uses: actions/upload-artifact@v3
35+
uses: actions/upload-artifact@v4
3036
with:
31-
name: artifacts
37+
name: artifacts-${{ matrix.target }}
3238
path: dist
3339

3440
combine-artifacts:
@@ -37,23 +43,24 @@ jobs:
3743
runs-on: ubuntu-latest
3844
steps:
3945
- name: Download artifacts
40-
uses: actions/download-artifact@v3
46+
uses: actions/download-artifact@v4
4147
with:
42-
name: artifacts
4348
path: dist
49+
pattern: artifacts-*
50+
merge-multiple: true
4451
- shell: bash
4552
run: |
4653
mkdir -p out
4754
find dist -name 'arduino-esp32-libs-esp*.tar.gz' -exec tar zxvf {} -C out \;
4855
cd out/tools/esp32-arduino-libs && tar zcf ../../../dist/esp32-arduino-libs.tar.gz * && cd ../../..
4956
cp out/package_esp32_index.template.json dist/package_esp32_index.template.json
5057
- name: Upload full esp32-arduino-libs archive
51-
uses: actions/upload-artifact@v3
58+
uses: actions/upload-artifact@v4
5259
with:
5360
name: esp32-arduino-libs
5461
path: dist/esp32-arduino-libs.tar.gz
5562
- name: Upload package_esp32_index.template.json
56-
uses: actions/upload-artifact@v3
63+
uses: actions/upload-artifact@v4
5764
with:
5865
name: package-esp32-index-json
5966
path: dist/package_esp32_index.template.json

.github/workflows/repository_dispatch.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ jobs:
77
name: Dispatch Event
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
1113
- name: Install dependencies
1214
run: bash ./tools/prepare-ci.sh
1315
- name: Handle Event
@@ -16,8 +18,14 @@ jobs:
1618
GIT_AUTHOR_EMAIL: ${{ secrets.PUSH_EMAIL }}
1719
GIT_COMMITTER_EMAIL: ${{ secrets.PUSH_EMAIL }}
1820
run: bash ./tools/repository_dispatch.sh
21+
- name: Upload build
22+
if: failure()
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: build
26+
path: build
1927
- name: Upload archive
20-
uses: actions/upload-artifact@v3
28+
uses: actions/upload-artifact@v4
2129
with:
2230
name: artifacts
2331
path: dist

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,32 @@ git clone https://github.com/espressif/esp32-arduino-lib-builder
1212
cd esp32-arduino-lib-builder
1313
./build.sh
1414
```
15+
16+
### Using the User Interface
17+
18+
You can more easily build the libraries using the user interface found in the `tools/config_editor/` folder.
19+
It is a Python script that allows you to select and edit the options for the libraries you want to build.
20+
The script has mouse support and can also be pre-configured using the same command line arguments as the `build.sh` script.
21+
For more information and troubleshooting, please refer to the [UI README](tools/config_editor/README.md).
22+
23+
To use it, follow these steps:
24+
25+
1. Make sure you have the required dependencies installed:
26+
- Python 3.9 or later
27+
- The [Textual](https://github.com/textualize/textual/) library
28+
- All the dependencies listed in the previous section
29+
30+
2. Execute the script `tools/config_editor/app.py` from any folder. It will automatically detect the path to the root of the repository.
31+
32+
3. Configure the compilation and ESP-IDF options as desired.
33+
34+
4. Click on the "Compile Static Libraries" button to start the compilation process.
35+
36+
5. The script will show the compilation output in a new screen. Note that the compilation process can take many hours, depending on the number of libraries selected and the options chosen.
37+
38+
6. If the compilation is successful and the option to copy the libraries to the Arduino Core folder is enabled, it will already be available for use in the Arduino IDE. Otherwise, you can find the compiled libraries in the `esp32-arduino-libs` folder alongside this repository.
39+
- Note that the copy operation doesn't currently support the core downloaded from the Arduino IDE Boards Manager, only the manual installation from the [`arduino-esp32`](https://github.com/espressif/arduino-esp32) repository.
40+
1541
### Documentation
1642

1743
For more information about how to use the Library builder, please refer to this [Documentation page](https://docs.espressif.com/projects/arduino-esp32/en/latest/lib_builder.html?highlight=lib%20builder)

build.sh

+63-29
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if [ -z $DEPLOY_OUT ]; then
2121
fi
2222

2323
function print_help() {
24-
echo "Usage: build.sh [-s] [-A <arduino_branch>] [-I <idf_branch>] [-D <debug_level>] [-i <idf_commit>] [-c <path>] [-t <target>] [-b <build|menuconfig|reconfigure|idf_libs|copy_bootloader|mem_variant>] [config ...]"
24+
echo "Usage: build.sh [-s] [-A <arduino_branch>] [-I <idf_branch>] [-D <debug_level>] [-i <idf_commit>] [-c <path>] [-t <target>] [-b <build|menuconfig|reconfigure|idf-libs|copy-bootloader|mem-variant>] [config ...]"
2525
echo " -s Skip installing/updating of ESP-IDF and all components"
2626
echo " -A Set which branch of arduino-esp32 to be used for compilation"
2727
echo " -I Set which branch of ESP-IDF to be used for compilation"
@@ -30,7 +30,7 @@ function print_help() {
3030
echo " -d Deploy the build to github arduino-esp32"
3131
echo " -D Debug level to be set to ESP-IDF. One of default,none,error,warning,info,debug or verbose"
3232
echo " -c Set the arduino-esp32 folder to copy the result to. ex. '$HOME/Arduino/hardware/espressif/esp32'"
33-
echo " -t Set the build target(chip). ex. 'esp32s3'"
33+
echo " -t Set the build target(chip) ex. 'esp32s3' or select multiple targets(chips) by separating them with comma ex. 'esp32,esp32s3,esp32c3'"
3434
echo " -b Set the build type. ex. 'build' to build the project and prepare for uploading to a board"
3535
echo " ... Specify additional configs to be applied. ex. 'qio 80m' to compile for QIO Flash@80MHz. Requires -b"
3636
exit 1
@@ -64,16 +64,16 @@ while getopts ":A:I:i:c:t:b:D:sde" opt; do
6464
BUILD_DEBUG="$OPTARG"
6565
;;
6666
t )
67-
TARGET=$OPTARG
67+
IFS=',' read -ra TARGET <<< "$OPTARG"
6868
;;
6969
b )
7070
b=$OPTARG
7171
if [ "$b" != "build" ] &&
7272
[ "$b" != "menuconfig" ] &&
7373
[ "$b" != "reconfigure" ] &&
74-
[ "$b" != "idf_libs" ] &&
75-
[ "$b" != "copy_bootloader" ] &&
76-
[ "$b" != "mem_variant" ]; then
74+
[ "$b" != "idf-libs" ] &&
75+
[ "$b" != "copy-bootloader" ] &&
76+
[ "$b" != "mem-variant" ]; then
7777
print_help
7878
fi
7979
BUILD_TYPE="$b"
@@ -91,6 +91,9 @@ done
9191
shift $((OPTIND -1))
9292
CONFIGS=$@
9393

94+
# Output the TARGET array
95+
echo "TARGET(s): ${TARGET[@]}"
96+
9497
mkdir -p dist
9598

9699
if [ $SKIP_ENV -eq 0 ]; then
@@ -121,27 +124,42 @@ if [ "$BUILD_TYPE" != "all" ]; then
121124
echo "ERROR: You need to specify target for non-default builds"
122125
print_help
123126
fi
124-
configs="configs/defconfig.common;configs/defconfig.$TARGET;configs/defconfig.debug_$BUILD_DEBUG"
125-
127+
126128
# Target Features Configs
127129
for target_json in `jq -c '.targets[]' configs/builds.json`; do
128130
target=$(echo "$target_json" | jq -c '.target' | tr -d '"')
129-
if [ "$TARGET" == "$target" ]; then
130-
for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do
131-
configs="$configs;configs/defconfig.$defconf"
132-
done
131+
132+
# Check if $target is in the $TARGET array
133+
target_in_array=false
134+
for item in "${TARGET[@]}"; do
135+
if [ "$item" = "$target" ]; then
136+
target_in_array=true
137+
break
138+
fi
139+
done
140+
141+
if [ "$target_in_array" = false ]; then
142+
# Skip building for targets that are not in the $TARGET array
143+
continue
133144
fi
134-
done
145+
146+
configs="configs/defconfig.common;configs/defconfig.$target;configs/defconfig.debug_$BUILD_DEBUG"
147+
for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do
148+
configs="$configs;configs/defconfig.$defconf"
149+
done
135150

136-
# Configs From Arguments
137-
for conf in $CONFIGS; do
138-
configs="$configs;configs/defconfig.$conf"
139-
done
151+
echo "* Building for $target"
140152

141-
echo "idf.py -DIDF_TARGET=\"$TARGET\" -DSDKCONFIG_DEFAULTS=\"$configs\" $BUILD_TYPE"
142-
rm -rf build sdkconfig
143-
idf.py -DIDF_TARGET="$TARGET" -DSDKCONFIG_DEFAULTS="$configs" $BUILD_TYPE
144-
if [ $? -ne 0 ]; then exit 1; fi
153+
# Configs From Arguments
154+
for conf in $CONFIGS; do
155+
configs="$configs;configs/defconfig.$conf"
156+
done
157+
158+
echo "idf.py -DIDF_TARGET=\"$target\" -DSDKCONFIG_DEFAULTS=\"$configs\" $BUILD_TYPE"
159+
rm -rf build sdkconfig
160+
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$configs" $BUILD_TYPE
161+
if [ $? -ne 0 ]; then exit 1; fi
162+
done
145163
exit 0
146164
fi
147165

@@ -153,11 +171,23 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
153171
target=$(echo "$target_json" | jq -c '.target' | tr -d '"')
154172
target_skip=$(echo "$target_json" | jq -c '.skip // 0')
155173

156-
if [ "$TARGET" != "all" ] && [ "$TARGET" != "$target" ]; then
157-
echo "* Skipping Target: $target"
158-
continue
159-
fi
174+
# Check if $target is in the $TARGET array if not "all"
175+
if [ "$TARGET" != "all" ]; then
176+
target_in_array=false
177+
for item in "${TARGET[@]}"; do
178+
if [ "$item" = "$target" ]; then
179+
target_in_array=true
180+
break
181+
fi
182+
done
160183

184+
# If $target is not in the $TARGET array, skip processing
185+
if [ "$target_in_array" = false ]; then
186+
echo "* Skipping Target: $target"
187+
continue
188+
fi
189+
fi
190+
161191
# Skip chips that should not be a part of the final libs
162192
# WARNING!!! this logic needs to be updated when cron builds are split into jobs
163193
if [ "$TARGET" = "all" ] && [ $target_skip -eq 1 ]; then
@@ -185,7 +215,7 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
185215

186216
echo "* Build IDF-Libs: $idf_libs_configs"
187217
rm -rf build sdkconfig
188-
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$idf_libs_configs" idf_libs
218+
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$idf_libs_configs" idf-libs
189219
if [ $? -ne 0 ]; then exit 1; fi
190220

191221
if [ "$target" == "esp32s3" ]; then
@@ -214,7 +244,7 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
214244

215245
echo "* Build BootLoader: $bootloader_configs"
216246
rm -rf build sdkconfig
217-
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$bootloader_configs" copy_bootloader
247+
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$bootloader_configs" copy-bootloader
218248
if [ $? -ne 0 ]; then exit 1; fi
219249
done
220250

@@ -231,7 +261,7 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
231261

232262
echo "* Build Memory Variant: $mem_configs"
233263
rm -rf build sdkconfig
234-
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$mem_configs" mem_variant
264+
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$mem_configs" mem-variant
235265
if [ $? -ne 0 ]; then exit 1; fi
236266
done
237267
done
@@ -276,7 +306,11 @@ fi
276306

277307
# Generate PlatformIO manifest file
278308
if [ "$BUILD_TYPE" = "all" ]; then
279-
python3 ./tools/gen_platformio_manifest.py -o "$TOOLS_JSON_OUT/" -s $(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD) -c $(git -C "$IDF_PATH" rev-parse --short HEAD)
309+
pushd $IDF_PATH
310+
ibr=$(git describe --all --exact-match 2>/dev/null)
311+
ic=$(git -C "$IDF_PATH" rev-parse --short HEAD)
312+
popd
313+
python3 ./tools/gen_platformio_manifest.py -o "$TOOLS_JSON_OUT/" -s "$ibr" -c "$ic"
280314
if [ $? -ne 0 ]; then exit 1; fi
281315
fi
282316

configs/defconfig.common

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CONFIG_AUTOSTART_ARDUINO=y
33
CONFIG_ARDUHAL_ESP_LOG=y
44
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
55
CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y
6-
CONFIG_BT_ENABLED=y
6+
CONFIG_BT_BLE_BLUFI_ENABLE=y
77
CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y
88
CONFIG_BT_BTC_TASK_STACK_SIZE=8192
99
CONFIG_BT_BTU_TASK_STACK_SIZE=8192
@@ -21,6 +21,10 @@ CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2048
2121
CONFIG_ESP_TASK_WDT_PANIC=y
2222
CONFIG_ESP_TIMER_TASK_STACK_SIZE=4096
2323
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
24+
CONFIG_ESP_WIFI_11KV_SUPPORT=y
25+
CONFIG_ESP_WIFI_SCAN_CACHE=y
26+
CONFIG_ESP_WIFI_MBO_SUPPORT=y
27+
CONFIG_ESP_WIFI_11R_SUPPORT=y
2428
CONFIG_ESP_WIFI_FTM_ENABLE=y
2529
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8
2630
CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=8
@@ -54,6 +58,8 @@ CONFIG_LWIP_TCP_RTO_TIME=3000
5458
CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=2560
5559
CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0=y
5660
CONFIG_LWIP_MAX_SOCKETS=16
61+
CONFIG_LWIP_IP_FORWARD=y
62+
CONFIG_LWIP_IPV4_NAPT=y
5763
CONFIG_LWIP_DHCP_RESTORE_LAST_IP=y
5864
CONFIG_LWIP_DHCP_OPTIONS_LEN=128
5965
CONFIG_LWIP_SNTP_MAX_SERVERS=3
@@ -75,6 +81,8 @@ CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096
7581
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096
7682
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0
7783
CONFIG_LWIP_IPV6_AUTOCONFIG=y
84+
CONFIG_LWIP_IPV6_DHCP6=y
85+
CONFIG_LWIP_IPV6_RDNSS_MAX_DNS_SERVERS=2
7886
CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK=y
7987
CONFIG_ESP_RMAKER_USER_ID_CHECK=y
8088
CONFIG_ESP_INSIGHTS_ENABLED=y

configs/defconfig.esp32

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CONFIG_BTDM_CTRL_MODE_BTDM=y
22
CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE=20
3+
CONFIG_BT_ENABLED=y
34
CONFIG_BT_CLASSIC_ENABLED=y
45
CONFIG_BT_A2DP_ENABLE=y
56
CONFIG_BT_SPP_ENABLED=y

configs/defconfig.esp32c2

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CONFIG_XTAL_FREQ_26=y
22
CONFIG_XTAL_FREQ=26
3+
CONFIG_BT_ENABLED=y
34
CONFIG_BT_BLE_BLUFI_ENABLE=y
45
CONFIG_RTC_CLK_CAL_CYCLES=576
56
# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set

configs/defconfig.esp32c3

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CONFIG_BT_BLE_BLUFI_ENABLE=y
21
CONFIG_RTC_CLK_CAL_CYCLES=576
32
# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set
43
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304
4+
CONFIG_BT_ENABLED=y

configs/defconfig.esp32c6

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CONFIG_BT_ENABLED=y
12
CONFIG_BT_BLE_BLUFI_ENABLE=y
23
CONFIG_RTC_CLK_CAL_CYCLES=576
34
# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set

configs/defconfig.esp32h2

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CONFIG_BT_ENABLED=y
12
CONFIG_BT_BLE_BLUFI_ENABLE=y
23
CONFIG_RTC_CLK_CAL_CYCLES=576
34
# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set

configs/defconfig.esp32s3

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CONFIG_BT_ENABLED=y
12
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
23
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
34
CONFIG_SPIRAM=y

tools/config.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ if [ -d "$IDF_PATH" ]; then
5858
fi
5959

6060
function get_os(){
61-
OSBITS=`arch`
61+
OSBITS=`uname -m`
6262
if [[ "$OSTYPE" == "linux"* ]]; then
6363
if [[ "$OSBITS" == "i686" ]]; then
6464
echo "linux32"

tools/config_editor/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.venv/
2+
__pycache__/

0 commit comments

Comments
 (0)