Skip to content

Commit d03ff68

Browse files
committed
package: fix bootloade offset
1 parent c870978 commit d03ff68

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

package.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ cp ./storage.bin $PACKAGE_DIR/
1515

1616
# Create flash scripts with board-specific flags
1717
ESPFLASH_FLAGS=""
18+
BOOTLOADER_OFFSET="0x0"
1819
if [ "$BOARD" = "esp32_p4_function_ev_board" ]; then
1920
ESPFLASH_FLAGS="--chip esp32p4 --no-stub"
21+
BOOTLOADER_OFFSET="0x2000"
2022
fi
2123

2224
cat << EOF > $PACKAGE_DIR/flash.sh
2325
#!/bin/bash
2426
echo "Flashing OpenTyrian for ${BOARD}..."
2527
echo "Flashing bootloader..."
26-
espflash write-bin ${ESPFLASH_FLAGS} 0x0 bootloader-${BOARD}.bin
28+
espflash write-bin ${ESPFLASH_FLAGS} ${BOOTLOADER_OFFSET} bootloader-${BOARD}.bin
2729
echo "Flashing partition table..."
2830
espflash write-bin ${ESPFLASH_FLAGS} 0x8000 partition-table-${BOARD}.bin
2931
echo "Flashing application..."
@@ -38,7 +40,7 @@ cat << EOF > $PACKAGE_DIR/flash.bat
3840
@echo off
3941
echo Flashing OpenTyrian for ${BOARD}...
4042
echo Flashing bootloader...
41-
espflash write-bin ${ESPFLASH_FLAGS} 0x0 bootloader-${BOARD}.bin
43+
espflash write-bin ${ESPFLASH_FLAGS} ${BOOTLOADER_OFFSET} bootloader-${BOARD}.bin
4244
echo Flashing partition table...
4345
espflash write-bin ${ESPFLASH_FLAGS} 0x8000 partition-table-${BOARD}.bin
4446
echo Flashing application...
@@ -51,7 +53,7 @@ EOF
5153
cat << EOF > $PACKAGE_DIR/flash.ps1
5254
Write-Host "Flashing OpenTyrian for ${BOARD}..."
5355
Write-Host "Flashing bootloader..."
54-
espflash write-bin ${ESPFLASH_FLAGS} 0x0 bootloader-${BOARD}.bin
56+
espflash write-bin ${ESPFLASH_FLAGS} ${BOOTLOADER_OFFSET} bootloader-${BOARD}.bin
5557
Write-Host "Flashing partition table..."
5658
espflash write-bin ${ESPFLASH_FLAGS} 0x8000 partition-table-${BOARD}.bin
5759
Write-Host "Flashing application..."
@@ -82,7 +84,7 @@ description = "OpenTyrian game firmware for ESP32 boards"
8284
[[flash_components]]
8385
name = "bootloader"
8486
file = "bootloader-${BOARD}.bin"
85-
offset = "0x0"
87+
offset = "${BOOTLOADER_OFFSET}"
8688
required = true
8789
description = "ESP-IDF bootloader - handles initial boot sequence"
8890
@@ -118,7 +120,7 @@ size = "detect" # Flash size (detect automatically)
118120
flags = "${ESPFLASH_FLAGS}"
119121
120122
[tools.espflash.commands]
121-
bootloader = "espflash write-bin ${ESPFLASH_FLAGS} 0x0 bootloader-${BOARD}.bin"
123+
bootloader = "espflash write-bin ${ESPFLASH_FLAGS} ${BOOTLOADER_OFFSET} bootloader-${BOARD}.bin"
122124
partition_table = "espflash write-bin ${ESPFLASH_FLAGS} 0x8000 partition-table-${BOARD}.bin"
123125
application = "espflash write-bin ${ESPFLASH_FLAGS} 0x10000 opentyrian.bin"
124126
storage = "espflash write-bin ${ESPFLASH_FLAGS} 0x310000 storage.bin"

0 commit comments

Comments
 (0)