How to port

This guide explains “How to port NuttX”.

At this guide, the scope of porting is adding a new SoC or board directory, which can be built and has a working example that boots to the NuttShell (NSH).

The goal of porting is to comfirm the booting NuttShell(NSH), the pass of “ostest” and the timer.

Porting a new SoC and board to NuttX requires modifications on arch, SoC and board directories. For the details, see Directory Structure, Architecture-Specific Code, Boards Support.

To port NuttX properly, we have to understand the boot sequence and related kernel configurations. Following links explain them, although these depend on specific kernel version and configurations. (To understand them, we have to read the code deeply.)

About the implementation, the build system tells you minimal implementation of SoC/Board directory, these implementations are almost done by copying and pasting from other SoC/Board directory if there is the source code for the target HW IP in upstream. If there is not the source code in upstream, the porter has to implement it by himself.

Porting procedure

At first, you have to read and execute Installing and Compiling with Make. After that, try follwoing procedure.

Step

Process

Comment

1

Add the SoC

2

Add the Board

If the board was not sold in the market, the board directory should be located out-of-tree. For details see Custom Boards How-To. And if you wanted to add own apps, see Custom Apps How-to.

3

Configure

The configure needs to understand related kernel configurations. see The list of related kernel configurations.

4

Compile

The compile tells you which source files are needed in SoC/Board directory to pass the compile.

5

Link

The link tells you which symbols are needed in SoC/Board directory to pass the link.

6

Implement

Do implement the symbols which are needed by the link.

7

Verify

Do “apps/testing/ostest”. I think the pass of ostest is the one of proof for proper porting. And check the timer implementation whether the kernel could count the time accurately or not.

The result of porting procedure

Although these depend on specific kernel version.