Hi, I recently installed platformio-core using the get-platformio.py script on linux. I have been trying to build a project (empty void setup and loop) for an uno. However, the command ‘pio run’ has been giving this error:
sh: line 1: /home/alan/.platformio/packages/toolchain-atmelavr/bin/avr-g++: No such file or directory
*** [.pio/build/uno/src/main.cpp.o] Error 127
here is my platformio.ini file:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:uno]
platform = atmelavr
board = uno
framework = arduino
src/main.cpp:
#include <Arduino.h>
void setup()
{
}
void loop()
{
}
here’s the file structure:
.
|-- include
| `-- README
|-- lib
| `-- README
|-- platformio.ini
|-- src
| `-- main.cpp
`-- test
`-- README
the full error:
Processing uno (platform: atmelavr; board: uno; framework: arduino)
--------------------------------------------------------------------------------
Tool Manager: Installing platformio/tool-scons @ ~4.40502.0
Downloading [####################################] 100%
Unpacking [####################################] 100%
Tool Manager: tool-scons@4.40502.0 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR (4.2.0) > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
- framework-arduino-avr @ 5.1.0
- 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 5 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/uno/src/main.cpp.o
sh: line 1: /home/alan/.platformio/packages/toolchain-atmelavr/bin/avr-g++: No such file or directory
*** [.pio/build/uno/src/main.cpp.o] Error 127
========================== [FAILED] Took 6.33 seconds ==========================
I have reinstalled platformio core several times, and have deleted the ~/.platformio directory, but the error persists. If I look in the toolchain directory, avr-g++ is clearly in there:
~/.platformio/packages/toolchain-atmelavr/bin$ ls
avr-addr2line avr-elfedit avr-gcc-ranlib avr-ld avr-ranlib
avr-ar avr-g++ avr-gcov avr-ld.bfd avr-readelf
avr-as avr-gcc avr-gcov-dump avr-man avr-size
avr-c++ avr-gcc-7.3.0 avr-gcov-tool avr-nm avr-strings
avr-c++filt avr-gcc-ar avr-gdb avr-objcopy avr-strip
avr-cpp avr-gcc-nm avr-gprof avr-objdump
$pio system info:
-------------------------- --------------------------------------
PlatformIO Core 6.1.7
Python 3.10.7-final.0
System Type linux_x86_64
Platform Linux-6.0.10-gnu-x86_64-with-glibc2.35
File System Encoding utf-8
Locale Encoding UTF-8
PlatformIO Core Directory /home/alan/.platformio
PlatformIO Core Executable platformio
Python Executable /home/alan/.platformio/penv/bin/python
Global Libraries 0
Development Platforms 1
Tools & Toolchains 3
-------------------------- --------------------------------------
Does anyone have any idea how this could be fixed?