User Tools

Site Tools


Install arduino on Sabayon

Install arduino:

 # equo install arduino
 # equo install rxtx

Add yourself to groups:

 # gpasswd -a YOUR_USERNAME tty
 # gpasswd -a YOUR_USERNAME uucp

Crossdev for AVR Architecture

Install crossdev:

 # equo install crossdev

First build without headers:

 # USE="-cxx" crossdev -s1 --without-headers --target avr --ov-output /usr/local/portage

if you get an error

please convert /etc/portage/package.keywords to a directory

you can do a nice workaround:

# mv /etc/portage/package.keywords /etc/portage/package.keywords.copy
# mkdir -p /etc/portage/package.keywords
# mv /etc/portage/package.keywords.copy /etc/portage/package.keywords/
# mv /etc/portage/package.mask /etc/portage/package.mask.copy
# mkdir -p /etc/portage/package.mask
# mv /etc/portage/package.mask.copy /etc/portage/package.mask/

if worked, do the rest:

 # USE="cxx" crossdev -s4 --target avr --ov-output /usr/local/portage

You also need workaround so that the linking works like expected:

 # ln -s /usr/x86_64-pc-linux-gnu/avr/lib/ldscripts /usr/avr/lib/ldscripts
 # ln -s /usr/avr/lib/avr5/crtm328p.o /usr/avr/lib/crtm328p.o

LeoStick workaround

  1. Get missing crtm32u4.o file:, unzip and copy it to /usr/avr/lib/
  2. Inside the sketchbook directory you have chosen, create a new directory called “hardware”.
  3. Unpack Board Profile.
  4. Move the “LeoStick” directory into the “hardware” directory you created a moment ago. You should end up with a structure like “sketchbook/hardware/LeoStick”.

Now we're ready to do the initial board and port setup. You won't need to do this again unless the serial port identifier changes such as when using a different USB port on your computer.

If you still have problems, please read this page:

Deprecate print funtion problem

In case you get errors like this, when you want to compile your project:

 ~/Documents/Arduino/hardware/LeoStick/cores/arduino/Print.cpp: In member function ‘size_t Print::print(const __FlashStringHelper*)’:
 ~/Documents/Arduino/hardware/LeoStick/cores/arduino/Print.cpp:44:9: error: ‘prog_char’ does not name a type
 ~/Documents/Arduino/hardware/LeoStick/cores/arduino/Print.cpp:47:23: error: ‘p’ was not declared in this scope

It appears that Print.ccp is using depricated typedef. avr-libc v1.8.0 and up have deprecated the “prog_char” type def and now its recommended to use of “char PROGMEM”.

So lets fix that…

 $ vi ~/Documents/Arduino/hardware/LeoStick/cores/arduino/Print.cpp

On line 42 you will find the offending section:

 size_t Print::print(const __FlashStringHelper *ifsh)
  const prog_char *p = (const prog_char *)ifsh;
  size_t n = 0;
  while (1) {
  unsigned char c = pgm_read_byte(p++);
  if (c == 0) break;
  n += write(c);
  return n;

Lets replace that section with one that supports new versions of avr-libc:

 size_t Print::print(const __FlashStringHelper *ifsh)
  const char PROGMEM *p = (const char PROGMEM *)ifsh;
  size_t n = 0;
  while (1) {
  unsigned char c = pgm_read_byte(p++);
  if (c == 0) break;
  n += write(c);
  return n;

This simple trick should render your LeoStick fully operational.

Arduino Projects

arduino/start.txt · Last modified: 2014/06/28 02:49 (external edit)