Archive for the ‘Linux’ Category

I’ve been doing some Linux work again lately and so it back to bootloaders. Every time I work on a new product I have to do this so I thought I’d write up a post about it. Usually the vendors provide a working u-boot source tree but more often than not it’s pretty old and I’ve been playing around with putting together a multi architecture kernel so I’d like have device tree support in my bootloader. So here is the procedure. First get the sources and start a branch for your project:

git clone git://
git checkout -b project-name

If you’re going to be working on this for multiple projects I suggest starting a fork and the easiest way to do that is with Github. Then if you want to update your master branch to the latest from U-Boot all you need to do is add a git remote and merge the changes in.

git remote add upstream git://
git fetch upstream
git checkout master
git merge upstream/master

The name upstream is just a generic name, you could call in denx or uboot or whatever you want. Next you need to create the location for your sources and the way in which U-Boot does that is in the board folder. In this folder add a folder with your company name and then a folder with the name of the project you’re working on. ./board/acme/rocket The easiest way to start with this is to copy the sources from another board which uses the same processor. Your folder will now usually look as follows:

board -> acme -> rocket.c
|-> rocket.h
\-> Makefile

Next you need to add your configuration file and tell the build system about your new project. This is again easiest done by copying the configuration file of the board that is most similar to yours. The configuration files are located in ./include/configs/rocket.h Instructing the build system is done by editing the boards.cfg file in the root. This file is kept in alphabetical order so you should add it in the same manner. It’s form is:

Status, Arch, CPU:SPLCPU, SoC, Vendor, Board name, Target, Options, Maintainers
Active, arm, armv7, am33xx, acme, rocket, rocket, -,

You may also want to add an entry to ./arch/arm/include/asm/mach-types.h so that U-Boot can tell the Linux kernel that it’s your custom board that is booting and this should be in the form #define MACH_TYPE_ROCKET 9999 Just make sure it is a unique number. That is why I usually add it as a high number as new board are being added to the sources all the time. Now you can make your changes to your configuration and board sources and when you are ready to compile just run:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- rocket_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

There is obviously a lot more to this process and there are a fair few edits to these instructions that may need to be made for you system but it’s a good start. I hope this is helpful to someone and if you need a hand with something similar give me a shout. I’ll write another post about the kernel and device tree when I get a chance. It really is an amazing system!


Over the last week or so I have been playing around with getting Node.js up and running on my Raspberry Pi. I have found it to be a great learning experience and I’m pretty sure I will be using it for all of my embedded UI projects from now on. With the help of frame works like Express getting a static site up and running is really easy and makes communications really easy too. As I posted before I have been playing with these SRF modules to get some wireless comms going for home automation and I used python to get up and running fast. Afterwards I decided to use this as a opportunity to get in Node as I’ve wanted to try it out for a while but always need a project to apply myself to. This is still a long way off but have a look at the first working version¬† More as I carry on discovering!

Playing around with the TP-LINK TL-WR703N

Posted: September 18, 2012 in Linux
Tags: ,

If you haven’t heard of these little guys they’re great! Packing 400MHz ARM (Atheros AR7240), Ethernet connector, 802.11 b/g/n wlan, USB port, 4MB flash and 32MB RAM into a tiny little housing.

Router Pic

I recently bought one of these routers to play around with for setting up a wifi hotspot for all my devices whilst travelling. As my phone has a micro sim it is not that easy to just buy a sim wherever I am for some pay-as-you go internet. I ordered the device from China (read: e-bay) and it got here quickly enough. Unfortunately the firmware loaded on the router presented me with a web interface in Chinese, with no option to change it. I managed to find the firmware update page and flashed the OpenWrt firmware, which to be honest I would have done pretty quickly anyway. Now I have an open linux based router which is perfectly hackable and perfectly usable for ¬£15. Great! It works really nicely as a companion to a Nexus 7 or any other tab without 3G support and if you can’t tether using your phone for some reason. I haven’t done anything very exciting with it yet but its another great tool added to my toolbox.