platformio / platform-atmelavr

Atmel AVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelavr
Apache License 2.0
139 stars 105 forks source link

platformio/toolchain-atmelavr remain at 1.70300.191015 despite latest release is 3.70300.220127 #288

Closed e-tinkers closed 2 years ago

e-tinkers commented 2 years ago

Configuration

Operating system: macOS 10.13.6

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.3

Description of problem

I'm trying to use PlatformIO for bare metal development for tinyAVR 2 Series (i.e. ATtiny824, ATtiny3227, etc.), and I get compilation error:

Processing ATtiny3227 (platform: atmelmegaavr; board: ATtiny3227)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelmegaavr/ATtiny3227.html
PLATFORM: Atmel megaAVR (1.6.0) > ATtiny3227
HARDWARE: ATTINY3227 16MHz, 3KB RAM, 32KB Flash
PACKAGES:
 - toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/ATtiny3227/src/main.o
avr-g++: error: device-specs/specs-attiny3227: No such file or directory
*** [.pio/build/ATtiny3227/src/main.o] Error 1
========================== [FAILED] Took 1.46 seconds ==========================

My platformio.ini configuration as:

[env:ATtiny3227]
platform = atmelmegaavr
board = ATtiny3227

A closer examination of the installed version of toolchain-atmelavr shown that it is at 1.70300.191015, which is 3 years old and before Microchip release the tinyAVR 2 series. There were two releases since 1.70300.191015 and the latest version 3.70300.200127 does support the tinyAVR 2 series.

So I delete the toolchain-atmelavr installed on the machine, and when re-run the compilation, it re-install the 1.70300.191015 again and therefore failed the compilation.

Processing ATtiny3227 (platform: atmelmegaavr; board: ATtiny3227)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelmegaavr/ATtiny3227.html
PLATFORM: Atmel megaAVR (1.6.0) > ATtiny3227
HARDWARE: ATTINY3227 16MHz, 3KB RAM, 32KB Flash
PACKAGES:
 - toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/ATtiny3227/src/main.o
avr-g++: error: device-specs/specs-attiny3227: No such file or directory
*** [.pio/build/ATtiny3227/src/main.o] Error 1
========================== [FAILED] Took 1.22 seconds ==========================

Even if I manually download the latest version, the system will still use the older version when compiling the code. It seems that despite that I have the latest PlatformIO Core installed, and the latest framework-atmelmegavr package installed (1.6.0), somehow the toolchain-atmelavr never get updated to the latest release.

I added platform_packages to force the PlatformIO to use the latest toolchain, and every thing works fine.

[env:ATtiny3227]
platform = atmelmegaavr
board = ATtiny3227
platform_packages =
  toolchain-atmelavr@3.70300.220127
Processing ATtiny3227 (platform: atmelmegaavr; board: ATtiny3227)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelmegaavr/ATtiny3227.html
PLATFORM: Atmel megaAVR (1.6.0) > ATtiny3227
HARDWARE: ATTINY3227 16MHz, 3KB RAM, 32KB Flash
PACKAGES:
 - toolchain-atmelavr @ 3.70300.220127 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/ATtiny3227/src/main.o
Linking .pio/build/ATtiny3227/firmware.elf
Checking size .pio/build/ATtiny3227/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.0% (used 0 bytes from 3072 bytes)
Flash: [          ]   0.7% (used 216 bytes from 32768 bytes)
Building .pio/build/ATtiny3227/firmware.hex
========================= [SUCCESS] Took 1.73 seconds =========================

I hope this can be fixed in the next release of PlatformIO.

valeros commented 2 years ago

It's expected as the 3.70300.220127 version is meant to be used with the atmelmegaavr dev-platform.