Nerves supports a variety of hardware. These are called targets and are
identified by short tag names. Examples of tag names are
When building a Nerves project, set the
MIX_TARGET environment variable to the
tag name. This controls which dependencies and configuration settings are used
when building your project. See the Mix
Targets documentation for
further information on this concept.
In Nerves, the term system refers to the library (usually posted to hex.pm) that
provides the bootloader, Linux kernel, C libraries, and more for a device.
Systems have names like
nerves_system_rpi0. Since it's possible to create
firmware for more than one hardware device, Nerves uses the Mix target feature
to select the desired system in your project's
The naming of target tags is arbitrary. You can choose tags however makes the
most sense for your project. Nerves uses the convention of naming the target tag
after the system that it uses. For example, when using the Nerves new project
generator, it will set up the
mix.exs to use the tag
rpi0 to select the
nerves_system_rpi0 library for building for a Raspberry Pi Zero.
The following table summarize officially supported hardware, the associated
system and the
$MIX_TARGET tag to use.
|Raspberry Pi A+, B, B+||nerves_system_rpi|
|Raspberry Pi Zero and Zero W||nerves_system_rpi0|
|Raspberry Pi 2||nerves_system_rpi2|
|Raspberry Pi 3 B, B+||nerves_system_rpi3|
|Raspberry Pi 4||nerves_system_rpi4|
|BeagleBone Black, BeagleBone Green, BeagleBone Green Wireless, and PocketBeagle.||nerves_system_bbb|
While the Nerves core team only officially supports the above hardware, the community has added support for other boards. See Nerves Systems on hex.pm
If you're trying to support a new Target, there may be quite a bit more work involved, depending on how mature the support for that hardware is in the Buildroot community. If you're not familiar with Buildroot, you should learn about that first, using the excellent training materials on their website.
If you can find an existing Buildroot configuration for your intended hardware and you want to get it working with Nerves, you will need to make a custom System as follows:
Follow their procedure and confirm your target boots (independent of Nerves).
Figure out how to get everything working with the version of Buildroot Nerves uses. See the
- Look for packages and board configs can need to be copied into your System.
- Look for patches to existing packages that are needed.
- Create a defconfig that mimics the one from step 1, and get
nerves_system_brto build it. See the section in the System documentation about customizing Nerves Systems.
NOTE: You probably want to disable any userland packages that may be included by default to avoid distraction.