Esp32-s2-saola-1 --> Error: This board doesn't support arduino framework!

Good morning,

I’m new to this forum, my name is Fabio and I hope you can help me.

I have version V2.4.1 of PIO on VSCode. I have always used ESP32-DEVKIT1 and it has always worked.
Today I replaced the old esp32 with a saola 1 ESP32-S2
I updated the platformio.ini file like this:

[env:abiot-gateway-arduinoesp32]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
lib_deps =
   knolleary/PubSubClient@^2.8
   vshymanskyy/TinyGSM@^0.11.4
   plerup/EspSoftwareSerial@^6.13.2
   xreef/EByte LoRa E32 library@^1.5.2
   adafruit/RTClib@^1.14.1
   nickgammon/Regexp@^0.1.0
   bblanchon/ArduinoJson@^6.18.5
build_flags = -DCORE_DEBUG_LEVEL=5
upload_port = COM9
monitor_port = COM9

to this:

[env:abiot-gateway-arduinoesp32]
platform = espressif32
framework = arduino
board = esp32-s2-saola-1
lib_deps =
    knolleary/PubSubClient@^2.8
    vshymanskyy/TinyGSM@^0.11.4
    plerup/EspSoftwareSerial@^6.13.2
    xreef/EByte LoRa E32 library@^1.5.2
    adafruit/RTClib@^1.14.1
    nickgammon/Regexp@^0.1.0
    bblanchon/ArduinoJson@^6.18.5
upload_port = COM15
monitor_port = COM15

But I always get:

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s2-saola-1.html
PLATFORM: Espressif 32 (3.4.0) > Espressif ESP32-S2-Saola-1
HARDWARE: ESP32S2 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)
PACKAGES:
Error: This board doesn't support arduino framework!
 - framework-arduinoespressif32 3.10006.210326 (1.0.6)
 - tool-esptoolpy 1.30100.210531 (3.1.0)
 - toolchain-riscv-esp 1.80400.0 (8.4.0)
 - toolchain-xtensa32s2 1.80400.210211 (8.4.0)
======================================================================================================== [FAILED] Took 1.15 seconds ========================================================================================================
Il processo del terminale "C:\Users\Utente\.platformio\penv\Scripts\platformio.exe 'run'" è stato terminato. Codice di uscita: 1.

Terminale verrà riutilizzato dalle attività, premere un tasto qualsiasi per chiuderlo.

And I don’t know how to fix this.
Thank you

Correct. See Support for the latest Arduino v2.0 · Issue #619 · platformio/platform-espressif32 · GitHub.

I did not know of the existence of Arduino IDE v2

Do I need to download this on my Windows to use PIO on VSC?

It’s not about “Arduino IDE v2”, it’s about Arduino-ESP32 2.0.x core, which has support for the board you want. PlatformIO doesn’t yet ship it, so you need to modify your platformio.ini's platform = .. value to the one shown in the link above to get it.

I’m sorry but I didn’t understand much.
I have to download this and put in the folder .platformio\packages?

No, just replace your current platform= espressif32 value with the one shown in the link.


I feel stupid but now it doesn’t even build anymore. Look at the bottom right for the error message.

I clicked on the Build button several times and something did:

Also post the contents of the .platformio / packages folder for more help

You still have your old platform = espressif32 in there.

Please, just use this exact platformio.ini

[env:abiot-gateway-arduinoesp32]
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2idf/platform-espressif32-2.0.2.zip
framework = arduino
board = esp32-s2-saola-1
lib_deps =
    knolleary/PubSubClient@^2.8
    vshymanskyy/TinyGSM@^0.11.4
    plerup/EspSoftwareSerial@^6.13.2
    xreef/EByte LoRa E32 library@^1.5.2
    adafruit/RTClib@^1.14.1
    nickgammon/Regexp@^0.1.0
    bblanchon/ArduinoJson@^6.18.5
upload_port = COM15
monitor_port = COM15

As you save it (Ctrl+S), PlatformIO will refresh its task and download the platform, framework and compiler. This will take a while, depending on network and harddrive speed. You can use the task manager to see what it’s doing (network or disk access).

