Fix wrong flash_chip_id on ESP32, when DOUT is not used

This also fixes the wrong reported flash size for flash modes: DIO, QUOUT and QIO. Now a global struct is used, which gets populated by the boot loader.
This commit is contained in:
Christian Baars 2022-08-21 11:15:47 +02:00 committed by GitHub
parent 204289e1ab
commit 42399d446a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -558,7 +558,7 @@ int32_t ESP_getHeapFragmentation(void) {
uint32_t ESP_getFlashChipId(void)
{
uint32_t id = bootloader_read_flash_id();
uint32_t id = g_rom_flashchip.device_id;
id = ((id & 0xff) << 16) | ((id >> 16) & 0xff) | (id & 0xff00);
return id;
}