NUTTX Building and compiling of source code

Source: Internet
Author: User
Tags config configuration settings git clone
Download Source code

sudo mkdir nuttx
CD NUTTX
1. Nuttx:git Clone Https://bitbucket.org/nuttx/nuttx.git
2. Apps:git Clone Https://bitbucket.org/nuttx/apps.git
3. Tools:git Clone Https://bitbucket.org/nuttx/tools.git
4. Buildroot:git Clone https://bitbucket.org/nuttx/buildroot.git install dependency library sudo apt-get install Libncurses5-dev sudo apt-get install bison sudo apt-get install flex sudo apt-get install libgmp3-dev sudo apt-get install Libmpc-dev sudo Apt-get Install Libmpfr-dev sudo apt-get install binutils-dev sudo apt-get install gperf Configuration Compilation Tool

config//
Board-name: Is the name of the development Board; Config-dir: A subdirectory that contains the board configuration.
Configuring NUTTX only needs to copy the three files in the Config-dir file to the NUTTX directory.

  Copy Configs/<board-name>/<config-dir>/make.def to ${topdir}/make.defs

Make.defs file: Describes the rules required for tool chain compilation and linking code. Modify this file when matching the specific requirements of the toolchain.

  Copy configs/<board-name>/<config-dir>/setenv.sh to ${topdir}/setenv.sh

setenv.sh file: The path variable that can be used to set the tool chain binary file. (optional)

  Copy Configs/<board-name>/<config-dir>/defconfig to ${topdir}/defconfig

Defconfig file: Save the actual build configuration. Included with all other make files to determine what is included in the build. This file is also used in
The C configuration header is generated in the include/nuttx/config.h.

  At this point there are three folders under Nuttx NUTTX Apps tools
  CD Nuttx
  take Stm32f4discovery as an example: (Nuttx supported development boards viewed under Nuttx/configs)
  will configs Copy the three files in the/stm32f4dicovery/winbuild to the NUTTX directory:
  sudo cp configs/stm32f4discovery/winbuild/make.defs./make.defs
  sudo cp configs/stm32f4discovery/winbuild/setenv.bat./setenv.sh
  sudo cp configs/stm32f4discovery/winbuild /defconfig./.config

Configuration information about the NUTTX in:
Topdir/configs/readme.txt {topdir}/configs/readme.txt {topdir}/configs/readme.txt

There is a configuration script under the Tools directory, which we need to configure with.
CD ${topdir}/tools
./configure.sh/
The same reference tools/readme.txt to learn this script. Update Configuration

The contents of the default configuration may be out of sync with the build system as actions such as adding or removing new configuration settings can cause dependency changes. Therefore, each configuration is refreshed after configuration and before production.

  Make Oldconfig

The configuration steps copy the. config file to the location in the top-level NUTTX directory, and make oldconfig updates the. config file for which they are operating. NUTTX Configuration

Then the last example says:
Go to the Nuttx folder and put the downloaded buildroot in the NUTTX directory:
sudo mv. /buildroot./
Go to the BuildRoot directory:
CD BuildRoot
Perform:
sudo cp configs/cortexm3-eabi-defconfig-4.8.5. config

sudo make menuconfig--> exit directly.

sudo make

This step may occur: there is no rule to create a target "Include/arch" error
Workaround

We go to the NUTTX directory and go to the Tools directory:
CD Tools

CD Kconfig-frontends

sudo./configure–enable-mconf

sudo make

sudo make install compile Nuttx

And then on entering into the

Cd..

CD Nuttx/tools

Perform

sudo./configure.sh Stm32f4discovery/nsh (nsh is via USB link, Uartnsh is via serial link, this is explained later)

Go back to the NUTTX and execute

Make Menuconfig

Kconfig-mconf:error while loading shared libraries:libkconfig-parser-3.12.0.so:cannot open shared object File:no such File or directory

Workaround: Add the Kconfig-frontends installation path (typically/usr/local/lib) to the ld.so.conf file in the/etc directory, and then execute the Ldconfig tool:

sudo vim/etc/ld.so.conf

Add in File: Include/usr/local/lib, save and exit

sudo ldconfig

Then continue to execute:

sudo make Menuconfig

Set according to your needs:

Build setup-->

Build host platform (choose Linux)

The rest depends on your needs.

Last execution: sudo make

May appear: Ln:include/arch to Arch/arm/include

Include/arch already exists but was not a symbolic link error

Workaround: sudo rm-r include/arch

Continue to execute sudo make

Will generate:
CP:nuttx.hex
CP:nuttx.bin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.