I copied and pasted your instructions into the platformio.ini file but when I saved it didn’t download anything.
I compiled and I got 1000 errors, then I tried to restart VCS and now if I try to compile it gives me the error at the bottom right “command ‘platformio-ide.build’ not found”

There are so many mistakes that you only copy a small part of them:

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s2-saola-1.html
PLATFORM: Espressif 32 (2.0.2) > Espressif ESP32-S2-Saola-1
HARDWARE: ESP32S2 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)
PACKAGES:
 - framework-arduinoespressif32 2.0.2
 - tool-esptoolpy 1.30200.211025 (3.2.0)
 - tool-mklittlefs 1.203.210628 (2.3)
 - toolchain-esp32s2ulp 1.22851.191205 (2.28.51)
 - toolchain-riscv32-esp 8.4.0+2021r2
 - toolchain-xtensa-esp32s2 8.4.0+2021r2
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 38 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <PubSubClient> 2.8.0
|-- <TinyGSM> 0.11.5
|-- <EspSoftwareSerial> 6.15.2
|-- <EByte LoRa E32 library> 1.5.2
|   |-- <EspSoftwareSerial> 6.15.2
|-- <RTClib> 1.14.1
|   |-- <Wire> 2.0.0
|-- <Regexp> 0.1.0
|-- <ArduinoJson> 6.18.5
|-- <WiFi> 2.0.0
Building in release mode
Compiling .pio\build\abiot-gateway-arduinoesp32\src\Scheduler.cpp.o
Compiling .pio\build\abiot-gateway-arduinoesp32\src\config.cpp.o
Compiling .pio\build\abiot-gateway-arduinoesp32\src\lora\CommunicationAbiot.cpp.o
Compiling .pio\build\abiot-gateway-arduinoesp32\src\main.cpp.o
Compiling .pio\build\abiot-gateway-arduinoesp32\src\util\utils.cpp.o
Generating partitions .pio\build\abiot-gateway-arduinoesp32\partitions.bin
Compiling .pio\build\abiot-gateway-arduinoesp32\lib76d\PubSubClient\PubSubClient.cpp.o
In file included from src/config.cpp:1:
src/config.h:14:13: error: 'vector' in namespace 'std' does not name a template type
 extern std::vector<int> NODES;
             ^~~~~~
src/config.h:14:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/config.h:2:1:
+#include <vector>
 #define REQUEST_DATA_INTERVAL 5 * 60 * 1000 // ogni tot min richiede dati
src/config.h:14:8:
 extern std::vector<int> NODES;
        ^~~
