Unable to use the whole memory in ESP32 with Arduino

Hi,

I have a problem in the amout of memory allocated in my esp32

Basically i want use the Whole potentiality of my esp32 in particular the whole memory about 400k. I chosed ESP32 for this reason. I've tried it on the Raspberry PI Pico W and it works well but i want change platform because esp is cheaper.

The problem is that when I'm calling a function that calls other functions it gives me the error "ERROR A stack overflow in task newloop has been detected."

I've investigated the reason and i putted in my program the follow code:

void newloop(void* param) {
//MY CODE
}

void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
xTaskCreateUniversal(newloop,"newloop", 32*1024, NULL, 1, NULL, ARDUINO_RUNNING_CORE);
vTaskDelete(NULL);
}

void loop() {}

But unsucessfully, the error stil appear.

I qant higllight that my code soes not user dynamic allocation and all variables and structures are allocated directly in the stack statically,

What i can do?

How much ram did you allocate for the stack (32*1024 ) and how much do you need ?

Do your large variables need to be on the stack ? (Recursive calls ?) use global ones where you can

Please, post your comlete skethch. Also, mention the IDE verson.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.