From 444f4fcd626253243ad7449b063fd6d8fb7bf309 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:29:01 +0100 Subject: [PATCH] Fix ESP32 32MB program flash size --- tasmota/tasmota_support/support_esp.ino | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tasmota/tasmota_support/support_esp.ino b/tasmota/tasmota_support/support_esp.ino index 92346ab32..6fa3a1d31 100644 --- a/tasmota/tasmota_support/support_esp.ino +++ b/tasmota/tasmota_support/support_esp.ino @@ -659,8 +659,7 @@ uint32_t ESP_getFlashChipMagicSize(void) { return ESP_magicFlashChipSize(fhdr.spi_size); } -uint32_t ESP_magicFlashChipSize(uint8_t byte) -{ +uint32_t ESP_magicFlashChipSize(uint8_t byte) { switch(byte & 0x0F) { case 0x0: // 8 MBit (1MB) return 1048576; @@ -672,8 +671,10 @@ uint32_t ESP_magicFlashChipSize(uint8_t byte) return 8388608; case 0x4: // 128 MBit (16MB) return 16777216; - default: // fail? - return 0; + case 0x5: // 256 MBit (32MB) + return 33554432; + default: // fail so return (1KB) + return 1024; } }