src/config.cpp:3:6: error: 'vector' in namespace 'std' does not name a template type
 std::vector<int> NODES{
      ^~~~~~
src/config.cpp:3:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
+#include <vector>

 std::vector<int> NODES{
 ^~~
Compiling .pio\build\abiot-gateway-arduinoesp32\lib91d\EspSoftwareSerial\SoftwareSerial.cpp.o
*** [.pio\build\abiot-gateway-arduinoesp32\src\config.cpp.o] Error 1
In file included from src/util/utils.cpp:1:
src/util/utils.h:9:30: error: 'vector' in namespace 'std' does not name a template type
 int searchIdxNode(const std::vector<int> &nodes, int search);
                              ^~~~~~
src/util/utils.h:9:25: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/util/utils.h:3:1:
+#include <vector>
 /**
src/util/utils.h:9:25:
 int searchIdxNode(const std::vector<int> &nodes, int search);
                         ^~~
src/util/utils.h:9:36: error: expected ',' or '...' before '<' token
 int searchIdxNode(const std::vector<int> &nodes, int search);
                                    ^
src/util/utils.cpp: In function 'bool regexMatch(char*, const String&)':
src/util/utils.cpp:46:21: warning: unknown escape sequence: '\-'
     String pieces = "^[0-9]+:D(:[\-]?[0-9]+)";
                     ^~~~~~~~~~~~~~~~~~~~~~~~~
src/util/utils.cpp:48:19: warning: unknown escape sequence: '\-'
         pieces += "(:[\-]?[0-9]+)";
                   ^~~~~~~~~~~~~~~~
src/util/utils.cpp: At global scope:
src/util/utils.cpp:65:30: error: 'vector' in namespace 'std' does not name a template type
 int searchIdxNode(const std::vector<int> &nodes, int search)
                              ^~~~~~
src/util/utils.cpp:65:25: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/util/utils.cpp:3:1:
+#include <vector>

src/util/utils.cpp:65:25:
 int searchIdxNode(const std::vector<int> &nodes, int search)
                         ^~~
src/util/utils.cpp:65:36: error: expected ',' or '...' before '<' token
 int searchIdxNode(const std::vector<int> &nodes, int search)
                                    ^
src/util/utils.cpp: In function 'int searchIdxNode(int)':
src/util/utils.cpp:67:25: error: 'nodes' was not declared in this scope
     for (int i = 0; i < nodes.size(); i++)
                         ^~~~~
src/util/utils.cpp:67:25: note: suggested alternative: 'note_t'
     for (int i = 0; i < nodes.size(); i++)
                         ^~~~~
                         note_t
src/util/utils.cpp:69:25: error: 'search' was not declared in this scope
         if (nodes[i] == search)
                         ^~~~~~
src/util/utils.cpp:69:25: note: suggested alternative:
In file included from c:\users\utente\.platformio\packages\toolchain-xtensa-esp32s2@8.4.0+2021r2\xtensa-esp32s2-elf\include\c++\8.4.0\algorithm:62,
                 from C:/Users/Utente/.platformio/packages/framework-arduinoespressif32@src-01b2ee0664276ec022da2783d94579c3/cores/esp32/Arduino.h:155,
                 from src/util/utils.h:1,
                 from src/util/utils.cpp:1:
c:\users\utente\.platformio\packages\toolchain-xtensa-esp32s2@8.4.0+2021r2\xtensa-esp32s2-elf\include\c++\8.4.0\bits\stl_algo.h:4177:5: note:   'std::search'
     search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
     ^~~~~~
*** [.pio\build\abiot-gateway-arduinoesp32\src\util\utils.cpp.o] Error 1
In file included from src/lora/CommunicationAbiot.cpp:3:
src/config.h:14:13: error: 'vector' in namespace 'std' does not name a template type
 extern std::vector<int> NODES;
             ^~~~~~
src/config.h:14:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/config.h:2:1:
+#include <vector>
 #define REQUEST_DATA_INTERVAL 5 * 60 * 1000 // ogni tot min richiede dati
src/config.h:14:8:
 extern std::vector<int> NODES;
        ^~~
In file included from src/main.cpp:2:
src/config.h:14:13: error: 'vector' in namespace 'std' does not name a template type
 extern std::vector<int> NODES;
             ^~~~~~
src/config.h:14:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/config.h:1:1:
+#include <vector>
 #include <Arduino.h>
src/config.h:14:8:
 extern std::vector<int> NODES;
        ^~~
In file included from src/main.cpp:6:
src/util/utils.h:9:30: error: 'vector' in namespace 'std' does not name a template type
 int searchIdxNode(const std::vector<int> &nodes, int search);
                              ^~~~~~
src/util/utils.h:9:25: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/util/utils.h:3:1:
+#include <vector>
 /**
src/util/utils.h:9:25:
 int searchIdxNode(const std::vector<int> &nodes, int search);
                         ^~~
src/util/utils.h:9:36: error: expected ',' or '...' before '<' token
 int searchIdxNode(const std::vector<int> &nodes, int search);
                                    ^
In file included from src/Scheduler.h:3,
                 from src/Scheduler.cpp:1:
src/config.h:14:13: error: 'vector' in namespace 'std' does not name a template type
 extern std::vector<int> NODES;
             ^~~~~~
src/config.h:14:8: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/config.h:1:1:
+#include <vector>
 #include <Arduino.h>
src/config.h:14:8:
 extern std::vector<int> NODES;
        ^~~
In file included from src/Scheduler.h:4,
                 from src/Scheduler.cpp:1:
src/lora/CommunicationAbiot.h:31:40: error: 'vector' in namespace 'std' does not name a template type
     void requestDataToNodes(const std::vector<int> &toNodes);
                                        ^~~~~~
src/lora/CommunicationAbiot.h:31:35: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/lora/CommunicationAbiot.h:3:1:
+#include <vector>

src/lora/CommunicationAbiot.h:31:35:
     void requestDataToNodes(const std::vector<int> &toNodes);
                                   ^~~
src/lora/CommunicationAbiot.h:31:46: error: expected ',' or '...' before '<' token
     void requestDataToNodes(const std::vector<int> &toNodes);
                                              ^
src/lora/CommunicationAbiot.h:32:40: error: 'vector' in namespace 'std' does not name a template type
     void requestOpenToNodes(const std::vector<int> &toNodes);
                                        ^~~~~~
src/lora/CommunicationAbiot.h:32:35: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
     void requestOpenToNodes(const std::vector<int> &toNodes);
                                   ^~~
src/lora/CommunicationAbiot.h:32:46: error: expected ',' or '...' before '<' token
     void requestOpenToNodes(const std::vector<int> &toNodes);
                                              ^
src/lora/CommunicationAbiot.h:33:41: error: 'vector' in namespace 'std' does not name a template type
     void requestCloseToNodes(const std::vector<int> &toNodes);
                                         ^~~~~~
src/lora/CommunicationAbiot.h:33:36: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
     void requestCloseToNodes(const std::vector<int> &toNodes);
                                    ^~~
src/lora/CommunicationAbiot.h:33:47: error: expected ',' or '...' before '<' token
     void requestCloseToNodes(const std::vector<int> &toNodes);
                                               ^
In file included from src/Scheduler.cpp:1:
src/Scheduler.h:8:9: error: 'vector' does not name a type; did you mean 'wctob'?
 typedef vector<pair<int, pair<uint32_t, uint32_t>>> Schedule;
         ^~~~~~
         wctob
src/Scheduler.h:14:5: error: 'Schedule' does not name a type; did you mean 'Scheduler'?
     Schedule schedule;
     ^~~~~~~~
     Scheduler
In file included from src/Scheduler.cpp:2:
src/util/utils.h:9:30: error: 'vector' in namespace 'std' does not name a template type
 int searchIdxNode(const std::vector<int> &nodes, int search);
                              ^~~~~~
src/util/utils.h:9:25: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/util/utils.h:1:1:
+#include <vector>
 #include <Arduino.h>
src/util/utils.h:9:25:
 int searchIdxNode(const std::vector<int> &nodes, int search);
                         ^~~
src/util/utils.h:9:36: error: expected ',' or '...' before '<' token
 int searchIdxNode(const std::vector<int> &nodes, int search);
                                    ^
src/Scheduler.cpp: In member function 'void Scheduler::clock(CommunicationAbiot&)':
src/Scheduler.cpp:72:10: error: 'vector' is not a member of 'std'
     std::vector<int> nodesToOpen, nodesToClose;
          ^~~~~~
src/Scheduler.cpp:72:10: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/Scheduler.cpp:3:1:
+#include <vector>
 #include <ArduinoJson.h>
src/Scheduler.cpp:72:10:
     std::vector<int> nodesToOpen, nodesToClose;
          ^~~~~~

This is correct now, your project is using Arduino-ESP32 2.0.2 witht he 8.4.0 GCC XTensa toolchain.

It looks to me as if that upgrade of toolchain or Arduino broke your code which worked on the previous 1.0.6 Arduino-ESP32.

Did you #include <vector> properly in your code before using the std::vector type? It suggests you to do that right there…

Oh my god you solved a lot of errors !!!
Now there are only 2 left:

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s2-saola-1.html
PLATFORM: Espressif 32 (2.0.2) > Espressif ESP32-S2-Saola-1
HARDWARE: ESP32S2 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)
PACKAGES:
 - framework-arduinoespressif32 2.0.2
 - tool-esptoolpy 1.30200.211025 (3.2.0)
 - tool-mklittlefs 1.203.210628 (2.3)
 - toolchain-esp32s2ulp 1.22851.191205 (2.28.51)
 - toolchain-riscv32-esp 8.4.0+2021r2 
 - toolchain-xtensa-esp32s2 8.4.0+2021r2
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 38 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <PubSubClient> 2.8.0
|-- <TinyGSM> 0.11.5
|-- <EspSoftwareSerial> 6.15.2
|-- <EByte LoRa E32 library> 1.5.2
|   |-- <EspSoftwareSerial> 6.15.2
|-- <RTClib> 1.14.1
|   |-- <Wire> 2.0.0
|-- <Regexp> 0.1.0
|-- <ArduinoJson> 6.18.5
|-- <WiFi> 2.0.0
Building in release mode
Compiling .pio\build\abiot-gateway-arduinoesp32\src\util\utils.cpp.o
Compiling .pio\build\abiot-gateway-arduinoesp32\lib76d\PubSubClient\PubSubClient.cpp.o
Compiling .pio\build\abiot-gateway-arduinoesp32\lib91d\EspSoftwareSerial\SoftwareSerial.cpp.o
Compiling .pio\build\abiot-gateway-arduinoesp32\libc07\EByte LoRa E32 library\LoRa_E32.cpp.o
In file included from src/util/utils.cpp:1:
src/util/utils.h:9:30: error: 'vector' in namespace 'std' does not name a template type
 int searchIdxNode(const std::vector<int> &nodes, int search);
                              ^~~~~~
src/util/utils.h:9:25: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
src/util/utils.h:3:1:
+#include <vector>
 /**
src/util/utils.h:9:25:
 int searchIdxNode(const std::vector<int> &nodes, int search);
                         ^~~
src/util/utils.h:9:36: error: expected ',' or '...' before '<' token
 int searchIdxNode(const std::vector<int> &nodes, int search);
                                    ^
src/util/utils.cpp: In function 'bool regexMatch(char*, const String&)':
src/util/utils.cpp:47:21: warning: unknown escape sequence: '\-'
     String pieces = "^[0-9]+:D(:[\-]?[0-9]+)";
                     ^~~~~~~~~~~~~~~~~~~~~~~~~
src/util/utils.cpp:49:19: warning: unknown escape sequence: '\-'
         pieces += "(:[\-]?[0-9]+)";
                   ^~~~~~~~~~~~~~~~
Compiling .pio\build\abiot-gateway-arduinoesp32\lib52b\Wire\Wire.cpp.o
Compiling .pio\build\abiot-gateway-arduinoesp32\libfaf\RTClib\RTClib.cpp.o
Compiling .pio\build\abiot-gateway-arduinoesp32\lib580\Regexp\Regexp.cpp.o
Compiling .pio\build\abiot-gateway-arduinoesp32\libcdd\WiFi\WiFi.cpp.o
*** [.pio\build\abiot-gateway-arduinoesp32\src\util\utils.cpp.o] Error 1
======================================================================================================== [FAILED] Took 14.25 seconds ========================================================================================================Il processo del terminale "C:\Users\Utente\.platformio\penv\Scripts\platformio.exe 'run'" è stato terminato. Codice di uscita: 1.

Terminale verrà riutilizzato dalle attività, premere un tasto qualsiasi per chiuderlo.

This is missing the subtype? A std::vector<someType> should be there, not just std::vector.

And it also is missing #include <vector>.

Oh my god it works!
It seems like a miracle, I’ve been on this problem since this morning!
All because I changed ESP to add an external ethernet chip …
Tomorrow I will work on my real initial problem which is interfacing the w5500 chip.
Thanks for your very helpful help!

No problem. Just curious, why change the ESP32 to ESP32-S2 when only a W5500 is added? This ethernet chip communicates via SPI, which the original ESP32 can also do just fine. It’s not like the interface is RMII or something.

I had all the pins used as digitalInput or Output also those of SPI, and I want to have the jtag as well.