Skip to content

Commit f50ee68

Browse files
committed
fix: add ESP32-C5 support with bootloader offset 0x2000
- ESP32-C5/XIAO_ESP32C5 uses 0x2000 for bootloader (different from C3/C6) - Updated build-firmware.yml, generate-flasher.py, build-local.sh
1 parent 1793be9 commit f50ee68

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.github/workflows/build-firmware.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ jobs:
168168
elif [[ "${{ matrix.board }}" == *"esp32s2"* ]]; then
169169
CHIP_FAMILY="ESP32-S2"
170170
BOOTLOADER_OFFSET=4096 # 0x1000
171+
elif [[ "${{ matrix.board }}" == *"esp32c5"* ]] || [[ "${{ matrix.board }}" == *"XIAO_ESP32C5"* ]]; then
172+
# ESP32-C5 uses 0x2000 for bootloader | ESP32-C5 的 bootloader 偏移为 0x2000
173+
CHIP_FAMILY="ESP32-C5"
174+
BOOTLOADER_OFFSET=8192 # 0x2000
171175
elif [[ "${{ matrix.board }}" == *"esp32c3"* ]]; then
172176
CHIP_FAMILY="ESP32-C3"
173177
BOOTLOADER_OFFSET=0

docs/flasher/build-local.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ build_firmware() {
156156
local bootloader_offset=0
157157
case "$chip_family" in
158158
"ESP32"|"ESP32-S2")
159-
bootloader_offset=4096
159+
bootloader_offset=4096 # 0x1000
160+
;;
161+
"ESP32-C5")
162+
bootloader_offset=8192 # 0x2000 - ESP32-C5 specific
160163
;;
161164
*)
162165
bootloader_offset=0

docs/flasher/generate-flasher.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
"boot_app0": 0xe000,
4848
"firmware": 0x10000
4949
},
50+
"ESP32-C5": {
51+
"bootloader": 0x2000, # ESP32-C5 uses 0x2000 | ESP32-C5 使用 0x2000
52+
"partitions": 0x8000,
53+
"boot_app0": 0xe000,
54+
"firmware": 0x10000
55+
},
5056
"ESP32-C6": {
5157
"bootloader": 0x0,
5258
"partitions": 0x8000,

0 commit comments

Comments
 (0)