Merge branch 'bugfix/read_binary_image_header_via_cache_in_cpu_start_v3.3' into 'release/v3.3'
esp32: cpu_start: read binary image header via cache (backport v3.3) See merge request espressif/esp-idf!6076
This commit is contained in:
commit
c286416762
1 changed files with 7 additions and 4 deletions
|
@ -424,10 +424,13 @@ void start_cpu0_default(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bootloader_flash_update_id();
|
bootloader_flash_update_id();
|
||||||
#if !CONFIG_SPIRAM_BOOT_INIT // If psram is uninitialized, we need to improve some flash configuration.
|
#if !CONFIG_SPIRAM_BOOT_INIT
|
||||||
esp_image_header_t fhdr;
|
// Read the application binary image header. This will also decrypt the header if the image is encrypted.
|
||||||
const esp_partition_t *partition = esp_ota_get_running_partition();
|
esp_image_header_t fhdr = {0};
|
||||||
spi_flash_read(partition->address, &fhdr, sizeof(esp_image_header_t));
|
// This assumes that DROM is the first segment in the application binary, i.e. that we can read
|
||||||
|
// the binary header through cache by accessing SOC_DROM_LOW address.
|
||||||
|
memcpy(&fhdr, (void*) SOC_DROM_LOW, sizeof(fhdr));
|
||||||
|
// If psram is uninitialized, we need to improve some flash configuration.
|
||||||
bootloader_flash_clock_config(&fhdr);
|
bootloader_flash_clock_config(&fhdr);
|
||||||
bootloader_flash_gpio_config(&fhdr);
|
bootloader_flash_gpio_config(&fhdr);
|
||||||
bootloader_flash_dummy_config(&fhdr);
|
bootloader_flash_dummy_config(&fhdr);
|
||||||
|
|
Loading…
Reference in a new issue