linux

Making an Embedded Linux Kernel Device Driver

spitest_dut.JPG
I bought this nice little embedded Linux development board some months back. It's called Carambola and it's based on a MIPS SoC manufactured by Ralink and designated RT3050. The board has 8MB flash, 32MB ram, two ethenet ports, 802.11bgn wifi, USB host, 2x uart, 1x SPI, 1x I2C and some GPIO pins. The chipset is commonly used in small home routers and such, but it seems to work very nicely as a generic embedded linux development platform.

I wanted to do something with the SPI bus of the board, purely as a learning experience. More specifically, I wanted to write a kernel module that does something with the SPI bus. You can actually control the SPI bus from Linux user space as well, and quite easily at that, so why do I want to do it from inside the kernel? First of all, I've been using Linux as my desktop operating system for years, so I'm quite familiar with how Linux operates in the user space, but my experiences with operating in the kernel space have been a lot more limited. This would be a perfect time to learn. Also, if you want to make actual Linux device drivers for whatever you're interfacing with, those need to be done in the kernel.

In any case, for the first try I wanted to interface with something easy. I decided to interface a very simple shift register and some LEDs to the carambola board. The goal: make a larson scanner.

Syndicate content