Posts Tagged ‘Linux’

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!

I was asked recently by our mechanical team at work to help them with a little project that involved building a pneumatic test rig to stress test our product. It was designed to do things like electrical stress tests like powering the device on and off a million times, mechanical tests like plugging and unplugging a USB cable and touching the touch screen. They had me a pneumatic.

The rig is powered by a raspberry pi with a PiFace for the relays and I/O. The interface is written in Node.JS with Angular for the frontend. It was a really great project (simple as it may be) and has been a great excuse to dive into node properly. It’s power continues to astound me and Angular’s bidirectional bindings really makes it easy to give powerful embedded projects a UI. It scales up really well to so you don’t have to worry about changing technologies later. The code is available on my github as usual.

I know this video is not very exciting but I think it’s cool. I’m also working on getting the low level SPI bindings working properly. More on that in a future post but node-gyp is incredible and node-ffi is so incredibly powerful for quick external library bindings.

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.