Nard GNU/Linux is a software development kit
(SDK) written from scratch for the
Raspberry Pi family of boards. Unlike "ordinary"
Linux distributions Nard is intended entirely for the development of
MOTS embedded systems running day and night for years,
and you are more or less expected to add your unique custom application
on top of the Nard platform.
Nard operates in a Raspberry Pi a like a
in a PC. During boot everything is uploaded to RAM and executed from there.
You may even remove/hot swap the SD-card from a running system at any time
and it will continue to operate just fine! The SD-card is only accessed
upon request by your custom application.
For the impatient here is a
pre-built image for the Pi model B. However, if you have ever done
C/C++ compiling before; read on. You can
easily create your own image. After unpacking
the tarball you get this tree:
$ tar -xzf nard.tar.gz
# Applications (incl Linux kernel)
# The final output goes here
# Each product and RPi model has unique values here
# Common make "library"
# Toolchain (compiler)
There are only a few directorys to keep things simple. Hold on with
delving into the tree - we will do it later on. Instead you should
now start building a product example:
$ cd nard
$ make skeleton
$ ls -l images/
# Finished outputs
The first run require half an hour or so to finish on a quad
core machine. Typical pre-requisites includes
gcc, bison, flex, makedepend,
automake etc. i.e the "usual" tools for compiling
software packages. They are available in all major Linux distributions
(Ubuntu, Fedora, Suse) should you need to install them. Detailed help
can be found in the Trouble Shooting
Every product Nard can build has a recipe for what it's composed of.
Product and board recipes stack on top of each other. The generic board
recipes act as templates for the specifics. In the figure below
everything originates from default.
raspi_x_revx is an abbreviation for
Raspberry Pi all models all revisions. It extends the previous
recipe but may as well override it, should it need to.
raspi_b_rev2 is short for
model B revision 2. Products in the need of dual
I2C channels may for instance use this recipe
(revision 1 had only one channel). If you know object oriented programing
you will have no problem grasping these dependencies.
A recipe is simple Makefile. It's self
explanory so here is a small example:
# The HW we will run on
export BOARD := raspi_b_revx
# List of applications this product needs. Packages
# will be built in the listed order (unless you
# explicitly define the dependencies).
PKGS_APPS += linux-kernel/linux-rpi-3.10.y
PKGS_APPS += bftpd/bftpd-4.2
The variable PKGS_APPS defines what
should be installed in the target. The example above adds Linux
kernel 3.10.xx and a FTP server. Each layered recipe can add
additional applications and in fact you will by default (from
raspi_x_revx) also get a SSH server,
BusyBox and some other tools
one likely needs in an embedded system. All applications added to
PKGS_APPS must reside in the
Once the example product has finished building it's time to write your
custom image to a SD-card. Any SD-card of at least 2 GB size will
suffice (only 30 MB will become occupied). Warning, it will be
fully erased in the process! Insert the card in your
PC and run:
$ sudo -s
# Become root
$ zcat images/sdcard.img.gz >/dev/mmcblk0
# Your SD-card path here
# Flush before removing it
This image write is done only once. Next rebuild can be
upgraded via the network.
Easily log in to your board with a pre-setup custom SSH command.
From the build environment run:
$ make ssh
Your PC will then scan the local Ethernet subnet for targets running Nard
and automatically login with a key it recently built. If multiple Nard
boards are found you will get a list to choose from. Should it doesn't
work you can log in with telnet as well. The default credentials is
If your network setup is malfunctioning or you have a model A
Raspberry Pi you may login via a USB-to-Serial dongle as well:
Connect the dongle to the Raspberry Pi USB host port.
When Nard has booted up it's ready for remote unattended upgrades.
From your buildenvironment in your PC, run this command:
$ make upgrade
It will scan the local network subnet for your board and upload your
build with FTP firsthand and by SCP secondhand. A script in Nard
will check the uploaded files, replace the SD-card contents and
reboot if everything was OK.
Unique device settings (such as static IP-address) for each of your
devices should be put in the directory
/settings in the FAT
partition of the SD-card. A field engineer can then easily
configure each device during deployment with a standard
laptop. There are three small files that optionaly need adaptions. They
are well commented but briefly described here too:
- Use static or dynamic (DHCP) IP address?
- Wifi password and SSID?
By default DHCP is used.
- Human readable description of device (optional)
- Manually assigned (optional) fixed ID
These optional values will help you separate your devices apart.
If you have many devices connected to the same network and all
of them use DHCP it's hard to identify a specific unit. In those
cases, run the command make scan from
within the development environment and you will get a list of
all nearby devices and their corresponding description/ID. Very
coveted by field service engineers.
Name of the device as used by the OS. Will show up in the list
when performing a make scan as well.
Defaults to the product name + cpu serial number if left empty.
Modifications of the settings can be performed remotely as well.
Login with a serial cable or SSH, edit them with
vi /boot/settings/nodeid and issue a reboot.
Unpack the SDK archive to your local PC harddrive. Don't
use a network share, it's to slow. Even if you're on a fast LAN
it's still nothing compared to your local disk. Instead, let
the revision control system (git/svn) do the backup handling.
Neither GUI nor keyboard is available by default. In fact, you
may leave the HDMI unconnected because there is nothing to see.
Instead, if you want a console, either go for the
the I/O expansion header P1 or connect a standard
USB-to-Serial dongle to the Raspberry Pi USB port. You
may then connect a null modem cable between your PC and the
USB-to-Serial dongle to get a login prompt.
If you have made it this far you qualify for next course; go
ahead to the Advanced Use tutorial!
Use the mailing list firsthand if
you need help. If that doesn't work, send a mail to the authors and we
will try to help you out. Feedback and comments are welcome too! We
would like to know how you find Nard. Do you like it? Have a wish-list
etc? Commercial support can be arranged if necessary but is no
Nard is an unofficial SDK, not associated with the Raspberry Pi
Foundation and Raspberry Pi is a trademark of the Raspberry Pi
Foundation. Linux is the registered trademark of Linus Torvalds
in the U.S. and other countries. Nard SDK comes with ABSOLUTELY
NO WARRANTY, to the extent permitted by applicable law.