Raspberry Pi 3.2.21 kernel

You know the drill! A few days ago, Linux 3.2.21 was released. As usual I’ve updated my Raspberry Pi kernel. This one has a few additional changes on top of just the 3.2.20 to 3.2.21 update:

  • Imported some further patches from the official Raspberry Pi kernel, including some patches to the ALSA audio driver.

Please see my kernel project page for download links and instructions.

Raspberry Pi XBee SMT backpack

RPi-XBee-SMT Board

One of the earliest motivations for my work on the Raspberry Pi SPI driver was so that I could use some Digi XBee ZB SMT modules. These are basically the same as the normal XBee ZB modules for doing ZigBee with but are on little PCBs that you solder onto a carrier board—and they can speak SPI to the host processor instead of serial. I got several of these modules for a previous project that never materialised but the Raspberry Pi seems like a nice environment to have a play with these.

So I went ahead and designed a carrier PCB to hook these up to the Raspberry Pi’s GPIO expansion connector. You can see an Eagle exported image of the PCB to the right. It carries the XBee ZB SMT along with a bunch of LEDs and its own 3.3V LDO so it doesn’t draw too much from the Pi itself. I also threw in two FTDI connectors, one for the Raspberry Pi’s UART and one for the XBee module’s. It also sports a set of holes for the normal XBee modules (2mm headers) so you can use those as well over serial, but obviously you won’t be able to use SPI with those.

RPi-XBee-SMT Schematic

You can find the source Eagle files along with the associated libraries over in my RPi-XBee-SMT Git repo at GitHub. I’ve decided to release this under a Creative Commons Attribution-ShareAlike 2.0 UK: England & Wales License, making it Open Source Hardware (OSHW).

I haven’t yet ordered any PCBs of this, so I haven’t actually tried it out yet. If you have any comments on the schematic or layout then please let me know. I’ll try to get some ordered in the next couple of weeks – if you live in the UK and would like some yourself it may be worth pooling the order to get the price down so please comment / email if that’s the case.

Once I have some hardware to test with, the next step will be writing some drivers…

Raspberry Pi 3.2.20 Kernel

A few days ago, Linux 3.2.20 was released. As usual I’ve updated my Raspberry Pi kernel. This one has a few additional changes on top of just the 3.2.19 to 3.2.20 update:

  • Introduced some new SDHCI performance tweaks. These are also in the official kernel from the Raspberry Pi Foundation. These require the latest firmware or the kernel will not boot.
  • Added the easycap module.

Please see my kernel project page for download links and instructions.

Why I won’t support a 3.1 kernel

Copied from my Raspberry Pi kernel page:

One of the reasons I’m really pushing at a 3.2 kernel for the base image of the Raspberry Pi (until we get the architecture code rewritten for a mainline merge, another effort I’m part of) is that 3.1 is no longer an actively supported branch of the kernel and has some nasty security issues, whereas 3.2 is actively supported as it is the basis of Ubuntu 12.04 LTS (Precise Pangolin) and will be the kernel used in Debian Wheezy as well.

Please see Issue #2 on the Raspberry Pi kernel tree on GitHub for a fright. Here’s a technical description of the issue, including an exploit (linked from the GitHub issue).

In other words, 3.1.9 has nasty security holes that will come back to bite you. 3.2 is a long-term supported branch and really isn’t a big step to take from 3.1. So please, follow my lead and ditch the official Raspberry Pi 3.1.9 kernel and use something a bit more recent.

This means that I will not support the porting of my SPI and I2C drivers to the official kernel until it moves to 3.2 or a more recent branch. Such an effort would undoubtedly be very simple for whoever decides to undertake it, but it’s not something I am willing to help with. Sorry!

I am, however, most willing to help bring the official kernel to 3.2 or newer. After all, this is what I have already done.

Yet another new kernel – 3.2.19

A few days ago, Linux 3.2.19 was released. As usual I’ve updated my Raspberry Pi kernel. This one has a few additional changes on top of just the 3.2.18 to 3.2.19 update:

  • Reverted a problematic SDHCI patch that broke SD card access for lots of people.
  • Added lots of USB webcam modules.
  • Added some USB wifi adapter modules from the kernel staging directory.

