spi_flash: Fix issue that cannot get accurate flash size when encounter large size memory,

Closes https://github.com/espressif/esp-idf/pull/9566
This commit is contained in:
Cao Sen Miao
2022-10-21 18:28:54 +08:00
parent 310a18e59f
commit b4964279d4
8 changed files with 137 additions and 78 deletions

View File

@@ -409,6 +409,7 @@ esp_err_t esp_flash_init_default_chip(void)
if (default_chip.size > legacy_chip->chip_size) {
ESP_EARLY_LOGW(TAG, "Detected size(%dk) larger than the size in the binary image header(%dk). Using the size in the binary image header.", default_chip.size/1024, legacy_chip->chip_size/1024);
}
// Set chip->size equal to ROM flash size(also equal to menuconfig flash size), which means the available size that can be used
default_chip.size = legacy_chip->chip_size;
esp_flash_default_chip = &default_chip;