ESP-IDF
Espressif's official development framework for ESP32 chips (FreeRTOS-based, CMake, menuconfig).
framework
also known as Espressif IoT Development Framework, IDF
Knowledge about ESP-IDF
- ESP32 FreeRTOS task crashes: 'Stack canary watchpoint triggered' and tasks that returnwarning · unverified · Two classic crashes when using xTaskCreate on ESP32: a task stack that is too small (Stack canary watchpoint triggered) and a task function that simply returns. Size stacks generously and end tasks with vTaskDelete(NULL).
- ESP32 OTA updates that can't brick the device: partitions, validation and rollbackprocedure · unverified · OTA needs two app partitions (ota_0, ota_1) plus otadata. With app rollback enabled, a new image boots as pending-verify and must call esp_ota_mark_app_valid_cancel_rollback() after a self-test, otherwise the bootloader reverts to the previous image.
- ESP32 Wi-Fi reconnect: handle disconnect events instead of hopingprocedure · unverified · The ESP-IDF Wi-Fi driver does not reconnect by itself; the application must call esp_wifi_connect() on WIFI_EVENT_STA_DISCONNECTED. In Arduino, use WiFi.setAutoReconnect() and WiFi.onEvent(), keeping callbacks thread-safe.
- ESP32 analogRead() is non-linear: use analogReadMilliVolts() and the right attenuationwarning · unverified · Raw ESP32 ADC counts don't map linearly to voltage and the reference voltage varies between chips. Espressif confirmed the non-linear ADC front end; use the calibrated analogReadMilliVolts() (ESP-IDF: ADC calibration) and stay inside the attenuation's input range.
- ESP32 as Bluetooth proxy for Home Assistant: setup, connection slots and placementguide · unverified · An ESPHome bluetooth_proxy extends Home Assistant's BLE range. Use ESP-IDF (less memory), prefer Ethernet boards, keep the proxy free of heavy components, and don't raise active connection slots beyond what ESPHome recommends.
- ESP32 task watchdog triggered: your loop never yieldswarning · unverified · The Task Watchdog Timer watches the idle tasks by default. A loop that spins without yielding (busy-waiting on a peripheral, long blocking computation) starves the idle task and triggers it.
- ESP32: Arduino core vs ESP-IDF vs PlatformIO, and when to use whichcomparison · unverified · The Arduino core is the fastest start, ESP-IDF gives full control through menuconfig, and PlatformIO is tooling that can build either. Arduino can also run as an ESP-IDF component to get both.
- ESPHome basics: YAML becomes firmware, native API or MQTT, and an encryption keyguide · unverified · ESPHome compiles a YAML configuration into firmware. Devices talk to Home Assistant through the encrypted native API (recommended) or through MQTT. On ESP32, ESP-IDF is the default framework and the only one for C6, H2 and other newer chips.
- Logging sensor data often on ESP32: buffer in RTC RAM, write flash in batchesrecommendation · unverified · Writing every reading to flash wears it out and costs energy. Keep readings in RTC slow memory across deep sleep, flush them in batches, use NVS only for rarely changing settings, and leave headroom in SPIFFS.
- Store ESP32 settings with Preferences (NVS): limits and a safe patterncode · unverified · Preferences stores key-value data in the NVS flash partition and survives restarts and power loss. Namespaces and keys are limited to 15 characters, and NVS is meant for many small values, not large data.
Related
- alternative to (from): Arduino core for ESP32 – Arduino APIs are quicker to start with; ESP-IDF exposes every configuration option. Arduino can also run as an ESP-IDF component.