-
Notifications
You must be signed in to change notification settings - Fork 619
Description
Summary
The MeshOS-TDeck-1.1.6-merged.bin merged binary has the bootloader flash size set to 8MB, but the LilyGo T-Deck ships with a 16MB flash chip. This causes the second-stage bootloader to crash immediately during flash controller/MMU initialization, resulting in a tight RTC_SW_SYS_RST boot loop with no log output.
Hardware
- Board: LilyGo T-Deck
- Chip: ESP32-S3 (QFN56) revision v0.2
- Flash: 16MB (Manufacturer: 0x46, Device: 0x4018)
- PSRAM: 8MB (AP_3v3)
Symptoms
After flashing MeshOS-TDeck-1.1.6-merged.bin at offset 0x0, the device enters an infinite boot loop. Serial output at 115200 baud shows:
ESP-ROM:esp32s3-20210327
rst:0x3 (RTC_SW_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403cdb0a
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x4bc
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a0c
entry 0x403c98d0
This repeats indefinitely. The second-stage bootloader never prints any output — it crashes before reaching any log statements.
Root Cause
The bootloader image header in the merged binary has the flash size byte set to 0x3f (8MB, 80MHz, DIO), but the T-Deck's flash chip is 16MB. The bootloader uses this header value to configure the MMU/flash memory mapping. The mismatch causes an immediate crash at PC 0x403cdb0a (within the bootloader's IRAM segment).
Bootloader header (at offset 0x0 in merged binary):
- Flash size: 8MB ← incorrect
- Flash freq: 80MHz
- Flash mode: DIO
- Chip ID: ESP32-S3
App image header (at offset 0x10000 in merged binary):
- Flash size: 16MB ← correct
Workaround
Erase flash and re-flash with an explicit flash size override:
esptool.py --port <PORT> erase_flash
esptool.py --port <PORT> --chip esp32s3 write_flash --flash_size 16MB --flash_mode dio --flash_freq 80m 0x0 MeshOS-TDeck-1.1.6-merged.binThe key is --flash_size 16MB, which patches the bootloader header byte from 0x3f to 0x4f during flashing.
Suggested Fix
The build configuration for the T-Deck target should set CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y (or equivalent) so the bootloader is compiled with the correct flash size. This would make the merged binary flash correctly without requiring manual size overrides.
Diagnostic Details
esptool verify-flashconfirmed the binary was written correctly (digest matched)- eFuses show no secure boot or flash encryption enabled
- Partition table, OTA data, and app image are all valid
- The crash is entirely in the bootloader, before the app is loaded