EDIT: Cross-posted GitHub issue is live here.
I purchased one of the official ESP32-S2-DevKitM-1
boards from Espressif on Amazon and am trying to figure out how to get an example project built and uploaded to my board.
As far as I know, there is no exact match for my board in the PlatformIO board library, but I think that the ESP32-S2-Saola-1
is probably the closest target available. I started trying things on my own (trying to adapt this known-good project that I’ve used with my ESP-8266
NodeMCU 1.0
), only to realize I had no idea what I was doing and try to find an example project to start from. However, I haven’t found a combination of targets and projects that have built or uploaded successfully.
I was trying for a while to get the repo’s platform-espressif32/examples/espidf-arduino-wifiscan
example project to work, but I kept running into issues. The Build All
task seems to indicate that env:esp-wrover-kit
and env:esp32dev
both build correctly: But neither uploads because my part is the ESP32-S2
variant and not the regular ESP32
.
`esp32dev`
> Executing task: C:\Users\neilb\.platformio\penv\Scripts\platformio.exe run --target upload --environment esp32dev <
Processing esp32dev (board: esp32dev; platform: espressif32; framework: arduino, espidf)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.2.1) > Espressif ESP32 Dev Module
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)
PACKAGES:
- framework-arduinoespressif32 0.0.0+sha.d011dd7
- framework-espidf 3.40001.200521 (4.0.1)
- tool-cmake 3.16.4
- tool-esptoolpy 1.30000.201119 (3.0.0)
- tool-idf 1.0.1
- tool-mconf 1.4060000.20190628 (406.0.0)
- tool-mkspiffs 2.230.0 (2.30)
- tool-ninja 1.9.0
- toolchain-esp32ulp 1.22851.191205 (2.28.51)
- toolchain-xtensa32 2.80400.210211 (8.4.0)
Warning! Arduino framework as an ESP-IDF component doesn't handle the `variant` field! The default `esp32` variant will be used.
Reading CMake configuration...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 12.1% (used 39660 bytes from 327680 bytes)
Flash: [====== ] 64.0% (used 671254 bytes from 1048576 bytes)
Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM5
Uploading .pio\build\esp32dev\firmware.bin
esptool.py v3.0
Serial port COM5
Connecting....
A fatal error occurred: This chip is ESP32-S2 not ESP32. Wrong --chip argument?
*** [upload] Error 2
================================================================================================================ [FAILED] Took 16.34 seconds ================================================================================================================
Environment Status Duration
------------- -------- ------------
esp32dev FAILED 00:00:16.339
=========================================================================================================== 1 failed, 0 succeeded in 00:00:16.339 ===========================================================================================================
The terminal process "C:\Users\neilb\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload', '--environment', 'esp32dev'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
`esp32dev`
> Executing task: C:\Users\neilb\.platformio\penv\Scripts\platformio.exe run --target upload --environment esp-wrover-kit <
Processing esp-wrover-kit (board: esp-wrover-kit; platform: espressif32; framework: arduino, espidf)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp-wrover-kit.html
PLATFORM: Espressif 32 (3.2.1) > Espressif ESP-WROVER-KIT
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (ftdi) On-board (ftdi) 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 0.0.0+sha.d011dd7
- framework-espidf 3.40001.200521 (4.0.1)
- tool-cmake 3.16.4
- tool-esptoolpy 1.30000.201119 (3.0.0)
- tool-idf 1.0.1
- tool-mconf 1.4060000.20190628 (406.0.0)
- tool-mkspiffs 2.230.0 (2.30)
- tool-ninja 1.9.0
- toolchain-esp32ulp 1.22851.191205 (2.28.51)
- toolchain-xtensa32 2.80400.210211 (8.4.0)
Warning! Arduino framework as an ESP-IDF component doesn't handle the `variant` field! The default `esp32` variant will be used.
Reading CMake configuration...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\esp-wrover-kit\firmware.elf
Checking size .pio\build\esp-wrover-kit\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 12.1% (used 39660 bytes from 327680 bytes)
Flash: [====== ] 64.0% (used 671254 bytes from 1048576 bytes)
Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, ftdi, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM5
Uploading .pio\build\esp-wrover-kit\firmware.bin
esptool.py v3.0
Serial port COM5
Connecting....
A fatal error occurred: This chip is ESP32-S2 not ESP32. Wrong --chip argument?
*** [upload] Error 2
================================================================================================================ [FAILED] Took 15.12 seconds ================================================================================================================
Environment Status Duration
-------------- -------- ------------
esp-wrover-kit FAILED 00:00:15.118
=========================================================================================================== 1 failed, 0 succeeded in 00:00:15.118 ===========================================================================================================
The terminal process "C:\Users\neilb\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload', '--environment', 'esp-wrover-kit'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
But the ESP32-S2-Saola-1
target that I suspect is closest to what I actuall have doesn’t build either because it doesn’t support the arduino framework. Can someone please help me figure out how to use my dev board with the Arduino framework?