From 3fc637c9cc331e6e5434b334250b0b5c15e5e2b3 Mon Sep 17 00:00:00 2001 From: Laukik Hase Date: Fri, 14 Feb 2025 16:23:52 +0530 Subject: [PATCH] fix(esp_system): Skip populating and checking the image header for pure RAM apps --- components/esp_system/port/cpu_start.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/esp_system/port/cpu_start.c b/components/esp_system/port/cpu_start.c index 36444dd36f..f45fc5c076 100644 --- a/components/esp_system/port/cpu_start.c +++ b/components/esp_system/port/cpu_start.c @@ -674,12 +674,14 @@ void IRAM_ATTR call_start_cpu0(void) // Read the application binary image header. This will also decrypt the header if the image is encrypted. __attribute__((unused)) esp_image_header_t fhdr = {0}; -#if CONFIG_APP_BUILD_TYPE_RAM && !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP +#if CONFIG_APP_BUILD_TYPE_RAM +#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP fhdr.spi_mode = ESP_IMAGE_SPI_MODE_DIO; fhdr.spi_speed = ESP_IMAGE_SPI_SPEED_DIV_2; fhdr.spi_size = ESP_IMAGE_FLASH_SIZE_4MB; bootloader_flash_unlock(); +#endif #else // We can access the image header through the cache by reading from the memory-mapped virtual DROM start offset uint32_t fhdr_src_addr = (uint32_t)(&_rodata_reserved_start) - sizeof(esp_image_header_t) - sizeof(esp_image_segment_header_t); @@ -688,9 +690,7 @@ void IRAM_ATTR call_start_cpu0(void) ESP_EARLY_LOGE(TAG, "Invalid app image header"); abort(); } - - -#endif // CONFIG_APP_BUILD_TYPE_RAM && !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP +#endif // CONFIG_APP_BUILD_TYPE_RAM #if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP #if CONFIG_IDF_TARGET_ESP32