Can't Allocate in Heap using MALLOC_CAP_RTCRAM
Posted: Sun Mar 31, 2024 1:15 pm
Hello.
I was looking to dynamically allocate a small amount of heap memory in RTC RAM using:
However, it's returning the nullptr. Additionally, this function is returning 0:
I'm testing this on an Adafruit ESP32 Feather V2.
So is the problem that the ESP32 Arduino Core (v2.0.14) does not allocate any available heap memory in RTC RAM by default? Can that be changed?
Thanks.
I was looking to dynamically allocate a small amount of heap memory in RTC RAM using:
Code: Select all
TheStruct *ptr = reinterpret_cast<TheStruct*>(heap_caps_malloc(sizeof(TheStruct), MALLOC_CAP_RTCRAM | MALLOC_CAP_8BIT));
Code: Select all
Serial.println(heap_caps_get_free_size(MALLOC_CAP_RTCRAM));
So is the problem that the ESP32 Arduino Core (v2.0.14) does not allocate any available heap memory in RTC RAM by default? Can that be changed?
Thanks.