Failed to bluild Blink.ino with framework 2.0.7

Hello
I have error building example blink.ino when using framework 2.0.7

I added the last line of this bloc to the original example platform.ini:


[env:lolin32]
platform = espressif32
framework = arduino
board = lolin32
monitor_speed = 115200
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.7

Then pio run --environment lolin32

Here is my error:

Processing lolin32 (platform: espressif32; framework: arduino; board: lolin32)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/lolin32.html
PLATFORM: Espressif 32 (3.5.0) > WEMOS LOLIN32
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 @ 2.0.7+sha.213f976
 - tool-esptoolpy @ 1.30100.210531 (3.1.0)
 - toolchain-xtensa32 @ 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\lolin32\src\Blink.cpp.o
*** [.pio\build\lolin32\bootloader.bin] Source `C:\Users\Public\.platformio\packages\framework-arduinoespressif32@src-96eec79af29abe2be98fb05b0086faed\tools\sdk\esp32\bin\bootloader__40m.elf' not found, needed by target `.pio\build\lolin32\bootloader.bin'.
In file included from src/Blink.cpp:7:0:
C:/Users/Public/.platformio/packages/framework-arduinoespressif32@src-96eec79af29abe2be98fb05b0086faed/cores/esp32/Arduino.h:194:12: error: 'std::round' has not been declared
 using std::round;
            ^
cc1plus.exe: warning: unrecognized command line option '-Wno-frame-address'
*** [.pio\build\lolin32\src\Blink.cpp.o] Error 1
======================================================================================== [FAILED] Took 6.79 seconds ========================================================================================

Environment    Status    Duration
-------------  --------  ------------
lolin32        FAILED    00:00:06.792
================================================================================== 1 failed, 0 succeeded in 00:00:06.792 ==================================================================================

Other env build against 1.0.6 compile fine.

What do I miss ?

Same error with 2.0.6

Processing lolin32 (platform: espressif32; framework: arduino; board: lolin32)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/lolin32.html
PLATFORM: Espressif 32 (3.5.0) > WEMOS LOLIN32
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 @ 2.0.6+sha.b63f947
 - tool-esptoolpy @ 1.30100.210531 (3.1.0)
 - toolchain-xtensa32 @ 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\lolin32\src\Blink.cpp.o
*** [.pio\build\lolin32\bootloader.bin] Source `C:\Users\Public\.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32\bin\bootloader__40m.elf' not found, needed by target `.pio\build\lolin32\bootloader.bin'.
In file included from src/Blink.cpp:7:0:
C:/Users/Public/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:184:12: error: 'std::round' has not been declared
 using std::round;
            ^
cc1plus.exe: warning: unrecognized command line option '-Wno-frame-address'
*** [.pio\build\lolin32\src\Blink.cpp.o] Error 1
====================================================================== [FAILED] Took 7.76 seconds ======================================================================
Environment    Status    Duration
-------------  --------  ------------
lolin32        FAILED    00:00:07.759
================================================================ 1 failed, 0 succeeded in 00:00:07.759 ================================================================ 

Running Update target fix the problem :grinning:

esolving lolin32 dependencies...
Platform Manager: Updating espressif32 @ 3.5.0
Platform Manager: Removing espressif32 @ 3.5.0
Platform Manager: espressif32@3.5.0 has been removed!
Platform Manager: Installing platformio/espressif32 @ 6.0.1
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Platform Manager: espressif32@6.0.1 has been installed!
Tool Manager: Installing espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: toolchain-xtensa-esp32@8.4.0+2021r2-patch5 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.40400.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptoolpy@1.40400.0 has been installed!

Yeah that platform code was extremely old. Like Arduino-ESP32 1.0.6 levels.

Default VsCode install :upside_down_face:

The PlatformIO VSCode extension (the underlying PlatformIO core to be more precise) will, when the platform has not been previously downlaoded, download the latest available platform version at the moment you create a project for a board of that platform. It will then not auto-update it.

The only exception where you can get an older-than-latest version is when you open a VSCode project that specifically had platform=espressif32@3.5.0 in it, which then became the installed platform-espressif32 version.