espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.46k stars 7.25k forks source link

ESP32-S2 stalls for 4.28ms every 2 secs (IDFGH-8608) #10055

Open dmitrykez opened 1 year ago

dmitrykez commented 1 year ago

Answers checklist.

General issue report

I have an issue with ESP32-S2-WROOM which stalls for 4.28ms every 2 seconds. I tries several modules (same P/N) and all of them behave similar.

To reproduce the problem I used a very simple code which constantly toggles GPIO in a main loop. void loop() { debug_gpio = !debug_gpio; digitalWrite(MY_GPIO, debug_gpio); }

The chip remains with a default setting as I don't configure anything on boot. Only SPIFFS is being configured, but it doesn't change the behavior.

Pause every 2 seconds: image

Pause length is 4.27ms: image

Anyone familiar with the phenomena?

PepeTheFroggie commented 6 months ago

No solution for this? This is VERY annoying if you try to fly a quadcopter with an esp32s2 ! Looptime of 2ms and every 2 seconds it makes a 5ms pause.

PepeTheFroggie commented 6 months ago

In the main Arduino loop, above loop() function, in the file cores/esp32/main.cpp we see yieldIfNecessary() function. It works on ESP32-S2 for example as it only has one core. Function adds a 5ms delay every two seconds. Under some specific circumstances, this causes problem with loop() execution time.

https://github.com/espressif/arduino-esp32/issues/6119