Blog

Using Go in place of a Spreadsheet

Recently I needed to calculate NAND partition tables for a project where we will be supporting a number of different flash parts from 500MB to 2GB.  I first tried this in a spreadsheet, but found it difficult to work easily with hex numbers and do the calculations I needed.  I then looked into options for formatting text in columns from a program and found the nice text/tabwriter Go library.  With a few lines of code, I was then able to get the below output, which is quite easy to read.  The only tricky part was figuring out that for right justified data, you need to:

  1. not use tabs for the padding character
  2. add a trailing \t in the input data

Read More »Using Go in place of a Spreadsheet

Using Docker for OE/Yocto builds

Why Docker?  When using OE to build software for products, we often run into the scenario where software needs to be built using the same version of OpenEmbedded over the course of several years.  Production builds need to be predictable.  We’ve also observed that old versions of OE often break as new Linux distros come out.  This is just the result of the complexity of building tool chains.  Additionally, for predictable builds you really don’t want to be changing the build OS.  This requirement automatically rules out Arch Linux, Debian Unstable, Gentoo, etc as production build machines.  Additionally, having developers debug OE build issues on varying workstation distributions is frustrating and time consuming.

Read More »Using Docker for OE/Yocto builds

IOT Protocols: MQTT vs CoAP vs HTTP

With the explosion of IOT (Internet of things), there are now more technologies we can use to build systems.  In reality, we’ve been doing IOT for years.  We’ve been networking devices for a long time.  We’ve been collecting data from remote nodes.  This is nothing new, but what the IOT movement brings to the table is technologies that are much lower cost, and more standardized.  Two of these technologies are MQTT and CoAP.  Both very interesting, and very useful.  Recently, I helped a system manufacturer think through the architecture of a system with the following requirements:

Read More »IOT Protocols: MQTT vs CoAP vs HTTP

Rebasing a set of changes with Git

One of the common things we do during Linux kernel development is move a series of patches from one kernel version to a similar version (say Linux 4.1 to 4.1.12).  This is required as new stable versions of particular kernel version are released.  One approach is to merge, but then your changes are mixed in with upstream commits and are more difficult to manage.  Git rebase offers a convenient way to move a set of patches.  In the following example we have a series of changes we made (or patches we applied) on top of the 4.1 kernel.

Read More »Rebasing a set of changes with Git

Modifying the BusyBox config in OpenEmbedded

Recently, I needed to enable the eject command in BusyBox for an OpenEmbedded (Yocto) based project.  Below is a way to do this in a fairly painless way:

  1. bitbake -c menuconfig busybox (enable the eject command in the config and save)
  2. bitbake -c diffconfig busybox (this generates a config fragment, note the fragment file location)
  3. recipetool appendsrcfile -w [path to layer] busybox [path to fragment generated in step #2]

Read More »Modifying the BusyBox config in OpenEmbedded

Library sizes for C vs C++ in an embedded Linux system

Is the size of the libraries required for C++ (vs C) a concern in Embedded Linux systems?  Most Embedded Linux systems likely include some C++ code, so this is probably not even a decision we need to make in many cases.  However, often there is a need for a small initramfs that is used as part of the boot process (perhaps for software updates) before switching to the main root file system.  In this case, it makes sense to keep the initramfs as small as possible, and we might be concerned here with the size of C++ libraries.

Read More »Library sizes for C vs C++ in an embedded Linux system