Skip to content

Commit cd94b04

Browse files
authored
PlatformIO updates for CI (#5387)
* Update PlatformIO CI build script - Switch to the latest toolchains 8.4.0 for ESP32, ESP32S2, ESP32C3 - Use PlatformIO from master branch for better robustness * Update package.json for PlatformIO
1 parent e0504f4 commit cd94b04

File tree

2 files changed

+44
-10
lines changed

2 files changed

+44
-10
lines changed

Diff for: .github/scripts/install-platformio-esp32.sh

+30-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,43 @@
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/idf-master"
4+
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git#feature/arduino-idf-master"
5+
6+
XTENSA32_TOOLCHAIN_VERSION="8.4.0+2021r1"
7+
XTENSA32S2_TOOLCHAIN_VERSION="8.4.0+2021r1"
8+
RISCV_TOOLCHAIN_VERSION="8.4.0+2021r1"
9+
ESPTOOLPY_VERSION="~1.30100.0"
10+
ESPRESSIF_ORGANIZATION_NAME="espressif"
511

612
echo "Installing Python Wheel ..."
713
pip install wheel > /dev/null 2>&1
814

915
echo "Installing PlatformIO ..."
10-
pip install -U https://github.com/platformio/platformio/archive/develop.zip > /dev/null 2>&1
16+
pip install -U https://github.com/platformio/platformio/archive/master.zip > /dev/null 2>&1
1117

1218
echo "Installing Platform ESP32 ..."
13-
python -m platformio platform install $PLATFORMIO_ESP32_URL > /dev/null 2>&1
14-
15-
echo "Replacing the framework version ..."
16-
python -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoespressif32']['version'] = '*'; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()"
19+
python -m platformio platform install $PLATFORMIO_ESP32_URL > /dev/null 2>&1
20+
21+
echo "Replacing the package versions ..."
22+
replace_script="import json; import os;"
23+
replace_script+="fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+');"
24+
replace_script+="data=json.load(fp);"
25+
# Use framework sources from the repository
26+
replace_script+="data['packages']['framework-arduinoespressif32']['version'] = '*';"
27+
replace_script+="del data['packages']['framework-arduinoespressif32']['owner'];"
28+
# Use toolchain packages from the "espressif" organization
29+
replace_script+="data['packages']['toolchain-xtensa-esp32']['owner']='$ESPRESSIF_ORGANIZATION_NAME';"
30+
replace_script+="data['packages']['toolchain-xtensa-esp32s2']['owner']='$ESPRESSIF_ORGANIZATION_NAME';"
31+
replace_script+="data['packages']['toolchain-riscv32-esp']['owner']='$ESPRESSIF_ORGANIZATION_NAME';"
32+
# 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';"
36+
# esptool.py may require an upstream version (for now platformio is the owner)
37+
replace_script+="data['packages']['tool-esptoolpy']['version']='$ESPTOOLPY_VERSION';"
38+
# Save results
39+
replace_script+="fp.seek(0);fp.truncate();json.dump(data, fp, indent=2);fp.close()"
40+
python -c "$replace_script"
1741

1842
if [ "$GITHUB_REPOSITORY" == "espressif/arduino-esp32" ]; then
1943
echo "Linking Core..."

Diff for: package.json

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
{
2-
"name": "framework-arduinoespressif32",
3-
"description": "Arduino Wiring-based Framework (ESP32 Core)",
4-
"version": "0.0.0",
2+
"name": "framework-arduinoespressif32",
3+
"version": "0.0.0",
4+
"description": "Arduino Wiring-based Framework for the Espressif ESP32, ESP32-S and ESP32-C series of SoCs",
5+
"keywords": [
6+
"framework",
7+
"arduino",
8+
"espressif",
9+
"esp32"
10+
],
11+
"license": "LGPL-2.1-or-later",
12+
"repository": {
13+
"type": "git",
514
"url": "https://github.com/espressif/arduino-esp32"
6-
}
15+
}
16+
}

0 commit comments

Comments
 (0)