ESP32-Arduino - platformio support for 2.0.0 version

Hi guys, on the 17’ April, espressif released 2.0.0 beta preview version of the arduino-esp32 core. i’m trying to make it work on platformio, but i’m unable to get it work.

Using arduino and installing the 2.0.0 beta release i’m able to get it working, but in platformio i can’t find anything on the web/forum in order to get it started.

How i can make it work?

In the topic Possible to use C++17 - #10 by kooscode it is shown how to use a specific branch of Arduino-ESP32 and another compiler version, using the documented platform_packages directive.

The same can be applied here. Using a platformio.ini of

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
platform_packages =
   toolchain-xtensa32 @ ~2.80400.0
   framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#2.0.0-alpha1

compilation works.

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.2.0) > 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.5d9b98c
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa32 2.80400.210114 (8.4.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
...
RAM:   [          ]   3.8% (used 12368 bytes from 327680 bytes)
Flash: [==        ]  16.5% (used 216604 bytes from 1310720 bytes)
Building .pio\build\esp32dev\firmware.bin
esptool.py v3.0
=========================== [SUCCESS] Took 11.37 seconds ===========================

Also refer to the available toolchain versions per here and see arduino-esp32 tags and branches.

Note that 2.0.0-alpha1 was updated last at April 17th, the master branch is more advanced. However, replacing #2.0.0-alpha1 with #master in the platformio.ini to switch to the master branch resulted in a

A fatal error occurred: Segment loaded at 0x3f400120 lands in same 64KB flash mapping as segment loaded at 0x3f400020. Can’t generate binary. Suggest changing linker script or ELF to merge sections.

error for me, so maybe a more updated toolchain is needed or some other fix, didn’t look further into it. As soon as a new stable version is released however, PlatformIO devs will update to it as normal.

2 Likes

Update esptool.py to version 3.1
Add to your config

platform_packages = platformio/tool-esptoolpy @ ~1.30100
1 Like