Making your Raspberry "product"

For your Raspberry-based "product" recipe, you'll need:
  • a custom GNU/Linux image (baking time: ~4h).
  • a custom extention board topping (flavor of your choice).
Price: ★☆☆      Taste: ★★★      Difficulty: ★★☆

Build a custom GNU/Linux image

Yocto [1] is now a common solution for creating automated build of custom GNU/Linux images for embedded products.

There are already build layers for the Raspberry Pi and build scripts for most of the libraries and tools.

This tutorial [2] shows how to build your own Raspberry Pi image step-by-step. Once started, the Yocto build framework first compiles a cross-compiler (gcc). It takes many hours if your computer is a bit old. The network connection might also slow down the process as many gigabytes of data are downloaded.

Another build solution is to use a cloud service. I tested the A4 instance of Microsoft Azure [3].

Azure cloud service was extremely slow and I had to give up after more than 10 hours (running on 8 cores).

I also tested the C2S instance of Scaleway [4].

The actual CPU of the 4-core option is:

from cpuinfo
- model name        : Intel(R) Atom(TM) CPU  C2550  @ 2.40GHz
- cache size        : 1024 KB

The Atom C2550 [5] is the little brother of the 8-core C2750 in the Avoton family.

~/rpi/build$ rm -rf cache/ sstate-cache/ tmp/
~/rpi/build$ time bitbake console-image
[...]
real    250m23.875s
user    810m38.560s
sys     58m33.650s

Building the image and its corresponding SDK took 4 hours and 10 minutes.

Note: the downloads/ folder was not deleted, hence download time is not taken into account in the build time measurment.

Design a Raspberry Pi HAT

The Raspberry Pi can easily be extended through its 2 x 20 GPIO pins header [6], which is mostly compatible over the Raspberry Pi 1+, 2 and 3 family. Those extention boards are called HATs (for "Hardware Attached on Top") [7].

A new HAT can easily be designed using KiCAD and this tutorial [8]. More details at [9].

My RaspIP looks like this:

It features a STM32 microcontroller (ST datasheet [10], KiCAD footprint [11]) connected to the SPI and I2C communication lines of the Raspberry Pi. Standard HATs are supposed to connect an EEPROM [12] to the I2C pins in order to provide the official operating system of the Raspberry Pi (Raspbian) with information about each HAT so as to load the relevant Linux driver as well as setting the GPIO to the right mode.

My design is meant to support this auto-configuration feature by emulating the EEPROM from the STM32 microcontroller.

The SPI channel will be used to send the current IP address to the extention board. This address is simply shown using the LEDs. SWD (single wire debug) is there for flashing the microcontroller, and UART for debugging output if needed.

You may notice that every single pin of the 32-pin quad-flat package is used. A lucky accident ;)

Yocto References

[1]The Yocto project, https://www.yoctoproject.org
[2]Jumpnow Technologies, "Building Raspberry Pi Systems with Yocto", http://www.jumpnowtek.com/rpi/Raspberry-Pi-Systems-with-Yocto.html
[3]Microsoft Azure cloud service, https://azure.microsoft.com
[4]Scaleway cloud service, https://www.scaleway.com
[5]Intel ARK for "Atom C2550", http://ark.intel.com/products/77982