Skip to content

Commit dde6fc2

Browse files
authored
Set bootloader flash parameters (#318)
* chore: Update espressif -> idf & arduino After ESP IDF and Arduino updates the provided bootloaders come without proper flash parameters for our ESP32. So we have to create a own bootloader with our parameters. This is done by using the esptool.pyduring the build.
1 parent c63fb79 commit dde6fc2

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,24 @@ jobs:
114114
cp /github/home/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x0e000.bin
115115
cp bin/.pio/build/esp32dev/firmware.bin 0x10000.bin
116116
cp bin/.pio/build/esp32dev/firmware.bin firmware.bin
117+
ESPTOOL=/github/home/.platformio/packages/tool-esptoolpy/esptool.py
118+
chmod +x ${ESPTOOL}
119+
# CMD to create a merged binary (still missing flash.app)
120+
# ${ESPTOOL} --trace --chip esp32 merge_bin --output merged.bin \
121+
# --flash_freq keep --flash_mode dio --flash_size 4MB \
122+
# 0x01000 0x01000.bin \
123+
# 0x08000 0x08000.bin \
124+
# 0x0e000 0x0e000.bin \
125+
# 0x10000 0x10000.bin
126+
echo Original bootloader params
127+
${ESPTOOL} --chip esp32 image_info --version 2 0x01000.bin || echo image_info for original bootloader failed
128+
mv 0x01000.bin 0x01000.bin.org
129+
${ESPTOOL} --trace --chip esp32 merge_bin --output 0x01000.bin \
130+
--flash_freq keep --flash_mode dio --flash_size 4MB \
131+
--target-offset 0x01000 \
132+
0x01000 0x01000.bin.org
133+
echo OpenBikeSensor bootloader params
134+
${ESPTOOL} --chip esp32 image_info --version 2 0x01000.bin || echo image_info failed
117135
cp src/fonts/LICENSE.txt LICENSE-OpenSans.txt
118136
wget --no-verbose -O COPYRIGHT-ESP.html https://docs.espressif.com/projects/esp-idf/en/latest/esp32/COPYRIGHT.html
119137
wget --no-verbose -O LICENSE-ARDUINO-ESP32.md https://github.com/espressif/arduino-esp32/raw/master/LICENSE.md

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ src_dir = src
3838
extra_configs = custom_config.ini
3939

4040
[env:esp32dev]
41-
platform = espressif32 @ ^5.1
41+
platform = espressif32 @ ^5.2
4242
board = esp32dev
4343
framework = arduino
4444
monitor_speed = 115200

0 commit comments

Comments
 (0)