diff --git a/components/esp32/esp_adapter.c b/components/esp32/esp_adapter.c index af2e62c08..6c2267bc8 100644 --- a/components/esp32/esp_adapter.c +++ b/components/esp32/esp_adapter.c @@ -172,7 +172,7 @@ static void set_isr_wrapper(int32_t n, void *f, void *arg) static void * spin_lock_create_wrapper(void) { portMUX_TYPE tmp = portMUX_INITIALIZER_UNLOCKED; - void *mux = malloc(sizeof(portMUX_TYPE)); + void *mux = heap_caps_malloc(sizeof(portMUX_TYPE), MALLOC_CAP_8BIT|MALLOC_CAP_INTERNAL); if (mux) { memcpy(mux,&tmp,sizeof(portMUX_TYPE));