Installing eLua on the AVR32 CPUs from Atmel

AVR32 is a family of high performance 32-bit CPUs from Atmel. They were built as direct competitors for the various ARM core implementation of the market, and offer very good performance (91 MIPS @ 66MHz) and power efficieny (1.3mW/MHz). Atmel claims that their AVR32 core outperforms ARMv5 (in ARM and Thumb mode) in terms of both performance and code size. It's a proprietary architecture (so it's only implemented by Atmel), yet it has a very good support package, and an open source toolchain based on GCC, which made it an ideal candidate for the first non-ARM (and also the first big endian) eLua target. Atmel also sells a number of development boards based on their AVR23 CPUs. The one used for eLua is the ATEVK1100 board, built around the AT32UC3A0512 AVR32 MCU (512k internal Flash/64k internal ARM). It's a very powerful board, featuring (among other things) an external 32 MByte SDRAM memory, which is more than enough to run any eLua program I can think of :).

Prerequisites

Before you'll be able to use eLua on the AT32UC3A0512 CPU, make sure that:

Installing FLIP in Ubuntu Linux

Follow the steps below to install FLIP under Linux:

  1. download the Linux version of FLIP from the Atmel FLIP page. Save it (or move it later) to your /usr/local/ directory (you need to have superuser privileges to do that). At the moment of writing this tutorial, the latest FLIP version is 3.2.1, so this is what we're going to use here.
  2. untar the FLIP archive:
    $ cd /usr/local
    $ sudo tar xvzf flip_linux_3-2-1.tgz
    This will create the /usr/local/flip.3.2.1 directory.
  3. you need to install OpenJDK if it is not installed:
    $ sudo apt-get install openjdk-6-jre
  4. edit /usr/local/flip.3.2.1/bin/batchisp3.sh and add the two bolded lines before at the beginning of the file:
    #!/bin/bash -f
    
    export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/jre/
    export FLIP_HOME=/usr/local/flip.3.2.1/bin/
    
    if [ "$FLIP_HOME" = "" ]; then
  5. you need to edit a binary file this time (/usr/local/flip.3.2.1/libatlibusbdfu.so). This happens because FLIP comes compiled for RedHat by default, and Ubuntu some different system paths. See this topic for full details. All you have to do is change all the /sys/bus/usb strings inside libatlibusbdfu.so to /dev/bus/usb.
  6. add the FLIP directory to your PATH:
    $ export PATH=/usr/local/flip.3.2.1/bin:$PATH
  7. FLIP interferes with a program that comes pre-installed on Ubuntu system, called brltty. It's meant to help the visually impaired, so if you're not one of them, simply remove it (as it seems to interfere with a lot of other USB devices too):
    $ sudo apt-get remove brltty

Burning eLua to the EVK1100 board

After you installed FLIP and added it to your $PATH, burning the eLua image should be quite easy:

That's all, your eLua image is (finally) installed on your ATEVK1100 board.