diff --git a/components/esp_rom/Kconfig b/components/esp_rom/Kconfig new file mode 100644 index 0000000000..98807cc042 --- /dev/null +++ b/components/esp_rom/Kconfig @@ -0,0 +1,7 @@ +menu "ESP-ROM" + + config ESP_ROM_PRINT_IN_IRAM + bool "Place print functions in IRAM" if SPI_FLASH_AUTO_SUSPEND + default y + +endmenu diff --git a/components/esp_rom/linker.lf b/components/esp_rom/linker.lf index 10a76b3f0e..e856312648 100644 --- a/components/esp_rom/linker.lf +++ b/components/esp_rom/linker.lf @@ -2,8 +2,9 @@ archive: libesp_rom.a entries: esp_rom_sys (noflash) - esp_rom_print (noflash) esp_rom_spiflash (noflash) + if ESP_ROM_PRINT_IN_IRAM = y: + esp_rom_print (noflash) if ESP_ROM_HAS_FLASH_COUNT_PAGES_BUG = y: esp_rom_cache_esp32s2_esp32s3 (noflash) if ESP_ROM_HAS_CACHE_WRITEBACK_BUG = y: diff --git a/components/log/Kconfig b/components/log/Kconfig index c1981bb312..6d1670dd45 100644 --- a/components/log/Kconfig +++ b/components/log/Kconfig @@ -50,4 +50,9 @@ menu "Log" orsource "./Kconfig.format" + config LOG_IN_IRAM + bool "Place logging functions in IRAM" if SPI_FLASH_AUTO_SUSPEND + default y + select ESP_ROM_PRINT_IN_IRAM + endmenu diff --git a/components/log/linker.lf b/components/log/linker.lf index ad7992773b..9b6ce76640 100644 --- a/components/log/linker.lf +++ b/components/log/linker.lf @@ -1,15 +1,16 @@ [mapping:log] archive: liblog.a entries: - log_write:esp_log_write (noflash) - log_write:esp_log_writev (noflash) - tag_log_level:esp_log_level_get_timeout (noflash) - log_timestamp:esp_log_timestamp (noflash) - log_timestamp:esp_log_early_timestamp (noflash) - log_lock (noflash) - util (noflash) - log_timestamp_common (noflash) - log_print (noflash) - log (noflash) - if LOG_MASTER_LEVEL = y: - log_level: esp_log_get_level_master (noflash) + if LOG_IN_IRAM = y: + log_write:esp_log_write (noflash) + log_write:esp_log_writev (noflash) + tag_log_level:esp_log_level_get_timeout (noflash) + log_timestamp:esp_log_timestamp (noflash) + log_timestamp:esp_log_early_timestamp (noflash) + log_lock (noflash) + util (noflash) + log_timestamp_common (noflash) + log_print (noflash) + log (noflash) + if LOG_MASTER_LEVEL = y: + log_level: esp_log_get_level_master (noflash) diff --git a/tools/test_apps/configs/sdkconfig.flash_auto_suspend_iram_reduction b/tools/test_apps/configs/sdkconfig.flash_auto_suspend_iram_reduction index 2ef0931158..7402a623da 100644 --- a/tools/test_apps/configs/sdkconfig.flash_auto_suspend_iram_reduction +++ b/tools/test_apps/configs/sdkconfig.flash_auto_suspend_iram_reduction @@ -16,3 +16,5 @@ CONFIG_LIBC_MISC_IN_IRAM=n CONFIG_ESP_TIMER_IN_IRAM=n CONFIG_SPI_FLASH_PLACE_FUNCTIONS_IN_IRAM=n CONFIG_ESP_INTR_IN_IRAM=n +CONFIG_LOG_IN_IRAM=n +CONFIG_ESP_ROM_PRINT_IN_IRAM=n