system: moved placement of disable rom log efuse in startup flow

Functions used for burning this efuse would log, but at this point
esp_log is not initialized. Moved to a later point in the startup process.

Closes https://github.com/espressif/esp-idf/issues/9457
pull/9624/head^2
Marius Vikhammer 2022-08-01 11:12:14 +08:00
rodzic 56a89b920d
commit a421e30cf2
2 zmienionych plików z 18 dodań i 17 usunięć

Wyświetl plik

@ -96,18 +96,6 @@
#endif #endif
#endif // CONFIG_APP_BUILD_TYPE_ELF_RAM #endif // CONFIG_APP_BUILD_TYPE_ELF_RAM
// Set efuse ROM_LOG_MODE on first boot
//
// For CONFIG_BOOT_ROM_LOG_ALWAYS_ON (default) or undefined (ESP32), leave
// ROM_LOG_MODE undefined (no need to call this function during startup)
#if CONFIG_BOOT_ROM_LOG_ALWAYS_OFF
#define ROM_LOG_MODE ESP_EFUSE_ROM_LOG_ALWAYS_OFF
#elif CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW
#define ROM_LOG_MODE ESP_EFUSE_ROM_LOG_ON_GPIO_LOW
#elif CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH
#define ROM_LOG_MODE ESP_EFUSE_ROM_LOG_ON_GPIO_HIGH
#endif
#include "esp_private/startup_internal.h" #include "esp_private/startup_internal.h"
#include "esp_private/system_internal.h" #include "esp_private/system_internal.h"
@ -621,7 +609,7 @@ void IRAM_ATTR call_start_cpu0(void)
#if CONFIG_SPI_FLASH_SIZE_OVERRIDE #if CONFIG_SPI_FLASH_SIZE_OVERRIDE
int app_flash_size = esp_image_get_flash_size(fhdr.spi_size); int app_flash_size = esp_image_get_flash_size(fhdr.spi_size);
if (app_flash_size < 1 * 1024 * 1024) { if (app_flash_size < 1 * 1024 * 1024) {
ESP_LOGE(TAG, "Invalid flash size in app image header."); ESP_EARLY_LOGE(TAG, "Invalid flash size in app image header.");
abort(); abort();
} }
bootloader_flash_update_size(app_flash_size); bootloader_flash_update_size(app_flash_size);
@ -641,9 +629,5 @@ void IRAM_ATTR call_start_cpu0(void)
} }
#endif #endif
#ifdef ROM_LOG_MODE
esp_efuse_set_rom_log_scheme(ROM_LOG_MODE);
#endif
SYS_STARTUP_FN(); SYS_STARTUP_FN();
} }

Wyświetl plik

@ -81,6 +81,19 @@
#error "System has been configured to run on multiple cores, but target SoC only has a single core." #error "System has been configured to run on multiple cores, but target SoC only has a single core."
#endif #endif
// Set efuse ROM_LOG_MODE on first boot
//
// For CONFIG_BOOT_ROM_LOG_ALWAYS_ON (default) or undefined (ESP32), leave
// ROM_LOG_MODE undefined (no need to call this function during startup)
#if CONFIG_BOOT_ROM_LOG_ALWAYS_OFF
#define ROM_LOG_MODE ESP_EFUSE_ROM_LOG_ALWAYS_OFF
#elif CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW
#define ROM_LOG_MODE ESP_EFUSE_ROM_LOG_ON_GPIO_LOW
#elif CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH
#define ROM_LOG_MODE ESP_EFUSE_ROM_LOG_ON_GPIO_HIGH
#endif
uint64_t g_startup_time = 0; uint64_t g_startup_time = 0;
#if SOC_APB_BACKUP_DMA #if SOC_APB_BACKUP_DMA
@ -331,6 +344,10 @@ static void do_core_init(void)
esp_secure_boot_init_checks(); esp_secure_boot_init_checks();
#endif #endif
#ifdef ROM_LOG_MODE
esp_efuse_set_rom_log_scheme(ROM_LOG_MODE);
#endif
#if CONFIG_ESP_XT_WDT #if CONFIG_ESP_XT_WDT
esp_xt_wdt_config_t cfg = { esp_xt_wdt_config_t cfg = {
.timeout = CONFIG_ESP_XT_WDT_TIMEOUT, .timeout = CONFIG_ESP_XT_WDT_TIMEOUT,