Install and configure NuttX ARM build environment in Linux

In this manual will see how to install and configure all the tools needed to build NuttX for ARM under Linux. The toolchain is the one comming with the Ubuntu itself (at least with the new versions of Ubuntu). The version of LInux I’m using is Ubuntu 14.04.

1. Install the Ubuntu 14.04 and update all the packages.

2. Install the ARM toolchain

sudo apt-get install gcc-arm-none-eabi

3. Install kconfig-frontends package

This package is used by the NuttX to configure the build. You can select the board, build environment, what is enabled as peripherals from the SoC and from the board.

kconfig-frontends main view

Get the latest kconfig-frontends  from

http://ymorin.is-a-geek.org/download/kconfig-frontends/ to

"your local path"/nx/misc/

 then extract the archive and rename the folder to

"kconfig-frontends"

 Now we need to install the dependencies

# Install kconfig-frontends dependencies (the upcoming configure may catch more dependencies)
sudo apt-get install gperf libncurses5-dev flex bison
cd "your local path"/nx/misc/kconfig-frontends/
./configure
make
sudo make install

4. Go to the NuttX download page

http://sourceforge.net/projects/nuttx/files/nuttx/

and get the latest version. At this moment it is 7.3. So download the OS itself

http://downloads.sourceforge.net/project/nuttx/nuttx/nuttx-7.3/nuttx-7.3.tar.gz

and the apps

http://softlayer-dal.dl.sourceforge.net/project/nuttx/nuttx/nuttx-7.3/apps-7.3.tar.gz

5. Unpack both archives in “nx” so the structure is like this (need to rename the nuttx-7.3 and apps-7.3)

|- nx
|   |-- nuttx
|   |-- apps

6. Now we need to configure the NuttX for SAM4E-EK

cd "your local path"/nx/nuttx/tools
./configure.sh sam4e-ek/nsh

7. Configure the toolchain

cd "your local path"/nx/nuttx
 
# Be sure you have:
#   Build Setup
#      `--> Build Host Platform (Linux)
#    System Type
#      `--> Toolchain Selection (Generic GNU EABI toolchain under Linux (or other POSIX environment))
make menuconfig
 
# Set the environment
. ./setenv.sh

8. Build

make

Installation and configuration of Eclipse so we can build the project from the IDE instead of from the console.