diff --git a/components/newlib/Kconfig b/components/newlib/Kconfig index 221ef36a94..9cbfd8ec4b 100644 --- a/components/newlib/Kconfig +++ b/components/newlib/Kconfig @@ -11,6 +11,10 @@ menu "LibC" depends on !IDF_TOOLCHAIN_CLANG && IDF_EXPERIMENTAL_FEATURES endchoice + config LIBC_MISC_IN_IRAM + bool "Place misc libc functions (abort/assert/stdatomics) in IRAM" if SPI_FLASH_AUTO_SUSPEND + default y + config LIBC_LOCKS_PLACE_IN_IRAM bool "Place lock API in IRAM" default y diff --git a/components/newlib/src/newlib.lf b/components/newlib/src/newlib.lf index 1e2782ac7d..7ca47a0b9b 100644 --- a/components/newlib/src/newlib.lf +++ b/components/newlib/src/newlib.lf @@ -1,10 +1,11 @@ [mapping:newlib] archive: libnewlib.a entries: - if HEAP_PLACE_FUNCTION_INTO_FLASH = n: - heap (noflash) - abort (noflash) - assert (noflash) - stdatomic (noflash) + if LIBC_MISC_IN_IRAM = y: + if HEAP_PLACE_FUNCTION_INTO_FLASH = n: + heap (noflash) + abort (noflash) + assert (noflash) + stdatomic (noflash) if STDATOMIC_S32C1I_SPIRAM_WORKAROUND = y: stdatomic_s32c1i (noflash)