A long overdue update

Has it really been 5 years since I last posted an update? Shame on me…

A lot has changed in those 5 years, a breakup with the girlfriend, moved out of my parents house, got a new job in an exciting international company, bought a motorcycle and some electric guitars and started taking guitar lessons, but I haven’t been able to continue on those old electronics projects.

I’ll be blowing more life into this blog with a new and exciting project I’ve started on: building and programming my own quadcopter. And I’ll be adding more personal and increasingly cynical views on the world here too.

You will hear from me again soon!

USB experimentation board – part 2

I finaly figured out how to compile and run the library and gui program for the Velleman k8055 board on Ubuntu Linux.

First I downloaded this: libk8055.
But this library contains an error in the header file, it is missing a line, so edit the k8055h file and add the following line:
int ReadAllValues(long int *data1, long int * data2, long int * data3, long int * data4, long int * data5);

To compile and install the library type in the following commands in the command prompt:
make
sudo make install

Next: I downloaded the gui program: k8055gui.
This requires a couple of libraries to be installed on your system first:
sudo apt-get install libwxbase2.8-0 libwxbase2.8-dev libwxgtk2.8-0 libwxgtk2.8-dev libusb-dev

This program also contains an error, to fix this you need to edit the MyFrame.cpp file, and replace (a small remark, thanks to Vincent in the comments below: mind the double quotes!):
#include <k8055.h>

with
extern “C” {
#include <k8055.h>
}

To compile, type in the command window:
make

To start the gui program:
sudo ./k8055gui

I’ll try to find a way so you don’t need to be root to execute the gui program.

USB experimentation board – part 1

VK8055I bought and assembled this Velleman K8055 kit (quite) a while ago. It’s an USB experiment board. Under windows it all works quite nicely; but under Linux I have been unable to compile the demo program.

The demo program consists of two parts: a library called libk8055 and the Linux clone of the Velleman demo interface.

Compiling the library was pretty straightforward, and the accompanying command line tool worked too.  Compiling the demo interface program did not work, at first because I was missing wxWidget libraries, secondly because there was a function not documented in the header file of the library, and thridly because the linker can’t find or read the library file.  I haven’t found a solution for that last problem just yet.  I tried adjusting the installation script to install the files in the default ubuntu locations, but this didn’t solve it.  I tried messing with compile options, I tried static linking, dynamic linking, a whole set of compile options, but it just wouldn’t link…

I’ll try again later, when I find the courage to dive deeper into the sources.  I’ll also try to get the bugfixes upstream once I finalise them.

Velleman VK8048 PIC programmer kit

Velleman PIC programmer
I bought a Velleman PIC pogrammer kit a few weeks ago, assembled it right away, and programmed one of the examples from the CD on it, and left it gathering dust for a while.

Apparently there is no free and uncrippled C compiler for the PIC16 series microcontrollers, except maybe for the SDCC compiler, although I’m not sure whether support for the PIC16 is finished and working already.

There are other compilers for this controller by Microchip, IAR, Hi-Tech and CSS but either they require a paid license or have a severely reduced free compiler.

For now the assembler will have to do, and so I’m working my way through the 170 page manual, but it doesn’t seems to be too complicated. I’m hoping I can use this board as a test stage for that POV display, and as a programmer for the PIC controllers.

GNU ARM compiler

gnuarm.comIt looks like I don’t need to make my own ARM cross compiler afterall, thanks to gnuarm.com. Now I can either try to compile a bootloader and a Linux kernel for the development board, I can go for a smaller “embedded” solution, or I can try to code everything myself (I could, but I won’t).

To install the environment and not have it interfere with my running Linux installation I plan to use chroot. Chroot will change the root of the running program (for example the shell you have opened) so that it appears that it’s working in a completely isolated environment, leaving the files of the mother OS untouched. However it is not true virtualisation like VMWare or Xen, and although it is often referred to as a chroot jail it is not meant to be a safe environment. There are ways to break out of that jail and still access the files from the higher operating system. But I’m pretty confident that the ARM compiler won’t do anything like that. 🙂 For everything to work I’ll need to make a second set of system files for the chroot environment.

So first I make a directory chroot_env in my home folder, and I use debootstrap (I use Ubuntu at home and at work, and I love it) to install a minimal Ubuntu filesystem, you need to be root for that or use sudo in Ubuntu. If you don’t have debootstrap installed, in Ubuntu you can install it with sudo apt-get install debootstap.

The command is: sudo debootstrap gutsy ~/chroot_env/ http://archive.ubuntu.com/ubuntu
Total size of all this is about 212MB.

Once the chroot environment is installed you can access it with (as root/sudo, and assuming that you installed it in your home folder): chroot ~/chroot_env

Once inside the new environment, I also need some build tools to get started:
apt-get install build-essential
I also need to install the toolchain from gnuarm.com: exit the chroot env and copy the tarball to an appropriate place in the chroot tree, enter chroot again, extract the tarball and put the path of the bin directory into your $PATH variable (placing symbolic links in the /usr/bin folder to the arm-elf-* executables works too).