How to use std::string on esp32

apalazzi
Posts: 9
Joined: Sun Aug 17, 2025 6:28 pm

How to use std::string on esp32

Postby apalazzi » Sun Aug 17, 2025 6:44 pm

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

Sprite
Espressif staff
Espressif staff
Posts: 10599
Joined: Thu Nov 26, 2015 4:08 am

Re: How to use std::string on esp32

Postby Sprite » Mon Aug 18, 2025 1:58 am

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);

Who is online

Users browsing this forum: Qwantbot and 3 guests