Build and deploy Yocto Linux on the Beaglebone Black

This post will show you how to build and deploy the Yocto Linux distribution on the Beaglebone Black. Since the latest Yocto 1.6 “daisy” release, there is an official board support package for the Beaglebone. Therefore, the build process will be pretty straight-forward.


On an Ubuntu 12.04, you will need at least the following packages

~$ sudo apt-get install chrpath gawk diffstat texinfo g++

Download the latest Yocto release branch “daisy”

~$ mkdir yocto
~$ cd yocto
~/yocto$ git clone -b daisy git://

Continue reading “Build and deploy Yocto Linux on the Beaglebone Black”

Cross compiling Android’s adb and fastboot for embedded Linux (e.g. Yocto/OpenEmbedded)

The tools adb and fastboot are essential for debugging, managing and customizing Android devices. Both adb and fastboot are available for download within the ADT Bundle, however, those prebuilt binaries are for common host platforms (x86 and x86_64). What if you would like to run adb on a different architecture, such as ARM? There are of course multiple ways to get this done. Here we will show you how to cross compile adb and fastboot outside of the Android source tree using a standalone Makefile.

For this tutorial you will need

  • A cross compilation toolchain
    We will be using the official yocto project toolchain
  • Source files for adb and fastboot
    These will be in the platform/system/core and platform/system/extras repository from the official Android sources
  • Source files of three “external” projects
    Namely zlib, openssl and libselinux, which are also available from the official Android sources

Continue reading “Cross compiling Android’s adb and fastboot for embedded Linux (e.g. Yocto/OpenEmbedded)”

Turn your (Linux-) Desktop / Arduino Yún / Raspberry Pi into an USB Android Accessory: How to use the Android Accessory Protocol with pyusb


It has been a while since the post where we explained how to Turn your Linux computer into a huge Android USB Accessory. In the former post, the process of creating a C-application to communicate with your Android device has been discussed. Today, we would like to pick up on the same topic, this time however showing how communication can be established with the “pyusb” library using Python.

Since devices like the Arduino Yún or the Raspberry Pi offer a fully implemented USB stack (based on the Linux Kernel and libusb) it becomes increasingly interesting to use Python for this task.

Continue reading “Turn your (Linux-) Desktop / Arduino Yún / Raspberry Pi into an USB Android Accessory: How to use the Android Accessory Protocol with pyusb”

Programming the Arduino with Eclipse on Linux

This is the first of a series of three posts. The ultimate goal is to setup a communication interface between an Arduino Uno/Mega board and an Android tablet over USB. Everything will be as user-friendly as possible, i.e. no root will be required on your Android tablet. The following posts Arduino USB transfers and Android USB Host + Arduino: How to communicate without rooting your Android Tablet or Phone conclude the series.

The Arduino Uno is a popular and affordable hardware platform which comes with its own IDE and core libraries for programming. If you like the Arduino IDE you may skip this post, however, if you feel more comfortable developing in Eclipse this might help you out.
We are using Ubuntu 11.10 (oneiric ocelot) and Eclipse 3.6.1 (helios), although this should not play an important role (as it turns out, Eclipse Indigo might need a few tweaks, check the end of this post). Also, setting up Eclipse for programming the Arduino Uno Atmega328P is pretty straightforward. Nevertheless, here is a quick how-to for the Arduino Uno (Arduino Mega 2560 below):

  1. Install avrdude and AVR libraries:
    sudo apt-get install gcc-avr avr-libc avrdude
  2. Start Eclipse and install CDT Plugin (C/C++ Development Tools):
    • Help -> Install New Software…
    • Work with: (your current Eclipse version)
      i.e. “Helios –”
    • Download the “pending” software package (don’t worry, download starts automatically 😉 )
    • Choose “Programming Languages” and select “C/C++ Development Tools”
    • Accept and continue by restarting Eclipse
  3. Install AVR Eclipse Plugin:
    • Help -> Install New Software…
    • Add new repository:
    • Re-download the “pending” software package, download will be faster since it is probably cached 😀
    • Download AVR Eclipse Plugin and restart Eclipse
  4. Create new C project named “BlinkBlink”:
    • Project Type AVR Cross Target Application (Empty Project, AVR-GCC Toolchain)
    • Click next…
    • Untick “Debug” (in Debug mode, no hex-files are generated and avrdude can’t flash the device)
    • Click Advanced settings…
    • AVR -> AVRDude -> Programmer configuration…
    • Create a new programmer and name it “Arduino Uno”. Make sure this newly created programmer configuration is selected for the current project.
      • Programmer Hardware: Arduino
      • Override default port: /dev/ttyACM0 or similar
      • Override default baudrate: 115200
    • AVR -> Target Hardware:
      • MCU Type: ATmega328P (or load from MCU)
      • MCU Clock Frequency: 16000000 (default external clock source of Arduino Uno)
  5. Click Apply and OK to leave the properties window and click Finish to create the new project in the workspace.
  6. Create a new source file main.c and copy the contents from this link. Make sure to save main.c before proceeding (File -> Save).
  7. Project -> Build Project
  8. Click on the AVR Button within Eclipse to upload the generated hex file from BlinkBlink/Release/BlinkBlink.hex.
    Your Arduino Uno’s LED should be blinking on and off repeatedly. If somehow it doesn’t work, right-click your Project and select Properties. Make sure all AVR and Programmer settings are active as mentioned above.

For the Arduino Mega 2560 you should choose Atmel STK500 Version 2.x firmware as Programmer Hardware, and ATMega2560 as target hardware, the rest is the same as with the Arduino Uno. Also, if you are using the above source file for testing, you should change the definition of LED from PB5 to PB7, since the LED on the Arduino Mega is on Pin7 of Port B.

Update: if you are using Eclipse Indigo, some specific AVR symbols such as DDRB (data direction register of port b) may not be recognized.
To solve this problem go to preferences…

  • C/C++
  • Language Mappings
  • Add the following mappings:
    • Content Type: C Header File / Language: GNU C
    • Content Type: C Source File / Language: GNU C
  • Make sure to click on Apply afterwards… also you may need to restart eclipse after adding the mappings

Your Language Mapping preference window should look like the following screenshot:

If it still does not work, also try adding this line at the beginning of your main.c source file:
#include <avr/iom128.h>