Bare Metal, the ToDo List begins…


Bare metal, or coding directly to the hardware rather than using an OS, is the most interesting part of the whole RPi experience for me. With modern PC’s it’s very difficult to do this, due to the complexity of the hardware platforms, and the lack of documentation provided by the manufacturers of the hardware components of PC’s, and whilst the alternative Micro-Controller based systems (such as Arduino, BeagleBoard etc.) do provide excellent platforms for low level coding/experiments the cost/power ratio on them is not brilliant.

For example I purchased an Arduino Uno board to have a play with and it is a really good piece of kit, great connectivity, very easy to code for, and great support from the Arduino community. However this board cost me £24.99 from my local Maplin, and for this I’ve got a 16Mhz processor, 2KB Ram, 32Kb Flash RAM  and a 1KB EEPROM to play with.

Compare this to the Raspberry Pi I’ve ordered from RS, this has cost me £30.87 including delivery, and then I’ve added a 16GB SD card from scan for less than £10, and that means for just under £40 I’ve got a machine with a 700Mhz processor, 256KB RAM & 16GB storage, with a whole bucketload of extras (LAN, USB, GPU etc.) that would have to be provided by shields on the Arduino platform, and thus increasing the cost. I’ve had a look at  other small board computers, and microcontroller based systems, and nowhere else can I get the same bang for the buck as provided by the RPi.

The downside to this is the RPi community is in it’s infancy, especially when compared to the Arduino (for example), so a lot of the nice tools available for that type of platform just aren’t available (yet) for the RPi. So we’re going to have to do a lot more work for ourselves.

So I’ve started an initial list of things I’d like to do, or at least start doing :), with regards to low level programming on the RPi.

1 – Get a cross compiler (c/c++)  for bare metal stuff up and running on windows. Been looking at the free Sourcery CodeBench Lite setup and looks like the easiest one to setup so far.

2 – Implement UART functions for RPi. Using the datasheet provided by Broadcom for the  main CPU on the RPi, get the basic UART communication functions working in a simple c library.

3 – Get a UART bootloader (similar to this one by dwelch67) up and running, and get my PC connected to the RPi via a USB/UART converter. We have to use an external controller/board to do this, because the RPi needs 3.3v TTL inputs, rather than the usual PC standard RS232 voltages, so I’m going to use a Wixel Wireless/USB/UART controller to do this. A little more expensive than a MAX232, or a basic USB/UART breakout board, but the Wixel (or more accurately a pair of them) will give me the ability to do some more interesting things in the future.

4 – Once the Bootloader is up and running properly, and thus the need to keep swapping SD cards is gone, I can get started on a SDK framework for all the peripherals on the device. The aim of this SDK will be to provide a similar type of environment to those provided when working on devices such as the Arduino and Wixel.

Quite a list, but hopefully once the UART/bootloader stuff is done, I should be able to get some SDK stuff up and running pretty quickly.


No Responses Yet to “Bare Metal, the ToDo List begins…”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: