Nuttx学习之——Linux开发环境搭建

本文详细介绍如何在Ubuntu 14.04上配置并构建NuttX实时操作系统及其应用程序,包括安装工具链、配置构建环境等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

kconfig-frontends main view

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文件)

这样就能够重新编译啦。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值