Skip to content

Execute from NSH builtin apps

This is extract from yahoo groups forum. Thanks Greg for these clarifications :

> 2) What is the procedure to call apps directly from NSH ? I.e. I want to call
“hello” app given in enxamples directly from NSH like this :
> nsh> hello

You have to have two things in your top-level nuttx/.config file:

1) Define CONFIG_NSH_BUILTIN_APPS=y. This enables support for callable
applications in NSH.

2) Most applications also have something that has to be defined that tells the
application that it is a child process of NSH. But not the hello example.

The normal apps/examples/hello can *not* be used this way because it does not
have the support built in. But there is another version here that will work:
apps/vsn/hello.

And you have to add a path to the top-level apps/.config file:

3) You have to define the path to the application in the top-level apps/.config
like:

CONFIGURED_APPS += vsn/hello

The first configuration steps in the build process are critical for installing
the NSH applications so you almost always have to start with:

make distclean

Then add in the applications that you want so that they will get configured in
correctly.

There are also several configurations in the source tree that do what you want.
You might want to look at these as examples:

configs/olimex-lpc1766stk/ftpc/defconfig:CONFIG_NSH_BUILTIN_APPS=y
configs/sam3u-ek/touchscreen/defconfig:CONFIG_NSH_BUILTIN_APPS=y
configs/sim/nsh2/defconfig:CONFIG_NSH_BUILTIN_APPS=y
configs/stm3210e-eval/nsh2/defconfig:CONFIG_NSH_BUILTIN_APPS=y
configs/vsn/nsh/defconfig:CONFIG_NSH_BUILTIN_APPS=y

There is also some discussion in apps/README.txt, but it looks a little
outdated.

Greg

Categories: Compilation.

Comment Feed

No Responses (yet)

You must be logged in to post a comment.