acassis commented on issue #11442:
URL: https://github.com/apache/nuttx/issues/11442#issuecomment-1868591251
@j-couch I was able to get it working following the second option "2. Extend
the apps/ directory to include a new custom directory" of the Custom Apps
guide, with the following modifications:
Make.defs should be replace to include CONFIGURED_APPS when
CONFIG_CUSTOM_APPS_CUSTOM_HELLO is enabled in the menuconfig! This way:
```
ifneq ($(CONFIG_CUSTOM_APPS_CUSTOM_HELLO),)
CONFIGURED_APPS += $(APPDIR)/CustomApps
endif
```
In CustomHello.c the function name should be "main" instead of
"custom_hello" otherwise it will report that "custom_hello_main" is missing.
This is the result:
```
$ ./nuttx
login: admin
password:
User Logged-in!
nsh> ?
help usage: help [-v] [<cmd>]
. cp exit ls ps time
[ cmp false mkdir pwd true
? dirname fdinfo mkfatfs readlink truncate
alias dd free mkrd rm uname
unalias df help mount rmdir umount
basename dmesg hexdump mv set unset
break echo kill pidof sleep uptime
cat env losetup poweroff source usleep
cd exec ln printf test xd
Builtin Apps:
custom_hello gpio nsh
dumpstack hello sh
nsh> custom_hello
Hello, Custom World!!
nsh> poweroff
```
Note, doing this way if you move CustomApps to outside of apps/ and just
create a symbolic link to it, also will work.
For your convenience just find attached the example:
[CustomApps.tar.gz](https://github.com/apache/nuttx/files/13762796/CustomApps.tar.gz)
@TimJTi please take a look, I think we need to update the guide. Also it
should be nice if the Makefile text could be copied keeping the format
including TAB, etc. Currently even the lines with comment "\#" are copied as
lines without asterisk.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]