Skip to content

Commit f0636d5

Browse files
authored
Add support for extra flash images (espressif#6625)
This PR adds support for uploading additional flash images (e.g. Adafruit Tiny UF2 bootloader) specified in board manifests. Additionally, the PR switches the PlatformIO CI script to the upstream version of the ESP32 dev-platform (basically reverts changes introduced in espressif#5387 as they are no longer required).
1 parent b3c203d commit f0636d5

5 files changed

+29
-5
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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/arduino-idf-master"
4+
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git"
55

66
TOOLCHAIN_VERSION="8.4.0+2021r2-patch3"
77
ESPTOOLPY_VERSION="~1.30100.0"

Diff for: tools/platformio-build-esp32.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# Extends: https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py
2626

27-
from os.path import abspath, isdir, isfile, join, basename
27+
from os.path import abspath, isdir, isfile, join
2828

2929
from SCons.Script import DefaultEnvironment
3030

@@ -331,6 +331,12 @@
331331
("0x8000", join(env.subst("$BUILD_DIR"), "partitions.bin")),
332332
("0xe000", join(FRAMEWORK_DIR, "tools", "partitions", "boot_app0.bin"))
333333
]
334+
+ [
335+
(offset, join(FRAMEWORK_DIR, img))
336+
for offset, img in env.BoardConfig().get(
337+
"upload.arduino.flash_extra_images", []
338+
)
339+
],
334340
)
335341

336342
#

Diff for: tools/platformio-build-esp32c3.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# Extends: https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py
2626

27-
from os.path import abspath, isdir, isfile, join, basename
27+
from os.path import abspath, isdir, isfile, join
2828

2929
from SCons.Script import DefaultEnvironment
3030

@@ -324,6 +324,12 @@
324324
("0x8000", join(env.subst("$BUILD_DIR"), "partitions.bin")),
325325
("0xe000", join(FRAMEWORK_DIR, "tools", "partitions", "boot_app0.bin"))
326326
]
327+
+ [
328+
(offset, join(FRAMEWORK_DIR, img))
329+
for offset, img in env.BoardConfig().get(
330+
"upload.arduino.flash_extra_images", []
331+
)
332+
],
327333
)
328334

329335
#

Diff for: tools/platformio-build-esp32s2.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# Extends: https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py
2626

27-
from os.path import abspath, isdir, isfile, join, basename
27+
from os.path import abspath, isdir, isfile, join
2828

2929
from SCons.Script import DefaultEnvironment
3030

@@ -326,6 +326,12 @@
326326
("0x8000", join(env.subst("$BUILD_DIR"), "partitions.bin")),
327327
("0xe000", join(FRAMEWORK_DIR, "tools", "partitions", "boot_app0.bin"))
328328
]
329+
+ [
330+
(offset, join(FRAMEWORK_DIR, img))
331+
for offset, img in env.BoardConfig().get(
332+
"upload.arduino.flash_extra_images", []
333+
)
334+
],
329335
)
330336

331337
#

Diff for: tools/platformio-build-esp32s3.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# Extends: https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py
2626

27-
from os.path import abspath, isdir, isfile, join, basename
27+
from os.path import abspath, isdir, isfile, join
2828

2929
from SCons.Script import DefaultEnvironment
3030

@@ -343,6 +343,12 @@
343343
("0x8000", join(env.subst("$BUILD_DIR"), "partitions.bin")),
344344
("0xe000", join(FRAMEWORK_DIR, "tools", "partitions", "boot_app0.bin"))
345345
]
346+
+ [
347+
(offset, join(FRAMEWORK_DIR, img))
348+
for offset, img in env.BoardConfig().get(
349+
"upload.arduino.flash_extra_images", []
350+
)
351+
],
346352
)
347353

348354
#

0 commit comments

Comments
 (0)