diff --git a/dashboard/js/onboard.js b/dashboard/js/onboard.js index e4a4194..4822cc7 100644 --- a/dashboard/js/onboard.js +++ b/dashboard/js/onboard.js @@ -533,7 +533,7 @@ await loader.writeFlash({ fileArray: [{ data: firmwareData, address: offset }], - flashSize: 'detect', + flashSize: '4MB', flashMode: 'dio', flashFreq: '80m', eraseAll: false, diff --git a/firmware/partitions.csv b/firmware/partitions.csv index 793daf4..f367c4e 100644 --- a/firmware/partitions.csv +++ b/firmware/partitions.csv @@ -1,11 +1,10 @@ # Name, Type, SubType, Offset, Size, Flags # NVS, PHY init, and OTA data in standard low-flash locations nvs, data, nvs, 0x9000, 0x6000, -phy_init, data, phy, 0xf000, 0x1000, -# Factory app at standard 0x10000 offset (4 MB) -factory, app, factory, 0x10000, 0x400000, -# Dual OTA partitions for A/B updates with rollback -ota_0, app, ota_0, 0x410000,0x400000, -ota_1, app, ota_1, 0x810000,0x400000, +phy_init, data, phy, 0xF000, 0x1000, +# Factory app at standard 0x10000 offset (~1.9MB — fits current ~1.7MB binary) +factory, app, factory, 0x10000, 0x1F0000, +# Single OTA partition for A/B updates with rollback (fits in 4MB flash) +ota_0, app, ota_0, 0x200000,0x1F0000, # OTA data partition — bootloader uses this to track which OTA slot to boot -otadata, data, ota, 0xc10000,0x2000, +otadata, data, ota, 0x3F0000,0x2000, diff --git a/firmware/sdkconfig.defaults b/firmware/sdkconfig.defaults index 9868a07..58a84b0 100644 --- a/firmware/sdkconfig.defaults +++ b/firmware/sdkconfig.defaults @@ -4,9 +4,11 @@ # Chip target CONFIG_IDF_TARGET="esp32s3" -# Flash size — partitions.csv requires 12.1MB (factory 4MB + ota_0 4MB + ota_1 4MB) -CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y -CONFIG_ESPTOOLPY_FLASHSIZE="16MB" +# Flash size — partitions.csv requires ~3.9MB (factory 1.9MB + ota_0 1.9MB + otadata) +# Using 4MB as minimum supported flash. Safe on 16MB boards: spi_flash only panics +# when physical < header, not when physical > header. +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" # WiFi CSI Configuration CONFIG_ESP_WIFI_RX_BCN_ADAPT=y