Friday 29 June 2012

Toolchain Adventures (pt 1)

I wanted to build a cross toolchain so I could more easily develop for my RPi on my normal development machine. I also fancy setting up a dist-cc compile farm, but my programs are certainly too small to benefit from this!

Although as a general rule I prefer Ubuntu, I have Fedora on my netbook. This may have made things more difficult to begin with, since the RPi wiki has simple-sounding instructions for installing the arm-unknown-linux-gnueabi toolchain on various distros, except Fedora. No panic, there was a similarly-named arm toolchain package, so I installed that and set about compiling and transferring my take on "hello, world". Unfortunately, when I tried to run it, all I got was "file not found". Hmm, something's not right.

Since the toolchain name didn't quite match what I wanted anyway I didn't bother apt-get installing gdb to investigate, rather I went to another tool that I'd seen mentioned: Sourcery CodeBench lite. This download ok (after being sent an incorrect link) and after installing I was a bit baffled how to build (or, more to the point, link) anything at all!

Maybe I should have spent more time trying to understand the documentation, but it sounded very low-level and it wasn't clear what the right selections were for the RPi.

Next up was crosstool-ng, a script that is meant to simplify building and configuring cross-toolchains. I'm sure I've used its predecessor, crosstool, before, so I downloaded and installed it. This time, however, I was using my wife's win2k3 machine (I'm sure she'd like me to point out that this also runs Ubuntu, but she's using some silly Windows-only application at the moment). This meant an error during the initial install, due to some cygwin incompatibility. Once that was resolved, I went through the menuconfig screens, taking defaults and random guesses until it was ready to build. It didn't take long for this to fail: during the initial sanity checks, it noticed that my filesystem was case-insensitive and that was that.

All was not lost, though. Crosstool-ng had given me a hint about what was needed for a cross-toolchain so I downloaded the source for the C libraries installed on the Raspberry Pi. Since this was a debian distro, this was just a case of:

apt-get source glibc

This had a friendly-looking readme file concerning cross compilation. With this I've had much more luck; I still haven't built my hello world program yet, but it's nearly there. I'll share my experiences with this in a subsequent post, so stay tuned!

Sunday 24 June 2012

Pi Tin

I've finally managed to take some pictures of the "case" I've made for my Pi.
It's just a plastic tub from Ikea which came in a set. I had two size options really: a smaller one which the board fit snugly in lengthways, and this larger one where the board was diagonally positioned. If I had chosen the smaller option, any plugs would protrude, and I would have had to get the holes in exactly the right places, so I went for the roomier option. This meant I could make one large hole for the data wires in one side and a smaller one in the opposite side for power.
The pictures aren't very good, I know, but it's on my network and I've got an SSH session on it, so I wasn't going to unplug it!


Sunday 17 June 2012

RPi Arrived, Obligatory Photos

Hi, so I've got my Raspberry Pi and I thought I'd start a blog, just like everyone else who's got one.  So for starters, here's the board.  I'm just fashioning a case for it, which I will post later.  The Pi currently has the debian6 release on it, but I downloaded the Arch Linux image too, for when I get a bit more comfortable with it.

My plans for the unit are... a bit undecided as yet; I've been trying to get to grips with Gtk before its arrival (I'm a Java dev by trade, so this was a little strange!) so I fancy getting a little GUI app on it.  Otherwise I'd like to do some client-server stuff, perhaps with an Android front-end.

I'm currently in the process of building a toolchain for my (Fedora) netbook to build stuff, and that was really the reason for starting this blog; if I get anywhere with that and get some useful results I'll post them and hopefully someone else will learn from it.

So here comes the first photo: the arrival of the Raspberry Pi: