From 1ae9541176adb88477cbc61dca2bdb908568318f Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Fri, 7 Feb 2020 16:05:37 +0530 Subject: [PATCH] esp_rom: link newlib nano from ROM only if SPIRAM cache workaround is disabled --- components/esp_rom/CMakeLists.txt | 8 +++++--- components/esp_rom/component.mk | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/esp_rom/CMakeLists.txt b/components/esp_rom/CMakeLists.txt index b7db4945b2..714a36c61a 100644 --- a/components/esp_rom/CMakeLists.txt +++ b/components/esp_rom/CMakeLists.txt @@ -30,10 +30,12 @@ else() # Regular app build # Instead, those functions can be used from the toolchain by ESP-IDF. target_linker_script(${COMPONENT_LIB} INTERFACE "esp32/ld/esp32.rom.newlib-funcs-time.ld") endif() - endif() - if(CONFIG_NEWLIB_NANO_FORMAT) - list(APPEND scripts "esp32/ld/esp32.rom.newlib-nano.ld") + # Include in newlib nano from ROM only if SPIRAM cache workaround is disabled + if(CONFIG_NEWLIB_NANO_FORMAT) + list(APPEND scripts "esp32/ld/esp32.rom.newlib-nano.ld") + endif() + endif() if(NOT CONFIG_SPI_FLASH_ROM_DRIVER_PATCH) diff --git a/components/esp_rom/component.mk b/components/esp_rom/component.mk index f53b155963..8c99306c9d 100644 --- a/components/esp_rom/component.mk +++ b/components/esp_rom/component.mk @@ -10,12 +10,14 @@ LINKER_SCRIPTS += esp32.rom.ld \ #workaround is not enabled. ifndef CONFIG_SPIRAM_CACHE_WORKAROUND LINKER_SCRIPTS += esp32.rom.newlib-funcs.ld -endif +# Include in newlib nano from ROM only if SPIRAM cache workaround is disabled ifdef CONFIG_NEWLIB_NANO_FORMAT LINKER_SCRIPTS += esp32.rom.newlib-nano.ld endif +endif #CONFIG_SPIRAM_CACHE_WORKAROUND + ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH LINKER_SCRIPTS += esp32.rom.spiflash.ld endif