ElektorLabs / Arduino

Elektor's Arduino compatible boards, including Elektor Uno R4 with ATmega328PB
21 stars 10 forks source link

Installing UNO R4 with Board Manager breaks toolchain #7

Closed tr4nt0r closed 6 years ago

tr4nt0r commented 6 years ago

I installed the package for the UNO R4 and as soon as it gets installed I cannot compile anything, even though I'm compiling for another Platform.

I get the following error Message:
Compiling 'FuncGen' for 'Arduino Pro or Pro Mini w/ ATmega328P (3.3V, 8 MHz)'
avr-objcopy*: C:\Users\dem40095\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.21\crtatmega328pb.o: No such file
avr-objcopy*: C:\Users\dem40095\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.21\crtatmega328pb.o: No such file
ld.exe: cannot find crtatmega328p.o: No such file or directory

Error linking for board Arduino Pro or Pro Mini w/ ATmega328P (3.3V, 8 MHz)
Build failed for project 'FuncGen'

collect2.exe*: error: ld returned 1 exit status

I am using Visual Micro for Visual Studio, but in Arduino IDE I'm getting the same error:

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\dem40095\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\dem40095\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\dem40095\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010 -warnings=none -build-cache C:\Users\dem40095\AppData\Local\Temp\arduino_cache_222474 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.arduinoOTA.path=C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -verbose C:\Users\dem40095\AppData\Local\Temp\untitled1921920425.tmp\sketch_jul06a\sketch_jul06a.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\dem40095\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\dem40095\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\dem40095\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010 -warnings=none -build-cache C:\Users\dem40095\AppData\Local\Temp\arduino_cache_222474 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.arduinoOTA.path=C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -verbose C:\Users\dem40095\AppData\Local\Temp\untitled1921920425.tmp\sketch_jul06a\sketch_jul06a.ino
Using board 'uno' from platform in folder: C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21
Using core 'arduino' from platform in folder: C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21
Detecting libraries used...
"C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\sketch\sketch_jul06a.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\sketch\sketch_jul06a.ino.cpp" -o "C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\preproc\ctags_target_for_gcc_minus_e.cpp"
Sketch wird kompiliert...
"C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\sketch\sketch_jul06a.ino.cpp" -o "C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\sketch\sketch_jul06a.ino.cpp.o"
Compiling libraries...
Compiling core...
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\wiring_pulse.S.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\WInterrupts.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\hooks.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\wiring.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\wiring_analog.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\wiring_digital.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\wiring_pulse.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\wiring_shift.c.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\CDC.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\HardwareSerial.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\HardwareSerial0.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\HardwareSerial1.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\HardwareSerial2.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\HardwareSerial3.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\IPAddress.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\PluggableUSB.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\Print.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\Stream.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\Tone.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\USBCore.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\WMath.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\WString.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\abi.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\main.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\new.cpp.o
Zuvor kompilierte Datei wird verwendet: C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\core\core.a
Archiving built core (caching) in: C:\Users\dem40095\AppData\Local\Temp\arduino_cache_222474\core\core_arduino_avr_uno_609115b2174e4b865ba432eaaa73dc9e.a
Linking everything together...
"C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010/sketch_jul06a.ino.elf" "C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010\sketch\sketch_jul06a.ino.cpp.o" "C:\Users\dem40095\AppData\Local\Temp\arduino_build_858010/core\core.a" "-LC:\Users\dem40095\AppData\Local\Temp\arduino_build_858010" -lm
c:/users/dem40095/appdata/local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe: cannot find crtatmega328p.o: No such file or directory

collect2.exe: error: ld returned 1 exit status

exit status 1
Fehler beim Kompilieren für das Board Arduino/Genuino Uno.
tr4nt0r commented 6 years ago

I managed to fix this by moving some files and folders around so it seems the include paths are not set correctly. Also i get the error invalid library found in Arduino IDE Ungültige Bibliothek C:\Users\dem40095\Documents\Arduino\libraries\avr in C:\Users\dem40095\Documents\Arduino\libraries\avr gefunden

elektor-labs commented 6 years ago

A fresh Arduino 1.8.5 and the Elektor Uno R4 installed through Boards manager works perfectly fine for me. I can compile IDE-included examples for any board I like.

Your problem seems to be the file crtatmega328p.o that somehow has gone missing. There is a copy in packages\Elektor-Uno-R4-for-Arduino-1.8.x\hardware\avr\1.0.0\ that you can put in packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2\avr\lib\avr5\

Please note that the Elektor Uno R4 Boards package has not been tested with Visual Micro for Visual Studio.

P.S. You did use the latest version of the Boards package, right? https://github.com/ElektorLabs/Arduino/releases/download/v1.0.1/package_elektor_uno_r4_1_8_x_index.json

elektor-labs commented 6 years ago

If you keep having problems you might try with a double Arduino installation, one for the Elektor Uno R4 and the other for other boards. This is also possible with only one installation and two "portable" folders, ie "portable Uno R4" and "portable other" and renaming the folder you want to use to "portable".

tr4nt0r commented 6 years ago

I have tried with a fresh Arduino IDE installation, but still have errors. This time when flashing the bootloader, the placeholder {build.path} isn't replaced with the path:

Arduino: 1.8.5 (Windows 10), Board: "Elektor Uno R4 @ 16 MHz"

C:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino2/bin/avrdude -CC:\Users\dem40095\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino2/etc/avrdude.conf -l {build.path}/avrdude.log -v -patmega328p -F -cstk500v1 -PCOM9 -e -Ulock:w:0x3f:m -Uefuse:w:0x05:m -Uhfuse:w:0xde:m -Ulfuse:w:0xff:m 
Cannot create logfile "{build.path}/avrdude.log": No such file or directory
Fehler beim Brennen des Bootloaders.

But nevertheless I am at least able to compile my sketch, except for the Adafruit GFX Library, but I will open another issue for this.