Skip to content

Commit

Permalink
add support for Flash 32MB..128MB (S2, S3)
Browse files Browse the repository at this point in the history
ESP32-S2 and ESP32-S3
supports up to 1 GB of external flash and RAM
add support for
-    32MB
-    64MB
-    128MB ( example NOR spiFLASH 1G-BIT W25Q01JVZEIQ Winbond 0xEF 0x40 0x21 )

Merges #7688

Signed-off-by: Ivan Grokhotkov <ivan@espressif.com>
  • Loading branch information
ESP32DE authored and espressif-bot committed Apr 19, 2022
1 parent 050d697 commit 04959af
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 1 deletion.
3 changes: 3 additions & 0 deletions components/bootloader_support/include/esp_app_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ typedef enum {
ESP_IMAGE_FLASH_SIZE_4MB, /*!< SPI flash size 4 MB */
ESP_IMAGE_FLASH_SIZE_8MB, /*!< SPI flash size 8 MB */
ESP_IMAGE_FLASH_SIZE_16MB, /*!< SPI flash size 16 MB */
ESP_IMAGE_FLASH_SIZE_32MB, /*!< SPI flash size 32 MB */
ESP_IMAGE_FLASH_SIZE_64MB, /*!< SPI flash size 64 MB */
ESP_IMAGE_FLASH_SIZE_128MB, /*!< SPI flash size 128 MB */
ESP_IMAGE_FLASH_SIZE_MAX /*!< SPI flash size MAX */
} esp_image_flash_size_t;

Expand Down
18 changes: 18 additions & 0 deletions components/bootloader_support/src/esp32s2/bootloader_esp32s2.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ static void update_flash_config(const esp_image_header_t *bootloader_hdr)
case ESP_IMAGE_FLASH_SIZE_16MB:
size = 16;
break;
case ESP_IMAGE_FLASH_SIZE_32MB:
size = 32;
break;
case ESP_IMAGE_FLASH_SIZE_64MB:
size = 64;
break;
case ESP_IMAGE_FLASH_SIZE_128MB:
size = 128;
break;
default:
size = 2;
}
Expand Down Expand Up @@ -174,6 +183,15 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr)
case ESP_IMAGE_FLASH_SIZE_16MB:
str = "16MB";
break;
case ESP_IMAGE_FLASH_SIZE_32MB:
str = "32MB";
break;
case ESP_IMAGE_FLASH_SIZE_64MB:
str = "64MB";
break;
case ESP_IMAGE_FLASH_SIZE_128MB:
str = "128MB";
break;
default:
str = "2MB";
break;
Expand Down
18 changes: 18 additions & 0 deletions components/bootloader_support/src/esp32s3/bootloader_esp32s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ static void update_flash_config(const esp_image_header_t *bootloader_hdr)
case ESP_IMAGE_FLASH_SIZE_16MB:
size = 16;
break;
case ESP_IMAGE_FLASH_SIZE_32MB:
size = 32;
break;
case ESP_IMAGE_FLASH_SIZE_64MB:
size = 64;
break;
case ESP_IMAGE_FLASH_SIZE_128MB:
size = 128;
break;
default:
size = 2;
}
Expand Down Expand Up @@ -176,6 +185,15 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr)
case ESP_IMAGE_FLASH_SIZE_16MB:
str = "16MB";
break;
case ESP_IMAGE_FLASH_SIZE_32MB:
str = "32MB";
break;
case ESP_IMAGE_FLASH_SIZE_64MB:
str = "64MB";
break;
case ESP_IMAGE_FLASH_SIZE_128MB:
str = "128MB";
break;
default:
str = "2MB";
break;
Expand Down
6 changes: 6 additions & 0 deletions components/bootloader_support/src/esp_image_format.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,12 @@ int esp_image_get_flash_size(esp_image_flash_size_t app_flash_size)
return 8 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_16MB:
return 16 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_32MB:
return 32 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_64MB:
return 64 * 1024 * 1024;
case ESP_IMAGE_FLASH_SIZE_128MB:
return 128 * 1024 * 1024;
default:
return 0;
}
Expand Down
9 changes: 9 additions & 0 deletions components/esptool_py/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ menu "Serial flasher config"
bool "8 MB"
config ESPTOOLPY_FLASHSIZE_16MB
bool "16 MB"
config ESPTOOLPY_FLASHSIZE_32MB
bool "32 MB"
config ESPTOOLPY_FLASHSIZE_64MB
bool "64 MB"
config ESPTOOLPY_FLASHSIZE_128MB
bool "128 MB"
endchoice

config ESPTOOLPY_FLASHSIZE
Expand All @@ -179,6 +185,9 @@ menu "Serial flasher config"
default "4MB" if ESPTOOLPY_FLASHSIZE_4MB
default "8MB" if ESPTOOLPY_FLASHSIZE_8MB
default "16MB" if ESPTOOLPY_FLASHSIZE_16MB
default "32MB" if ESPTOOLPY_FLASHSIZE_32MB
default "64MB" if ESPTOOLPY_FLASHSIZE_64MB
default "128MB" if ESPTOOLPY_FLASHSIZE_128MB

config ESPTOOLPY_FLASHSIZE_DETECT
bool "Detect flash size when flashing bootloader"
Expand Down
2 changes: 1 addition & 1 deletion components/partition_table/gen_esp32part.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def main():
parser = argparse.ArgumentParser(description='ESP32 partition table utility')

parser.add_argument('--flash-size', help='Optional flash size limit, checks partition table fits in flash',
nargs='?', choices=['1MB', '2MB', '4MB', '8MB', '16MB'])
nargs='?', choices=['1MB', '2MB', '4MB', '8MB', '16MB', '32MB', '64MB', '128MB'])
parser.add_argument('--disable-md5sum', help='Disable md5 checksum for the partition table', default=False, action='store_true')
parser.add_argument('--no-verify', help="Don't verify partition table fields", action='store_true')
parser.add_argument('--verify', '-v', help='Verify partition table fields (deprecated, this behaviour is '
Expand Down

0 comments on commit 04959af

Please sign in to comment.