Skip to content

fix(esp32): 2.x-layout frameworks get none of PlatformIO's CPPDEFINES (ESP_PLATFORM missing; FastLED fails on [email protected]) #1549

Closed

Description

@zackees

What

With the arduino-esp32 2.x SDK layout (tools/sdk/<mcu>/ with no flags/ directory), for example [email protected] / framework 3.20017.241212+sha.dcc1105b, which is also the benchmark's pinned stack, Esp32Framework::get_sdk_defines (crates/fbuild-library/src/library/esp32_framework/sdk_paths.rs) reads only flags/defines and returns nothing.

Include dirs already have a fallback for this layout (parse_pio_cpppath, which reads the CPPPATH block of tools/platformio-build-<mcu>.py). Defines have no equivalent, so every compile misses the CPPDEFINES that PlatformIO passes from that same script:

HAVE_CONFIG_H  MBEDTLS_CONFIG_FILE="mbedtls/esp_config.h"  UNITY_INCLUDE_CONFIG_H  WITH_POSIX
_GNU_SOURCE  IDF_VER="v4.4.7-dirty"  ESP_PLATFORM  _POSIX_READER_WRITER_LOCKS
ARDUINO=10812 (fbuild passes 10808)  ARDUINO_PARTITION_<name>

Impact

  • FastLED does not compile. src/platforms/esp/32/isr_esp32_idf4.hpp calls taskENTER_CRITICAL(&mux), and FreeRTOS task.h only defines the 1-argument form #ifdef ESP_PLATFORM. The result is macro "taskENTER_CRITICAL" passed 1 arguments, but takes just 0.
  • Any code that keys on ESP_PLATFORM, _GNU_SOURCE or IDF_VER silently compiles differently from PlatformIO. That includes the benchmark, which reports stack_status: matched.

Fix

Mirror parse_pio_cpppath: when flags/defines is absent, parse the CPPDEFINES block of platformio-build-<mcu>.py. Take the literal entries, plain names and ("NAME", 'value') tuples, and skip entries that depend on env. or $BOARD_*, which fbuild already derives from the board.

Found while investigating #1537.

Activity

  1. added a commit that references this issue on Sep 28, 2026
    3169dbc
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