As I seem to be doing this quite often and my kernels are becoming quite popular, I thought it best to give them their own project page. This means the link to the page will stay the same for every revision.

Grab your freshly baked Raspberry Pi 3.2.19 kernel today!

Slightly updated RPi kernel

I’ve updated my Raspberry Pi 3.2.18 kernel with some patches and slight configuration changes since the last one:

  • The USB code is now built-in instead of being a module. This means that people who want to keep their root filesystem on a USB hard disk or similar can do so.
  • Some fixes for my I2C driver that prevent it reading/writing further than it should have. This caused at least one user to experience a kernel panic.

I have not yet reverted the MMC/SD commit that I suspect is causing many people issues. So far I have had only one conclusive report that it has helped. If you have had trouble with an SD card in my kernel but not in the official kernel and have the opportunity to build a kernel with commit 84045e4 reverted, please let me know the outcome.

Update: This is no longer the most current kernel. You can find the latest version on my Raspberry Pi kernel project page.

Raspberry Pi Breadboard Madness

Raspberry Pi Breadboard Madness

So I was working on my Raspberry Pi, getting SD cards and ethernet working over SPI so we can still use mass storage and networking while we rewrite the SD and USB drivers. I looked over at the side of my desk where all of this is on breadboard attached to my RPi and realised the insanity of it.

So let’s play spot the PCB:


And yes, my Raspberry Pi has two SD cards and two ethernet controllers connected. The kernel and device tree blobs are loaded from the built-in SD and the root filesystem from the SPI SD card. The internet ethernet doesn’t work at the moment because we don’t have a USB driver in this kernel, so the SPI ethernet does the job for now!

How to build a cross compiler for your Raspberry Pi

A cross compiler is a compiler that runs on one platform/architecture but generates binaries for another platform/architecture. With devices like the Raspberry Pi, where you really don’t have much CPU or memory to work with, if you’re doing any heavy compiling (like when working on the kernel) a cross compiler is the only way to go. For example, I build all my Raspberry Pi kernels on my nice Sandy Bridge Xeon E3 home server where they compile in only a fraction of the time they would on the Pi.

Continue reading

Another new RPi kernel (3.2.18)

Update: This is no longer the most current kernel. You can find the latest version on my Raspberry Pi kernel project page.

Well, just as I uploaded my 3.2.17 kernel someone decided it would be a good idea to post 3.2.18. So here it is. It also incorporates a new patch that allows this kernel to be booted on the Raspberry Pi using kexec – previously, trying to do this would hang the Pi. Grab it from:

Please see my previous post (about the 3.2.17 kernel) for notes regarding the Raspberry Pi firmware.

If you want to use kexec, remember to give your kexec kernel some boot arguments with the --command-line= option, or it will seem like your kernel has crashed. Something like this might be a good idea: kexec --command-line="$(cat /proc/cmdline)" /boot/vmlinuz-3.2.18-rpi1+.

Updated Raspberry Pi Kernel

Update: This is no longer the most current kernel. You can find the latest version on my Raspberry Pi kernel project page.

Last bit of Raspberry Pi work this weekend was to update my 3.2-based kernel. This latest update brings it up to 3.2.17 with the latest patches from the official Raspberry Pi kernel (with updates for MMC/SDHCI among others) and includes my SPI and I2C drivers. Grab it from:

I also highly recommend you update your firmware in your SD card’s boot partition to the latest available version. Note that the default start.elf in that set of files appears to be the 128M variant – you may wish to use the 192M version instead by copying arm192_start.elf as start.elf on your SD card. I tried the 224M variant but that didn’t work at all for me.

With the latest firmware you also don’t need to worry about the first32k.bin being added to your kernel. Just install the kernel package and copy /boot/vmlinuz-3.2.17-rpi1+ to kernel.img on your SD boot partition (/mnt/boot in my Wheezy image).

I’ll be updating my Wheezy image in the next few days to incorporate this latest kernel and a significant number of package updates.