{"id":17972335,"url":"https://github.com/apache/nuttx-apps","last_synced_at":"2025-05-14T18:01:52.270Z","repository":{"id":37549831,"uuid":"228103139","full_name":"apache/nuttx-apps","owner":"apache","description":"Apache NuttX Apps is a collection of tools, shells, network utilities, libraries, interpreters and can be used with the NuttX RTOS","archived":false,"fork":false,"pushed_at":"2025-05-07T12:07:36.000Z","size":25831,"stargazers_count":339,"open_issues_count":56,"forks_count":606,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-05-07T13:24:37.339Z","etag":null,"topics":["embedded","mcu","microcontroller","nuttx","real-time","rtos"],"latest_commit_sha":null,"homepage":"https://nuttx.apache.org/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-14T23:26:26.000Z","updated_at":"2025-05-07T12:07:40.000Z","dependencies_parsed_at":"2023-09-22T19:45:01.999Z","dependency_job_id":"77df0b43-f157-4471-96ac-e2be4cccbe95","html_url":"https://github.com/apache/nuttx-apps","commit_stats":null,"previous_names":[],"tags_count":122,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fnuttx-apps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fnuttx-apps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fnuttx-apps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fnuttx-apps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/nuttx-apps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253851513,"owners_count":21973748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","mcu","microcontroller","nuttx","real-time","rtos"],"created_at":"2024-10-29T16:12:24.442Z","updated_at":"2025-05-14T18:01:47.259Z","avatar_url":"https://github.com/apache.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Application Folder\n\n## Contents\n\n- General\n- Directory Location\n- Built-In Applications\n- NuttShell (NSH) Built-In Commands\n- Synchronous Built-In Commands\n- Application Configuration File\n- Example Built-In Application\n- Building NuttX with Board-Specific Pieces Outside the Source Tree\n\n## General\n\nThis folder provides various applications found in sub-directories. These\napplications are not inherently a part of NuttX but are provided to help you\ndevelop your own applications. The `apps/` directory is a _break away_ part of\nthe configuration that you may choose to use or not.\n\n## Directory Location\n\nThe default application directory used by the NuttX build should be named\n`apps/` (or `apps-x.y.z/` where `x.y.z` is the NuttX version number). This\n`apps/` directory should appear in the directory tree at the same level as the\nNuttX directory. Like:\n\n```\n .\n |- nuttx\n |\n `- apps\n```\n\nIf all of the above conditions are TRUE, then NuttX will be able to find the\napplication directory. If your application directory has a different name or is\nlocation at a different position, then you will have to inform the NuttX build\nsystem of that location. There are several ways to do that:\n\n1) You can define `CONFIG_APPS_DIR` to be the full path to your application\n   directory in the NuttX configuration file.\n2) You can provide the path to the application directory on the command line\n   like: `make APPDIR=\u003cpath\u003e` or `make CONFIG_APPS_DIR=\u003cpath\u003e`\n3) When you configure NuttX using `tools/configure.sh`, you can provide that\n   path to the application directory on the configuration command line like:\n   `./configure.sh -a \u003capp-dir\u003e \u003cboard-name\u003e:\u003cconfig-name\u003e`\n\n## Built-In Applications\n\nNuttX also supports applications that can be started using a name string. In\nthis case, application entry points with their requirements are gathered\ntogether in two files:\n\n- `builtin/builtin_proto.h` – Entry points, prototype function\n- `builtin/builtin_list.h` – Application specific information and requirements\n\nThe build occurs in several phases as different build targets are executed: (1)\ncontext, (2) depend, and (3) default (all). Application information is collected\nduring the make context build phase.\n\nTo execute an application function:\n\n`exec_builtin()` is defined in the `apps/include/builtin/builtin.h`.\n\n## NuttShell (NSH) Built-In Commands\n\nOne use of builtin applications is to provide a way of invoking your custom\napplication through the NuttShell (NSH) command line. NSH will support a\nseamless method invoking the applications, when the following option is enabled\nin the NuttX configuration file:\n\n```conf\nCONFIG_NSH_BUILTIN_APPS=y\n```\n\nApplications registered in the `apps/builtin/builtin_list.h` file will then be\naccessible from the NSH command line. If you type `help` at the NSH prompt, you\nwill see a list of the registered commands.\n\n## Synchronous Built-In Commands\n\nBy default, built-in commands started from the NSH command line will run\nasynchronously with NSH. If you want to force NSH to execute commands then wait\nfor the command to execute, you can enable that feature by adding the following\nto the NuttX configuration file:\n\n```conf\nCONFIG_SCHED_WAITPID=y\n```\n\nThe configuration option enables support for the `waitpid()` RTOS interface.\nWhen that interface is enabled, NSH will use it to wait, sleeping until the\nbuilt-in command executes to completion.\n\nOf course, even with `CONFIG_SCHED_WAITPID=y` defined, specific commands can\nstill be forced to run asynchronously by adding the ampersand (`\u0026`) after the\nNSH command.\n\n## Application Configuration File\n\nThe NuttX configuration uses `kconfig-frontends` tools and the NuttX\nconfiguration file (`.config`) file. For example, the NuttX `.config` may have:\n\n```conf\nCONFIG_EXAMPLES_HELLO=y\n```\n\nThis will select the `apps/examples/hello` in the following way:\n\n- The top-level make will include `apps/examples/Make.defs`\n- `apps/examples/Make.defs` will set `CONFIGURED_APPS += $(APPDIR)/examples/hello`\n  like this:\n\n```makefile\n  ifneq ($(CONFIG_EXAMPLES_HELLO),)\n  CONFIGURED_APPS += $(APPDIR)/examples/hello\n  endif\n```\n\n## Example Built-In Application\n\nAn example application skeleton can be found under the `examples/hello`\nsub-directory. This example shows how a builtin application can be added to the\nproject. One must:\n\n 1. Create sub-directory as: progname\n\n 2. In this directory there should be:\n\n    - A `Make.defs` file that would be included by the `apps/Makefile`\n    - A `Kconfig` file that would be used by the configuration tool (see the\n      file `kconfig-language.txt` in the NuttX tools repository). This `Kconfig`\n      file should be included by the `apps/Kconfig` file\n    - A `Makefile`, and\n    - The application source code.\n\n 3. The application source code should provide the entry point:\n\n    ```c\n    main()\n    ```\n\n 4. Set the requirements in the file: `Makefile`, specially the lines:\n\n    ```makefile\n    PROGNAME   = progname\n    PRIORITY   = SCHED_PRIORITY_DEFAULT\n    STACKSIZE  = 768\n    ASRCS      = asm source file list as a.asm b.asm ...\n    CSRCS      = C source file list as foo1.c foo2.c ..\n    ```\n\n 5. The `Make.defs` file should include a line like:\n\n    ```makefile\n    ifneq ($(CONFIG_PROGNAME),)\n    CONFIGURED_APPS += progname\n    endif\n    ```\n\n## Building NuttX with Board-Specific Pieces Outside the Source Tree\n\nQ: Has anyone come up with a tidy way to build NuttX with board- specific pieces\n   outside the source tree?\n\nA: Here are three:\n\n   1) There is a make target called `make export`. It will build NuttX, then\n      bundle all of the header files, libraries, startup objects, and other\n      build components into a `.zip` file. You can move that `.zip` file into\n      any build environment you want. You can even build NuttX under a DOS `CMD`\n      window.\n\n      This make target is documented in the top level `nuttx/README.txt`.\n\n   2) You can replace the entire `apps/` directory. If there is nothing in the\n      `apps/` directory that you need, you can define `CONFIG_APPS_DIR` in your\n      `.config` file so that it points to a different, custom application\n      directory.\n\n      You can copy any pieces that you like from the old apps/directory to your\n      custom apps directory as necessary.\n\n      This is documented in `NuttX/boards/README.txt` and `NuttX Porting Guide`\n      online at \u003chttps://cwiki.apache.org/confluence/display/NUTTX/Porting+Guide\u003e.\n\n   3) If you like the random collection of stuff in the `apps/` directory but\n      just want to expand the existing components with your own, external\n      sub-directory then there is an easy way to that too: You just create a\n      symbolic link in the `apps/` directory that redirects to your application\n      sub-directory.\n\n      In order to be incorporated into the build, the directory that you link\n      under the `apps/` directory should contain (1) a `Makefile` that supports\n      the `clean` and `distclean` targets (see other `Makefile`s for examples),\n      and (2) a tiny `Make.defs` file that simply adds the custom build\n      directories to the variable `CONFIGURED_APPS` like:\n\n      ```makefile\n      CONFIGURED_APPS += my_directory1 my_directory2\n      ```\n\n      The `apps/Makefile` will always automatically check for the existence of\n      subdirectories containing a `Makefile` and a `Make.defs` file. The\n      `Makefile` will be used only to support cleaning operations. The Make.defs\n      file provides the set of directories to be built; these directories must\n      also contain a `Makefile`. That `Makefile` must be able to build the\n      sources and add the objects to the `apps/libapps.a` archive. (see other\n      `Makefile`s for examples). It should support the all, install, context,\n      and depend targets.\n\n      `apps/Makefile` does not depend on any hardcoded lists of directories.\n      Instead, it does a wildcard search to find all appropriate directories.\n      This means that to install a new application, you simply have to copy the\n      directory (or link it) into the `apps/` directory. If the new directory\n      includes a `Makefile` and `Make.defs` file, then it will automatically be\n      included in the build.\n\n      If the directory that you add also includes a `Kconfig` file, then it will\n      automatically be included in the NuttX configuration system as well.\n      `apps/Makefile` uses a tool at `apps/tools/mkkconfig.sh` that dynamically\n      builds the `apps/Kconfig` file at pre-configuration time.\n\n      You could, for example, create a script called `install.sh` that installs\n      a custom application, configuration, and board specific directory:\n\n      a) Copy `MyBoard` directory to `boards/MyBoard`.\n      b) Add a symbolic link to `MyApplication` at `apps/external`.\n      c) Configure NuttX, usually by:\n\n      ```bash\n      tools/configure.sh MyBoard:MyConfiguration\n      ```\n\n      Use of the name `apps/external` is suggested because that name is included\n      in the `.gitignore` file and will save you some nuisance when working with\n      GIT.\n\n# Export restrictions\n\nThis distribution includes cryptographic software. The country in which you\ncurrently reside may have restrictions on the import, possession, use, and/or\nre-export to another country, of encryption software. BEFORE using any encryption\nsoftware, please check your country's laws, regulations and policies concerning\nthe import, possession, or use, and re-export of encryption software, to see if\nthis is permitted. See \u003chttp://www.wassenaar.org/\u003e for more information.\n\nThe U.S. Government Department of Commerce, Bureau of Industry and Security (BIS),\nhas classified this software as Export Commodity Control Number (ECCN) 5D002.C.1,\nwhich includes information security software using or performing cryptographic\nfunctions with asymmetric algorithms. The form and manner of this Apache Software\nFoundation distribution makes it eligible for export under the License Exception ENC\nTechnology Software Unrestricted (TSU) exception (see the BIS Export Administration\nRegulations, Section 740.13) for both object code and source code.\n\nThe following provides more details on the included cryptographic software:\nhttps://tls.mbed.org/supported-ssl-ciphersuites.\nhttps://github.com/intel/tinycrypt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fnuttx-apps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fnuttx-apps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fnuttx-apps/lists"}