Page 1 of 1

How to use std::string on esp32

Posted: Sun Aug 17, 2025 6:44 pm
by apalazzi
Hi,

I'm programming an esp32 board with C++/FreeRTOS and so far things are progressing; however there's one thing that seem to cause all sort of issues like stack corruption and guru meditations, and that is std::string.

I read that rising the stack size could maybe help. but how do I do that for the main task?

IS there something else that I should do to use std::String without crashing the application?

Andrea

Re: How to use std::string on esp32

Posted: Mon Aug 18, 2025 1:58 am
by Sprite
In ESP-IDF, you can set the main task size using menuconfig. In Arduino, I think you can use something like SET_LOOP_TASK_STACK_SIZE(16*1024);