User Tools

Site Tools


Navigation Menu

Rustic Retreat

Live broadcasts and documentation from a remote tech outpost in rustic Portugal. Sharing off-grid life, the necessary research & development and the pursuit of life, without centralized infrastructure.

Rustic RetreatSubscribe to our new main project Rustic Retreat on the projects own website.

Hot Projects

SEEDStack

SEEDStack - Open 3D printable seed/sprouting systemDIY Food Hacking

UCSSPM

UCSSPM - Unified Clear-Sky Solar Prediction ModelOpen Solar Power

picoReflow

picoReflow - DIY PID Reflow Oven Controller based on RaspberryPiDIY Reflow Soldering

PiGI

PiGI - DIY Geiger Counter based on RaspberryPiRasPi Geiger Counter

DIY ARA-2000

Active Wideband Receiver Antenna for SDR - ARA-2000Wideband Antenna

DSpace

DSPace - Map everythingMap everything!

Mission-Tags

This is an old revision of the document!


Emerge gentoo crossdev avr-gcc for Arduino and Cura

In order to update the firmware of our 3D printer for dual head extrusion and to compile Cura (an alternative gcode slicer) a working crossdev toolchain was needed.

The printer firmware uses the Arduino toolkit so the dependency was obvious, the Cura build unfortunately needs a working avr-gcc as well (not that obvious), because it also ships with Ultimaker firmware, which cannot be disabled, even if you don't have an Ultimaker (kinda stupid).

Currently, the stable crossdev avr-gcc suite with gcc 4.8.3 did not compile so it was a bit of a hassle to get it running again. In order to save somebody else the time to figure this out, here's the install trace that was already tested verbatim on another gentoo amd64 box and worked as well.

Let's start with a clean slate and unmerge any cross-avr chain:

crossdev -C avr

This was used originally:

USE="multilib -cxx" crossdev -v -s1 --without-headers --target avr --gcc 4.5.2 --binutils 2.21 --libc 1.7.0
USE="multilib cxx" crossdev -v -s4 --target avr --gcc 4.5.2 --binutils 2.21 --libc 1.7.0

As of 2015-04-05 the above combination doesn't work anymore, please use this instead:

USE="multilib -cxx" crossdev -v -s1 --without-headers --target avr --gcc 4.5.4 --binutils 2.21.1-r1 --libc 1.7.0
USE="multilib cxx" crossdev -v -s4 --target avr --gcc 4.5.4 --binutils 2.21.1-r1 --libc 1.7.0

And to finish it up:

ln -nsf /usr/x86_64-pc-linux-gnu/avr/lib/ldscripts /usr/avr/lib/ldscripts
ln -nsf /usr/x86_64-pc-linux-gnu/avr/lib/ldscripts /usr/x86_64-pc-linux-gnu/avr/binutils-bin/2.20.1/ldscripts
cd /usr/avr/lib
ln -nsf avr5/crtm328p.o .
ln -nsf avr6/crtm2561.o .
ln -nsf avr6/crtm2560.o .
mkdir -p /usr/share/arduino/hardware/tools/avr/bin/
ln -s /usr/bin/avr-gcc /usr/share/arduino/hardware/tools/avr/bin/avr-gcc
ln -s /usr/bin/avr-g++ /usr/share/arduino/hardware/tools/avr/bin/avr-g++
ln -s /usr/bin/avr-objcopy /usr/share/arduino/hardware/tools/avr/bin/avr-objcopy
ln -s /usr/bin/avr-ar /usr/share/arduino/hardware/tools/avr/bin/avr-ar
ln -s /usr/bin/avr-as /usr/share/arduino/hardware/tools/avr/bin/avr-as