mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-25 01:37:22 +00:00
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:
@@ -249,10 +249,11 @@ static void flash_test_func(flash_test_func_t func, int test_num)
|
||||
static void test_metadata(const esp_partition_t* part)
|
||||
{
|
||||
esp_flash_t* chip = part->flash_chip;
|
||||
uint32_t id, size;
|
||||
uint32_t id, size, actual_size;
|
||||
TEST_ESP_OK(esp_flash_read_id(chip, &id));
|
||||
TEST_ESP_OK(esp_flash_get_size(chip, &size));
|
||||
printf("Flash ID %08lx detected size %" PRIu32 "bytes\n", id, size);
|
||||
TEST_ESP_OK(esp_flash_get_physical_size(chip, &actual_size));
|
||||
printf("Flash ID %08lx, size %" PRIu32 "bytes can be mapped, actual flash size is %" PRIu32 "bytes\n", id, size, actual_size);
|
||||
}
|
||||
|
||||
TEST_CASE_FLASH("SPI flash metadata functions", test_metadata);
|
||||
|
Reference in New Issue
Block a user