diff --git a/cpu/esp32/Kconfig b/cpu/esp32/Kconfig index 544e2dd412..6c46829271 100644 --- a/cpu/esp32/Kconfig +++ b/cpu/esp32/Kconfig @@ -22,6 +22,7 @@ config CPU_FAM_ESP32 select PACKAGE_ESP32_SDK if TEST_KCONFIG select MODULE_LIBC_GETTIMEOFDAY if TEST_KCONFIG + select MODULE_MALLOC_THREAD_SAFE if !MODULE_ESP_IDF_HEAP && TEST_KCONFIG select MODULE_RTT_RTC if HAS_PERIPH_RTT && MODULE_PERIPH_RTC select MODULE_PERIPH_RTT if HAS_PERIPH_RTT && MODULE_PM_LAYERED select MODULE_PS if MODULE_SHELL diff --git a/cpu/esp32/Makefile.dep b/cpu/esp32/Makefile.dep index bb96004bc3..af0523a277 100644 --- a/cpu/esp32/Makefile.dep +++ b/cpu/esp32/Makefile.dep @@ -40,16 +40,6 @@ ifneq (,$(filter esp_wifi_any,$(USEMODULE))) USEMODULE += pthread endif -ifneq (,$(filter esp_idf_heap,$(USEMODULE))) - # The ESP-IDF heap component uses the TLSF implementation that is part of - # the component. To avoid conflicts with modules and packages that use the - # RIOT package `tlsf`, this package is also used for the ESP-IDF heap instead - # of its own implementation. There does not seem to be any differences in - # the implementations of TLSF with the exception of heap poisoning, which - # is not configured. - USEPKG += tlsf -endif - ifneq (,$(filter esp_idf_nvs_flash,$(USEMODULE))) # add additional modules required by esp_idf_nvs_flash USEMODULE += pthread @@ -91,6 +81,18 @@ ifneq (,$(filter esp_spi_ram,$(USEMODULE))) USEMODULE += esp_idf_spi_ram endif +ifneq (,$(filter esp_idf_heap,$(USEMODULE))) + # The ESP-IDF heap component uses the TLSF implementation that is part of + # the component. To avoid conflicts with modules and packages that use the + # RIOT package `tlsf`, this package is also used for the ESP-IDF heap instead + # of its own implementation. There does not seem to be any differences in + # the implementations of TLSF with the exception of heap poisoning, which + # is not configured. + USEPKG += tlsf +else + USEMODULE += malloc_thread_safe +endif + ifneq (,$(filter mtd,$(USEMODULE))) USEMODULE += esp_idf_spi_flash endif