Skip to content

Commit 1afdceb

Browse files
Ship app-only binaries and update flash instructions to 0x10000
Release and build workflows now: - Ship app binary only (not merged binary with bootloader) - Flash at 0x10000 (app partition) instead of 0x0 - Preserve NVS storage including BLE bonds Updated flash instructions in: - Release notes - Build summary - Both show flashing at 0x10000 with explanation This matches ESP32Flasher.swift which flashes at 0x10000.
1 parent 7a996ae commit 1afdceb

2 files changed

Lines changed: 15 additions & 31 deletions

File tree

.github/workflows/build-esp32.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,15 @@ jobs:
4545
export SDKCONFIG_DEFAULTS="${{ matrix.board.sdkconfig }}"
4646
idf.py build
4747
48-
# Create single merged binary with all components
49-
esptool.py --chip esp32s3 merge_bin \
50-
-o build/mouthpad_usb_merged.bin \
51-
--flash_mode dio \
52-
--flash_freq 80m \
53-
--flash_size 8MB \
54-
0x0 build/bootloader/bootloader.bin \
55-
0x8000 build/partition_table/partition-table.bin \
56-
0x10000 build/mouthpad_usb.bin
57-
5848
- name: Prepare artifacts
5949
run: |
6050
mkdir -p artifacts
6151
COMMIT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
6252
63-
# Copy merged binary with commit hash
64-
cp esp/build/mouthpad_usb_merged.bin artifacts/mp_usb_${{ matrix.board.name }}_${COMMIT_SHA}.bin
53+
# Copy app binary only (preserves NVS/BLE bonds when flashed at 0x10000)
54+
cp esp/build/mouthpad_usb.bin artifacts/mp_usb_${{ matrix.board.name }}_${COMMIT_SHA}.bin
6555
66-
echo "✅ ${{ matrix.board.display_name }} merged binary created"
56+
echo "✅ ${{ matrix.board.display_name }} app binary created"
6757
ls -lh artifacts/
6858
6959
# Export COMMIT_SHA for use in next steps
@@ -85,12 +75,14 @@ jobs:
8575
echo "**SDK Config:** \`${{ matrix.board.sdkconfig }}\`" >> $GITHUB_STEP_SUMMARY
8676
echo "" >> $GITHUB_STEP_SUMMARY
8777
88-
if [ -f esp/build/mouthpad_usb_merged.bin ]; then
89-
SIZE=$(stat -c%s esp/build/mouthpad_usb_merged.bin 2>/dev/null || stat -f%z esp/build/mouthpad_usb_merged.bin 2>/dev/null || echo "unknown")
90-
echo "**Merged binary size:** $SIZE bytes" >> $GITHUB_STEP_SUMMARY
78+
if [ -f esp/build/mouthpad_usb.bin ]; then
79+
SIZE=$(stat -c%s esp/build/mouthpad_usb.bin 2>/dev/null || stat -f%z esp/build/mouthpad_usb.bin 2>/dev/null || echo "unknown")
80+
echo "**App binary size:** $SIZE bytes" >> $GITHUB_STEP_SUMMARY
9181
fi
9282
9383
echo "" >> $GITHUB_STEP_SUMMARY
9484
echo "**Artifact:** \`mp_usb_${{ matrix.board.name }}_${{ env.COMMIT_SHA }}.bin\`" >> $GITHUB_STEP_SUMMARY
9585
echo "" >> $GITHUB_STEP_SUMMARY
96-
echo "Flash with: \`esptool.py --chip esp32s3 write_flash 0x0 mp_usb_${{ matrix.board.name }}_${{ env.COMMIT_SHA }}.bin\`" >> $GITHUB_STEP_SUMMARY
86+
echo "Flash with: \`esptool.py --chip esp32s3 write_flash 0x10000 mp_usb_${{ matrix.board.name }}_${{ env.COMMIT_SHA }}.bin\`" >> $GITHUB_STEP_SUMMARY
87+
echo "" >> $GITHUB_STEP_SUMMARY
88+
echo "**Note:** Flashing at 0x10000 preserves NVS/BLE bonds" >> $GITHUB_STEP_SUMMARY

.github/workflows/release.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -185,25 +185,15 @@ jobs:
185185
export SDKCONFIG_DEFAULTS="${{ matrix.board.sdkconfig }}"
186186
idf.py build
187187
188-
# Create single merged binary with all components
189-
esptool.py --chip esp32s3 merge_bin \
190-
-o build/mouthpad_usb_merged.bin \
191-
--flash_mode dio \
192-
--flash_freq 80m \
193-
--flash_size 8MB \
194-
0x0 build/bootloader/bootloader.bin \
195-
0x8000 build/partition_table/partition-table.bin \
196-
0x10000 build/mouthpad_usb.bin
197-
198188
- name: Prepare artifacts
199189
run: |
200190
mkdir -p artifacts
201191
VERSION="${{ needs.check-version.outputs.version }}"
202192
203-
# Copy merged binary with version number
204-
cp esp/build/mouthpad_usb_merged.bin artifacts/mp_usb_${VERSION}_${{ matrix.board.name }}.bin
193+
# Copy app binary only (preserves NVS/BLE bonds when flashed at 0x10000)
194+
cp esp/build/mouthpad_usb.bin artifacts/mp_usb_${VERSION}_${{ matrix.board.name }}.bin
205195
206-
echo "✅ ${{ matrix.board.display_name }} merged binary created"
196+
echo "✅ ${{ matrix.board.display_name }} app binary created"
207197
ls -lh artifacts/
208198
209199
- name: Upload firmware artifacts
@@ -280,9 +270,11 @@ jobs:
280270
281271
**ESP32-S3 (BIN):**
282272
```bash
283-
esptool.py --chip esp32s3 write_flash 0x0 mp_usb_<version>_<board>.bin
273+
esptool.py --chip esp32s3 write_flash 0x10000 mp_usb_<version>_<board>.bin
284274
```
285275
276+
**Note:** Flashing at 0x10000 (app partition) preserves NVS storage including BLE bonds.
277+
286278
### 🔐 Checksums
287279
See `checksums.txt` for SHA256 verification.
288280
files: |

0 commit comments

Comments
 (0)