Sunday, March 23, 2014

#1: Beaglebone Black (BBB) with Fedora Linux

I bought a Beaglebone Black open embedded processor board about 6 months ago and it has been lying on the dining room table ever since.  Now that the missus went on a holiday to Poland and Slovakia, I finally got around to firing it up to see if it works.

Where to get it

The BBB project is here:

In the mean time, the Fedora project has released an ARM distribution that includes rudimentary support for the BBB:

First of all, to see if the hardware is OK, I just connected a USB cable to it and started it up with the default Linux version residing on the device and it worked fine.  After installing a USB network driver on my Mac and restarting it, I could SSH to address and poke around in Angstrom Linux.

Unfortunately, Angstrom Linux is not well supported - the project is very small with maybe just one or two not very active developers.

Anyhoo, the little board booted up fine, lights flashing merrily and I even got the ethernet port to work with SSH after a few minutes of futzing around with it and then I got the inevitable 'success depression': It works, now what do I do with it?  I cannot use Angstrom, since it is just too limited: No NFS, no SMB, no whatever I could think of.  What can I do with it?

Fedora to the Rescue

When dealing with these little boards, there is always the danger that one can do an update and render the board unbootable.  Therefore, I prefer leaving the original Angstrom system intact and experimenting with the micro SD card instead.

The Fedora project page states:
Support for the BeagleBone Black has been added in Fedora 20. The GA release includes basic support which will be extended to include HDMI and USB with the release of the 3.12 kernel. A remix is planned when support is available. In the interim, the minimal image is recommended. 

So there is hopeLet's get it and try it.  I was out of luck on my Mac, since I don't have zcat on it, so I switched to an older Linux machine with KDE and quickly got everything:
$ cd
$ mkdir BBB
$ cd BBB

Micro SD

Hmm, now I needed a small SD card and Carrefour had a special with two cards in one package - a small 8GB plus a 32GB.  So 30 minutes later and a few Dirhams poorer - well, nothing is free and few things are cheap - I stuck the SD card into the laptop and copied the image to the base of the SD device:
$ dmesg
$ ls /dev mmcb*
/dev/mmcblk0 /dev/mmcblk0p1

If you see multiple partitions, then this is probably a used SD card, so it may be best to zap it first:
$ su -
# dd if=/dev/zero of=/dev/mmcblk0
and go and get some coffee, or a non-alcoholic beer...

On a Mac, you first have to install xz from here:

Xz, xzcat and the rest of the zoo will install itself into /usr/local/bin by default.

Now you can write the image:
$ xzcat Fedora-Minimal-VFAT-armhfp-20-1-sda.raw.xz > /dev/mmcblk0
(or $ /usr/local/bin/xzcat ... on a Mac)

Popping the SD card out and sticking it back in again, caused an automount in /media with two visible directories called "__" and "uboot".

According to the Fedora page a few little mods are required:
$ cd /media
$ cp __/usr/share/uboot-beaglebone/* uboot/ 
$ cp uboot/uEnv.txt.beaglebone uboot/uEnv.txt
$ nano uboot/uEnv.txt 
abcboard=am335x-bone > abcboard=am335x-boneblack 

Now, we are in business!

Boot Her Up

Stick the little card into the BBB, insert the USB cable to power it and watch the lights.  When the flashing stops after a couple minutes, Fedora is running, but now I need a serial cable to be able to connect to it...

Rummaging through my radio control junk box, I found a Sparkfun 3.3V FTDI USB serial cable, which is exactly what is needed.

So, unplug the USB power cable, install the serial cable (Black wire at the little dot), plug in both USBs and run screen:
$ screen /dev/ttyUSB0 115200

La voila! 

Fedora on the BBB works and after a few minutes it gets a menu where one can configure the root password, configure a user account and set the time zone.

So, now what can I do with it?

No comments:

Post a Comment

On topic comments are welcome. Junk will be deleted.