How to Compile Just One Kernel Module

I received two C.H.I.P computers in 2016. They come with Linux kernel 4.4.13, but the kernel had limited features. When I needed to use the fuse kernel module, I had to re-compile the entire kernel, which took a whole day. Two years later, I upgraded to a newer 4.4.138 kernel, built by community member kaplan2539. The kernel comes with more modules including fuse, which is a better situation than the original kernel.

DM9601 USB Ethernet adapter plugged into a C.H.I.P computer

Recently I acquired a cheap USB Ethernet adapter. When I plugged it in, the kernel recognizes a USB device:

How to Flash C.H.I.P Offline

Next Thing Co (NTC), the company that made the $9 C.H.I.P computer, is not doing well: orders are not shipping on time, and support is not answering emails. While the little CHIPs would still work even if NTC no longer exists, same cannot be said for firmware flashing: the recommended method for flashing firmware is through Chrome App developed by NTC, which in turn downloads from NTC's file servers. If Next Thing Co evaporates and their file servers go offline, the Chrome App would not be able to download the firmware, and therefore I cannot re-flash my CHIPs if I ever mess up their operating system.

To keep my C.H.I.Ps working for as long as possible, I have to plan for the inevitable and find out how to flash a CHIP without relying on the Internet, or at least, without relying on the opensource.nextthing.co file server. NTC has published some scripts, known as CHIP-tools, to work with CHIP computers. The chip-update-firmware.sh script is a command line tool to flash the device. While the content of this script is complicated, to make it work offline, I just need to figure out what it needs from NTC file servers, and download these files in advance.

A brief read and tests indicate that chip-update-firmware.sh has the following workflow:

  1. Verify all necessary programs are available.
  2. Select a flavor according to command line arguments. It is one of server, gui, pocketchip, and buildroot.
  3. Download a latest file that contains the latest firmware version number.
  4. Download SPL, sunxi, and U-Boot images.
  5. Connect to CHIP in FEL mode, and determine whether the CHIP has a Hynix or Toshiba NAND chip.
  6. Download CHIP operating system image that suitable for the NAND chip.
  7. Connect to CHIP in Fastboot mode, and send the operating system image to CHIP.

Files for each flavor is hosted in a different directory on the file server. For server flavor, the files are:

Measure Bike Speed with PocketCHIP and GPS Receiver

I won a #FreePocketCHIP last Christmas. It is a "pocketable" Linux computer running Debian, and has one USB 2.0 host port. Apart from adding a speaker and playing PICO-8 games, PocketCHIP's form factor and hackability make it suitable for many other projects. Today, I'm going to find out how fast I am riding a bike, with the PocketC.H.I.P and VK-172 GPS receiver.

PocketCHIP and VK-172 GPS receiver

Meet the GPS Receiver

The GPS receiver I have is the VK-172 G-mouse USB GPS receiver. It has a small form factor, and connects to the PocketCHIP via USB. When connected, it identifies itself as a USB device with ID 1546:01a7, and shows up as a serial port:

Access C.H.I.P UART Wirelessly with ESP8266

A year ago, a Kickstarter campaign CHIP - The World's First Nine Dollar Computer caught my attention: it's a $9 computer smaller than a banana. Unlikely the Raspberry Pi, it comes with onboard storage so I don't need to buy a separate SD card, it has WiFi instead of wired Ethernet so I don't have to run wires everywhere, and it is compatible with my existing VGA monitor through a $10 adaptor so I don't have to buy another HDMI monitor. Therefore, I snapped two of these little computer along with one VGA adapter during the campaign.

During the whole year of waiting, Next Thing Co sends me regular email updates on the development progress, with each email ending with mmmtc (much much more to come) and a lot of hearts. NTC also clarified that C.H.I.P is strictly B.Y.O.B. Finally, my pair of CHIPs and a VGA DIP arrived in my mailbox on Jun 16. An hour later, yoursunny.com homepage is displayed on its Debian desktop.

A few more hours later, I start to discover a limitation of C.H.I.P software: The Linux kernel comes with CHIP operating system has very limited features.

$ sudo modprobe fuse
modprobe: FATAL: Module fuse not found.

Obviously, the solution to this problem is to compile my own Linux kernel with more features. The compilation can be done on the C.H.I.P itself. I managed to do that when the CHIP is powered by a 5V 1A phone charger plus a 1500mAh LiPo battery. I had the compilation running under screen(1) and attended to it intermittently, and finished in a day.