SET_LOOP_TASK_STACK_SIZE(16 * 1024);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
Serial.printf("Arduino Stack was set to %d bytes", getArduinoLoopTaskStackSize());
// Print unused stack for the task that is running setup()
Serial.printf("\nSetup() - Free Stack Space: %d", uxTaskGetStackHighWaterMark(NULL));
}
void loop() {
// put your main code here, to run repeatedly:
// Print unused stack for the task that is running loop() - the same as for setup()
Serial.printf("\nLoop() - Free Stack Space: %d", uxTaskGetStackHighWaterMark(NULL));
delay(1000); // this speeds up the simulation
}