Using older framework arduinoespressif8266 version causes compier error

I need to build 8266 code with arduino framework 2.7.4 and according to the docs at
https://docs.platformio.org/en/latest/platforms/espressif8266.html#using-arduino-framework-with-staging-version
I have aligned my platformio.ini accordingly:

[env:d1_mini_pro]
platform = espressif8266
board = d1_mini_pro
framework = arduino
platform_packages =
    platformio/framework-arduinoespressif8266 @https://github.com/esp8266/Arduino.git#2843a5a
    ; platformio/framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino/releases/download/2.7.4/esp8266-2.7.4.zip

Error reads (first few lines):

In file included from C:\Users\Inso.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:41,
from C:\Users\Inso.platformio\packages\framework-arduinoespressif8266\cores\esp8266\abi.cpp:22:
C:\Users\Inso.platformio\packages\framework-arduinoespressif8266\cores\esp8266/core_esp8266_version.h: In instantiation of ‘constexpr int conststr::parseNthInteger(const char (&)[N], unsigned int) [with unsigned int N = 6]’:
C:\Users\Inso.platformio\packages\framework-arduinoespressif8266\cores\esp8266/core_esp8266_version.h:130:37: required from here
C:\Users\Inso.platformio\packages\framework-arduinoespressif8266\cores\esp8266/core_esp8266_version.h:118:1: internal compiler error: in bot_manip, at cp/tree.c:3055
118 | }
| ^

My main is reduced to

void setup(void) {}

void loop(){}

to ensure the problem is not code or lib related.

I have seen that often in parallel to framework-arduinoespressif8266 also tool-esptoolpy is changed, but I cannot find the version to be used with 2.7.4.
Is it necessary at all?
Or is there something else I am missing?

With this you would tell PlatformIO to take the currently installed or latest espressif8266 version, which may or may not point at other needed packages, such as the compiler (or platform scripts). Specifically, you fail to account for the older compiler version that must be used.

I think it’s safer to just use the correct pinned platform version that was last using your wanted framework version (Arduino-ESP8266 2.7.4). Per releases, this would be espressif8266 @ 2.6.3.

[env:d1_mini_pro]
platform = espressif8266@2.6.3
board = d1_mini_pro
framework = arduino

Compiling with that works just fine. That btw uses

PACKAGES:
 - framework-arduinoespressif8266 @ 3.20704.0 (2.7.4) 
 - tool-esptool @ 1.413.0 (4.13)
 - tool-esptoolpy @ 1.30000.201119 (3.0.0)
 - toolchain-xtensa @ 2.40802.200502 (4.8.2)

You can also force the current latest version of the platform and fixup the framework and compiler packages, like

[env:d1_mini_pro]
platform = espressif8266@4.2.1
board = d1_mini_pro
framework = arduino
platform_packages =
    platformio/framework-arduinoespressif8266@~3.20704.0
    platformio/toolchain-xtensa@~2.40802.0

That makes it compile, too.

1 Like

Works, thank you very much! :smiley: