Error compiling ESP32 Arduino can't find pins_arduino.h:

I have been using platformio succesfully for over a year on ESP32 with the Arduino framework.

Today I upgraded to Espressif32 v6.6.0.

I now get an error can’t find pins_arduino.h

In file included from C:/Users/davidg/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:83,
from C:/Users/davidg/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:36,
from src/main.cpp:1:
C:/Users/davidg/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-gpio.h:29:10: fatal error: pins_arduino.h: No such file or directory

I get this error on a basic arduino framework in a new project.

I have tried removing the espressif folders in the .platformio as suggested on some post here. But I still get the error.

This is the basic project platformio.ini

platform = espressif32
board = esp32dev
framework = arduino

I am running platformio on Windows 10.

What happens if you use

platform = espressif32@6.5.0
board = esp32dev
framework = arduino


No change.

I tried installing an espressif version from 12 months ago, tried a clean and removing the arduino package folders, then allowing them to reinstall as per some of the posts here.

This is failing on a new project with the template arduino setup(0 and loop(). see attached.

Sounds like a broken framework!

Did you also delete the folders framework-arduinoespressif32 located in .platformio/packages/ ?

If not:

  • close VS Code
  • delete the folders
  • start VS Code
  • wait until PlatformIO has completed all tasks (reinstallation of the framework)

I did delete that folder. The dialogue sat there saying it had completed 100% but did not close.

I just repeated it and left it alone for a few minutes and it closed this time and it seems to have fixed it.

Thank you for your help.