[ESP32-S3][Arduino] Build fails with "fatal error: sdkconfig.h: No such file or directory" on PlatformIO

Description

When building an ESP32-S3 project with Arduino framework in PlatformIO, the compilation fails with multiple errors:
fatal error: sdkconfig.h: No such file or directory
The error appears in several places inside framework-arduinoespressif32, including:

  • WiFi.h
  • newlib headers (sys/lock.h)
  • FS, SPI, SPIFFS related sources
    As a result, the project cannot be built successfully.

Environment

  • OS: Windows
  • PlatformIO Core: 6.1.18
  • PlatformIO IDE: VSCode
  • Python: 3.14.2
  • Board: esp32-s3-devkitc1-n16r8
  • Framework: arduino
  • Platform:
    https://gitee.com/cyfney/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip
  • Toolchain / esptool:
    • esptool.py v4.8.9 (from build log)

platformio.ini

[env:esp32s3_r8n16_idf]
platform = https://gitee.com/cyfney/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip

board = esp32-s3-devkitc1-n16r8
framework = arduino

monitor_speed = 115200
upload_speed = 921600
monitor_filters = esp32_exception_decoder

board_build.f_cpu = 240000000L
board_build.flash_mode = qio
board_build.f_flash = 80000000L
board_build.filesystem = littlefs
board_build.partitions = partitions.csv
board_build.arduino.memory_type = opi_qspi

build_flags =
    -D CORE_DEBUG_LEVEL=0
    -D ARDUINO_RUNNING_CORE=1
    -D ARDUINO_EVENT_RUNNING_CORE=1
    -D ARDUINO_USB_MODE=1
    -D ARDUINO_ESP32S3_DEV

lib_deps =
    bodmer/TFT_eSPI@^2.5.43
    bitbank2/AnimatedGIF@^2.2.0

Steps to Reproduce

  1. Create a new PlatformIO project for ESP32-S3
  2. Use the above platformio.ini
  3. Include Arduino headers such as:
    #include <WiFi.h>
  4. Run:
    pio run

Actual Behavior

The build fails during compilation with multiple errors similar to:

In file included from src/main.cpp:1:
.../framework-arduinoespressif32/libraries/WiFi/src/WiFi.h:25:10:
fatal error: sdkconfig.h: No such file or directory
 #include "sdkconfig.h"
          ^~~~~~~~~~~~~
compilation terminated.

The same error also occurs in multiple other compilation units, for example:

.../framework-arduinoespressif32-libs/esp32s3/include/newlib/platform_include/sys/lock.h:9:10:
fatal error: sdkconfig.h: No such file or directory

Additionally, this warning appears during the build:

WARNING: Partition has name 'littlefs' which is a partition subtype,
but this partition has non-matching type 0x1 and subtype 0x82.
Mistake in partition table?

Expected Behavior

The project should compile successfully using Arduino framework on ESP32-S3.

Analysis / Suspected Cause

From the error pattern, it looks like sdkconfig.h is not available in the include path during compilation.

Since this header is referenced by:

  • Arduino WiFi library
  • newlib headers in framework-arduinoespressif32-libs
  • FS / SPI / SPIFFS

this may indicate:

  • a version mismatch between platform-espressif32, framework-arduinoespressif32, and framework-arduinoespressif32-libs, or
    an issue in the custom platform-espressif32 package where sdkconfig.h is not generated or not exposed to the compiler.

Note:

  • The environment name contains _idf, but framework = arduino is used. It is unclear if this could cause Arduino/IDF include path conflicts.
  • The partition table warning may be a separate issue, but it is unlikely to explain the missing sdkconfig.h.

Questions

  1. For ESP32-S3 + Arduino framework in PlatformIO, where is sdkconfig.h expected to come from (pre-generated vs generated during build)?
  2. Is platform-espressif32 54.03.20 known to be incompatible with current framework-arduinoespressif32(-libs) packages?
  3. Is it recommended to switch back to the official:
    platform = espressif32
    or to pin a specific known-good platform/framework version for ESP32-S3?