Architecture or board not supported with ESP32 and SD Library


I’ve just migrated a project from Arduino IDE 2.x to platformio and have been going nuts over some error messages.
I’m quite new to platformio and not a pure developer (I prototype stuff to get my customers to a working idea and have the “industrial” version then developed by expert devs).

The project builds and runs perfectly in the Arduino IDE.
But building it in platformio I get the error " Architecture or board not supported".

I’ve update everything to the latest version, check that the standard Arduino SD-library is being used, etc.

But apparently I’m still missing something. Any help or pointers would be greatly appreciated.
Hardware is a TTGO T-SIM7070G module, I’m using the SD-card to store data/logs.

Here’s the (partial) output.

Successfully created esp32 image.
Compiling .pio/build/esp32dev/lib6b4/SD/File.cpp.o
Compiling .pio/build/esp32dev/lib6b4/SD/SD.cpp.o
Compiling .pio/build/esp32dev/lib6b4/SD/utility/Sd2Card.cpp.o
Compiling .pio/build/esp32dev/lib6b4/SD/utility/SdFile.cpp.o
Compiling .pio/build/esp32dev/lib6b4/SD/utility/SdVolume.cpp.o
In file included from /Users/xyz/Documents/Arduino/libraries/SD/src/utility/Sd2Card.h:26,

  •             from /Users/xyz//Documents/Arduino/libraries/SD/src/utility/SdFat.h:29,*
  •             from /Users/xyz/Documents/Arduino/libraries/SD/src/utility/SdFile.cpp:20:*

/Users/xyz/Documents/Arduino/libraries/SD/src/utility/Sd2PinMap.h:524:2: error: #error Architecture or board not supported.

  • #error Architecture or board not supported.*

Did you add #include <Arduino.h> to your main.cpp?

What’s the content of your platformio.ini?

Thanks for the quick response ! Arduino has indeed been included. Here’s what my platformio.ini looks like.
platform = espressif32
board = esp32dev
framework = arduino
lib_extra_dirs = ~/Documents/Arduino/libraries
lib_deps = SD
lib_ignore = AzureIoTHubMQTTClient //=> this one also has an SD.h file which caused trouble earlier

Did you try without these two lines?

The Espressif’s esp32 arduino core has a builtin SD library!

I run into trouble then with TinyGSMClient and PubSubClient which are not found.

Get rid of the idea of using global libraries.

Only specify the libraries you need for your project in the lib_deps, e.g. :

lib_deps =

Hi Sivar,

seems like I’m finally making some progress … a B I G thank you for helping me. Learned a couple of things on how PIO is different from Arduino!