esp32: Reduce using ESP_EARLY_LOGx and move some code after the stdout initialization

After setting _GLOBAL_REENT, ESP_LOGIx can be used instead of ESP_EARLY_LOGx.

Closes: https://github.com/espressif/esp-idf/issues/5343
This commit is contained in:
KonstantinKondrashov
2020-06-01 20:33:23 +08:00
parent 94d97499a3
commit 4a6e793322
4 changed files with 15 additions and 14 deletions

View File

@@ -204,10 +204,6 @@ void IRAM_ATTR call_start_cpu0()
}
ESP_EARLY_LOGI(TAG, "Starting app cpu, entry point is %p", call_start_cpu1);
#ifdef CONFIG_SECURE_FLASH_ENC_ENABLED
esp_flash_encryption_init_checks();
#endif
//Flush and enable icache for APP CPU
Cache_Flush(1);
Cache_Read_Enable(1);
@@ -348,9 +344,6 @@ void start_cpu0_default(void)
#if CONFIG_ESP32_BROWNOUT_DET
esp_brownout_init();
#endif
#if CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE
esp_efuse_disable_basic_rom_console();
#endif
rtc_gpio_force_hold_dis_all();
esp_vfs_dev_uart_register();
@@ -364,6 +357,14 @@ void start_cpu0_default(void)
_GLOBAL_REENT->_stdin = (FILE*) &__sf_fake_stdin;
_GLOBAL_REENT->_stdout = (FILE*) &__sf_fake_stdout;
_GLOBAL_REENT->_stderr = (FILE*) &__sf_fake_stderr;
#endif
// After setting _GLOBAL_REENT, ESP_LOGIx can be used instead of ESP_EARLY_LOGx.
#ifdef CONFIG_SECURE_FLASH_ENC_ENABLED
esp_flash_encryption_init_checks();
#endif
#if CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE
esp_efuse_disable_basic_rom_console();
#endif
esp_timer_init();
esp_set_time_from_rtc();