mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-11 13:00:19 +00:00
fix(ram_app): Fixed issue ram_app can't use the SPI Flash
1st bootloader won't help to initialize the MSPI & cache properly as it usually do when loading from flash. And the ram app doesn't have valid headers. Since there is no enough space in 2nd bootloader, we replace the `bootloader_init_spi_flash` in the ram_app (!pure_ram_app), with an customized alternative of it for the ram_app. This alternative helps to initialize the MSPI & cache properly, without the help of 1st bootloader or image headers.
This commit is contained in:
@@ -132,7 +132,7 @@ esp_err_t bootloader_init(void)
|
||||
/* print 2nd bootloader banner */
|
||||
bootloader_print_banner();
|
||||
|
||||
#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
|
||||
#if !CONFIG_APP_BUILD_TYPE_RAM
|
||||
//init cache hal
|
||||
cache_hal_init();
|
||||
//init mmu
|
||||
@@ -144,7 +144,6 @@ esp_err_t bootloader_init(void)
|
||||
ESP_LOGE(TAG, "failed when running XMC startup flow, reboot!");
|
||||
return ret;
|
||||
}
|
||||
#if !CONFIG_APP_BUILD_TYPE_RAM
|
||||
// read bootloader header
|
||||
if ((ret = bootloader_read_bootloader_header()) != ESP_OK) {
|
||||
return ret;
|
||||
@@ -153,12 +152,11 @@ esp_err_t bootloader_init(void)
|
||||
if ((ret = bootloader_check_bootloader_validity()) != ESP_OK) {
|
||||
return ret;
|
||||
}
|
||||
#endif // !CONFIG_APP_BUILD_TYPE_RAM
|
||||
// initialize spi flash
|
||||
if ((ret = bootloader_init_spi_flash()) != ESP_OK) {
|
||||
return ret;
|
||||
}
|
||||
#endif //#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
|
||||
#endif // !CONFIG_APP_BUILD_TYPE_RAM
|
||||
|
||||
// check whether a WDT reset happend
|
||||
bootloader_check_wdt_reset();
|
||||
|
Reference in New Issue
Block a user