-
Why std::this_thread::sleep_for() is broken on ESP32
by Steve NoonanA curious bug appearing after upgrading to IDF v5 led me into a deep dive of how
std::this_thread::sleep_for()
is implemented on the ESP32. I discuss how the IDF implementspthreads
andnewlib
to provide C++ threading functionality. The results are surprising: a simple 10 millisecond sleep was killing performance, but only in the new version of IDF due to an interaction betweenlibstdc++
andusleep()
. -
Measuring Stack Usage the Hard Way
This article is intended to shed some light on strategies for measuring stack memory usage on a small embedded system.