PlatformIO Community

Cannot get Arduino development off the ground - Error 1 [Solved]

Hi everybody,

let me start by saying that “Error 1” is probably the least helpful error message I encountered in the last couple of years, but nevertheless.

Trying to get Arduino development running with PIO on a Win10 machine. Everything is installed; the code is like your basic Arduino “Hello World”, just trying to make the onboard LED blink:

`#include <Arduino.h>

void setup() {
  // put your setup code here, to run once:
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LED_BUILTIN,HIGH);
  delay(500);
  digitalWrite(LED_BUILTIN,LOW);
  delay(500);
}`

When trying to compile, I get:

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/diecimilaatmega328.html
PLATFORM: Atmel AVR 2.0.0 > Arduino Duemilanove or Diecimila ATmega328
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash
PACKAGES: toolchain-atmelavr 1.50400.190710 (5.4.0), framework-arduino-avr 5.0.0
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 10 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\diecimilaatmega328\src\main.cpp.o
Archiving .pio\build\diecimilaatmega328\libFrameworkArduinoVariant.a
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Compiling .pio\build\diecimilaatmega328\FrameworkArduino\CDC.cpp.o
Compiling .pio\build\diecimilaatmega328\FrameworkArduino\HardwareSerial.cpp.o
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
*** [.pio\build\diecimilaatmega328\libFrameworkArduinoVariant.a] Error 1
*** [.pio\build\diecimilaatmega328\src\main.cpp.o] Error 1
*** [.pio\build\diecimilaatmega328\FrameworkArduino\CDC.cpp.o] Error 1
*** [.pio\build\diecimilaatmega328\FrameworkArduino\HardwareSerial.cpp.o] Error 1
=============================================================== [FAILED] Took 4.73 seconds ===============================================================

“Das System kann den angegebenen Pfad nicht finden” means: System cannot find path - but even after re-running the build command in verbose mode, I have no clue what the system is missing; all the files and directories are there.

PS C:\Users\Jan\Documents\PlatformIO\Projects\test> C:\Users\Jan\.platformio\penv\Scripts\platformio.exe run --verbose
Processing diecimilaatmega328 (platform: atmelavr; board: diecimilaatmega328; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------

CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/diecimilaatmega328.html
PLATFORM: Atmel AVR 2.0.0 > Arduino Duemilanove or Diecimila ATmega328
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash
PACKAGES: toolchain-atmelavr 1.50400.190710 (5.4.0), framework-arduino-avr 5.0.0
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 10 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
avr-g++ -o .pio\build\diecimilaatmega328\src\main.cpp.o -c -fno-exceptions -fno-threadsafe-statics -fpermissive -std=gnu++11 -Os -Wall -ffunction-sections 
-fdata-sections -flto -mmcu=atmega328p -DPLATFORMIO=40100 -DARDUINO_AVR_DUEMILANOVE -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO=10808 -Iinclude -Isrc -IC:\Das System kann den angegebenen Pfad nicht finden.
UserDas System kann den angegebenen Pfad nicht finden.
s\Jan\.platformio\packages\framework-arduino-avr\cores\arduino -IC:\UsDas System kann den angegebenen Pfad nicht finden.
ers\Jan\.platformio\packages\framework-arduino-avr\variants\standard src\main.cpp
avr-gcc-ar rc .pio\build\diecimilaatmega328\libFrameworkArduinoVariant.a
Das System kann den angegebenen Pfad nicht finden.
avr-g++ -o .pio\build\diecimilaatmega328\FrameworkArduino\CDC.cpp.o -c -fno-exceptions -fno-threadsafe-statics -fpermissive -std=gnu++11 -Os -Wall -ffunction-sections -fdata-sections -flto -mmcu=atmega328p -DPLATFORMIO=40100 -DARDUINO_AVR_DUEMILANOVE -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DAR*** [.pio\build\diecimilaatmega328\libFrameworkArduinoVariant.a] Error 1
DUINO=10808 -IC:\Users\Jan\.platformio\packages\framework-arduino-avr\cores\arduino -IC:*** [.pio\build\diecimilaatmega328\FrameworkArduino\CDC.cpp.o] Error 1
\Users\Jan\.platformio\packag*** [.pio\build\diecimilaatmega328\src\main.cpp.o] Error 1
es\*** [.pio\build\diecimilaatmega328\FrameworkArduino\HardwareSerial.cpp.o] Error 1
framework-arduino-avr\variants\standard C:\Users\Jan\.platformio\packages\framework-arduino-avr\cores\arduino\CDC.cpp
avr-g++ -o .pio\build\diecimilaatmega328\FrameworkArduino\HardwareSerial.cpp.o -c -fno-exceptions -fno-threadsafe-statics -fpermissive -std=gnu++11 -Os -Wall -ffunction-sections -fdata-sections -flto -mmcu=atmega328p -DPLATFORMIO=40100 -DARDUINO_AVR_DUEMILANOVE -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO=10808 -IC:\Users\Jan\.platformio\packages\framework-arduino-avr\cores\arduino -IC:\Users\Jan\.platformio\packages\framework-arduino-avr\variants\standard C:\Users\Jan\.platformio\packages\framework-arduino-avr\cores\arduino\HardwareSerial.cpp
=============================================================== [FAILED] Took 5.28 seconds =============================================================== 

Deleting PIO extension from VSC, erasing .platformio folder, and reinstalling brought no improvement - could anybody point me at what I am missing? Cheers!

Does the path C:\Users\Jan\.platformio\packages\toolchain-atmelavr exist? Do you see the compiler executable inside there in bin?

Can you open a commandline (cmd.exe) and execute

C:\Users\Jan\.platformio\packages\toolchain-atmelavr\bin\avr-g++ --version

what’s the output?

Max, thank you for helping. Toolchain looks OK though:

C:\Users\Jan>\Users\Jan.platformio\packages\toolchain-atmelavr\bin\avr-g++.exe --version
avr-g++.exe (AVR_8_bit_GNU_Toolchain_3.6.2_1759) 5.4.0
Copyright © 2015 Free Software Foundation, Inc.

Update: Skimming through further forum entries seems to have solved the problem - I scrubbed old, obsolete anaconda references from the PATH: environment variable, and erased a registry key autorunning some temp file, as described in this post:

https://www.tenforums.com/general-support/122582-cmd-terminal-starts-system-cannot-find-path-specified.html

The file is compiling now. Thank you for your help!

1 Like