Installing

To start developing on Apache NuttX, we need to get the source code, configure it, compile it, and get it uploaded onto an embedded computing board. These instructions are for Ubuntu Linux and macOS Catalina. If you’re using a different version, you may need to change some of the commands.

Prerequisites

  1. Install system packages

$ sudo apt install \
bison flex gettext texinfo libncurses5-dev libncursesw5-dev \
gperf automake libtool pkg-config build-essential gperf genromfs \
libgmp-dev libmpc-dev libmpfr-dev libisl-dev binutils-dev libelf-dev \
libexpat-dev gcc-multilib g++-multilib picocom u-boot-tools util-linux
  1. Give yourself access to the serial console device

This is done by adding your Linux user to the dialout group:

$ sudo usermod -a -G dialout $USER
$ # now get a login shell that knows we're in the dialout group:
$ su - $USER

To complete the installation of prerequisites, you need to install kconfig-frontends as instructed in the Quickstart guide.

Install a Cross-Compiler Toolchain

To build Apache NuttX you need the appropriate toolchain according to your target platform. Some Operating Systems such as Linux distribute toolchains for various architectures. This is usually an easy choice however you should be aware that in some cases the version offered by your OS may have problems and it may better to use a widely used build from another source.

The following example shows how to install a toolchain for ARM architecture:

$ apt install gcc-arm-none-eabi binutils-arm-none-eabi

Tip

There are hints on how to get the latest tool chains for most supported architectures in the Apache NuttX CI helper script and Docker container

Get Source Code

Now that all required tools are installed, you need to download NuttX source-code.

Apache NuttX is actively developed on GitHub. If you intend to contribute changes or you simply need the absolute latest version, you should clone the Git repositories:

$ mkdir nuttx
$ cd nuttx
$ git clone https://github.com/apache/incubator-nuttx.git nuttx
$ git clone https://github.com/apache/incubator-nuttx-apps apps

The development source code is also available as a compressed archive, should you need it:

$ curl -OL https://github.com/apache/incubator-nuttx/tarball/master
$ curl -OL https://github.com/apache/incubator-nuttx-apps/tarball/master
# optionally, zipball is also available (for Windows users).

Next up is Compiling.