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
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.
Get the latest kconfig-frontends from
http://ymorin.is-a-geek.org/download/kconfig-frontends/ to
1
|
"your local path"
/nx/misc/
|
then extract the archive and rename the folder to
1
|
"kconfig-frontends"
|
Now we need to install the dependencies
1
2
3
4
5
6
|
# 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)
1
2
3
|
|- nx
| |-- nuttx
| |-- apps
|
6. Now we need to configure the NuttX for SAM4E-EK
1
2
|
cd
"your local path"
/nx/nuttx/tools
.
/configure
.sh sam4e-ek
/nsh
|
7. Configure the toolchain
1
2
3
4
5
6
7
8
9
10
11
|
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
1
|
make
|
Note:
如果出现make: Nothing to be done for all:的问题,是因为系统的不同,导致运行库版本不同,则需要重新编译源文件。方法如下:
>make clean(清除上次make命令所产生的object文件(后缀为“.o”的文件)及可执行文件。)
>ldconfig (该命令通常在系统启动时运行,确保动态链接库为系统所共享。当用户安装了一个新的动态链接库时,则需手工运行该命令。)
>make(执行makefile文件)
这样就能够重新编译啦。