Skip to content

esp32c2: framework-arduinoespressif32 esp_sleep.h includes missing touch_sensor_legacy_types.h #2637

Closed

Description

@zackees

Symptom

Local bash compile esp32c2 --examples Remote (and likely other examples that include Arduino's esp32-hal-gpio.h) fails compiling the framework itself:

.fbuild/.../framework-arduinoespressif32/.../3.3.7/esp32-core-3.3.7/
  tools/esp32-arduino-libs/esp32c2/include/esp_hw_support/include/esp_sleep.h:12:10:
  fatal error: hal/touch_sensor_legacy_types.h: No such file or directory
   12 | #include "hal/touch_sensor_legacy_types.h"

Root cause

esp_sleep.h (Arduino-ESP32 v3.3.7's bundled IDF subset) includes hal/touch_sensor_legacy_types.h unconditionally. That header is shipped in the per-chip include sets for esp32, esp32c3, esp32c5, esp32c6, esp32h2 — verified locally:

find ~/.fbuild -path "*3.3.7*" -name "touch_sensor_legacy_types.h"
   .../tools/esp32-arduino-libs/esp32/include/hal/include/hal/...
   .../tools/esp32-arduino-libs/esp32c3/include/hal/include/hal/...
   .../tools/esp32-arduino-libs/esp32c5/include/hal/include/hal/...
   .../tools/esp32-arduino-libs/esp32c6/include/hal/include/hal/...
   .../tools/esp32-arduino-libs/esp32h2/include/hal/include/hal/...

But not in esp32c2/include/hal/... — that chip has no touch sensor peripheral and the SDK packaging excluded the header, but esp_sleep.h's include guard didn't get the matching #if SOC_TOUCH_SENSOR_SUPPORTED gate.

Result: any FastLED example that ends up including esp_sleep.h (transitively via esp32-hal-gpio.h → esp32-hal.h) breaks the framework compile on ESP32-C2.

Why CI doesn't hit this

Per run 26697900743 (the run that surfaced #2630), CI's framework cache compiled cleanly through to the link step. Locally the framework compile dies. This suggests one of:

  • CI is using a different ESP-IDF version (5.4 vs 5.x.y) bundled in framework-arduinoespressif32 3.3.7 that did include the C2 touch header.
  • CI is using a different framework version (maybe 3.3.8, which my local ~/.fbuild/dev/cache/... ALSO has).
  • The CI cache was populated before this packaging gap was introduced and isn't being regenerated.

Fix options

Option Where Notes
A. Wait for upstream Arduino-ESP32 3.3.8+ external The bundled IDF in newer releases may have the gate. find ~/.fbuild/dev shows my 3.3.8 install also has the c2 header missing — so this may persist.
B. Bump the FastLED-pinned framework-arduinoespressif32 to a version where the C2 SDK is complete boards.py / framework pin Requires identifying which Arduino-ESP32 release fixed it.
C. Vendor a tiny shim header into FastLED that defines empty hal/touch_sensor_legacy_types.h for C2 and add it to the include path before the framework's src/platforms/esp/32/c2_compat/ Hacky but unblocks local users immediately.

This is out of scope for #2630 (which is purely the FastLED-side GpioIsrRx::create link error). Filing here so we have a tracking link.

Reproduction

bash compile esp32c2 --examples Blink
# (or any example that ends up including esp32-hal-gpio.h)

Workaround

touch C:/Users/niteris/.fbuild/.../tools/esp32-arduino-libs/esp32c2/include/hal/include/hal/touch_sensor_legacy_types.h (create an empty file) — not validated but should at least get past the compile.

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions