ESPDUINO32 build problem - pins_arduino.h: No such file or directory

I’m using VSCode on Ubuntu 20.04.5. Sanity check LED-blink project for Arduino Leonardo builds and runs fine. I started playing with DOIT ESPDUINO32 board. The new project as generated by IDE fails to build with this output:

> Executing task: platformio run <

Processing esp32doit-espduino (platform: espressif32; board: esp32doit-espduino; framework: arduino)
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Espressif 32 (3.4.0) > DOIT ESPduino32
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
 - framework-arduinoespressif32 3.10006.210326 (1.0.6) 
 - tool-esptoolpy 1.30100.210531 (3.1.0) 
 - toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 28 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/esp32doit-espduino/src/main.cpp.o
Compiling .pio/build/esp32doit-espduino/FrameworkArduino/Esp.cpp.o
Compiling .pio/build/esp32doit-espduino/FrameworkArduino/FunctionalInterrupt.cpp.o
In file included from src/main.cpp:1:0:
/home/paul/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:185:26: fatal error: pins_arduino.h: No such file or directory

Do I need to install a dependency? Provided link: PlatformIO Registry doesn’t offer a clear choice. What is the solution?

Delete the folders /home/paul/.platformio/packages/framework-arduinoespressif32/ and /home/paul/.platformio/.cache and retry. If the Arduino framework can’t find an internal file the package is likely corrupted.

1 Like

Thank you. I did it, and I’m getting the same error again. This is on a fresh install of PlatformIO. The only other projects I tried before is blink with Arduino Leonardo and camera example with ESP32-CAM from GitHub - espressif/arduino-esp32: Arduino core for the ESP32, which compiled, but didn’t upload.

Okay, you have discovered a bug in Arduino-ESP32 made by the Espressif people.

This board file is declaring

and thus should be using the doitESPduino32 folder in arduino-esp32/variants at 1.0.6 · espressif/arduino-esp32 · GitHub. However, as you can see in here, the file is named pins_Arduino.h. The code is looking for

This one. This only works on Windows where the filesystem is case-insensitive, but not on Linux or Mac.

This bug still exists until today in the latest master version (arduino-esp32/variants/doitESPduino32 at master · espressif/arduino-esp32 · GitHub).

Please manually fix the problem by going into your /home/paul/.platformio/packages/framework-arduinoespressif32/variants/doitESPduino32 and renaming the existing file to pins_arduino.h.

1 Like

This is now tracked in Can't compile for doitESPduino32 on Linux and Mac · Issue #6152 · espressif/arduino-esp32 · GitHub.

1 Like

That was it! Thanks a lot.