Lines Matching full:application
3 Application Development
10 …- your **application directory**, :file:`<app>`, is something like :file:`<home>/zephyrproject/app`
16 Keeping your application inside the workspace (:file:`<home>/zephyrproject`)
18 put your application anywhere as long as :ref:`ZEPHYR_BASE
26 The build system is application-centric, and requires Zephyr-based applications
27 to initiate building the Zephyr source code. The application build controls
28 the configuration and build process of both the application and Zephyr itself,
36 The files in the **application directory** link Zephyr and any modules with the
37 application. This directory contains all application-specific files, such as
38 application-specific configuration files and source code.
40 Here are the files in a simple Zephyr application:
55 application files, and links the application directory with Zephyr's CMake
61 application-specific changes which should be applied to the base devicetree
63 usually to configure something about the hardware used by the application.
70 * **prj.conf**: This is a Kconfig fragment that specifies application-specific
71 values for one or more Kconfig options. These application settings are merged
74 the application.
79 See :ref:`application-kconfig` below for more information.
82 These fields let you manage the lifecycle of the application and automate
83 providing the application version when signing application images.
91 Once an application has been defined, you will use CMake to generate a **build
92 directory**, which contains the files you need to build the application and
95 can use CMake directly also. Application build artifacts are always generated
103 Application types
106 We distinguish three basic types of Zephyr application based on where
112 | Application type | :file:`<app>` location |
129 Zephyr repository application
132 An application located within the ``zephyr`` source code repository in a Zephyr
134 application. In the following example, the :zephyr:code-sample:`hello_world sample
135 <hello_world>` is a Zephyr repository application:
154 Zephyr workspace application
157 An application located within a :ref:`workspace <west-workspaces>`, but outside
158 the zephyr repository itself, is referred to as a Zephyr workspace application.
159 In the following example, ``app`` is a Zephyr workspace application:
176 Zephyr freestanding application
179 A Zephyr application located outside of a Zephyr :ref:`workspace
180 <west-workspaces>` is referred to as a Zephyr freestanding application. In the
181 following example, ``app`` is a Zephyr freestanding application:
202 Creating an Application
205 In Zephyr, you can either use a reference workspace application or create your application by hand.
209 Using a Reference Workspace Application argument
212 The `example-application`_ Git repository contains a reference :ref:`workspace
213 application <zephyr-workspace-app>`. It is recommended to use it as a reference
214 when creating your own application as described in the following sections.
216 The example-application repository demonstrates how to use several
225 Basic example-application Usage
228 The easiest way to get started with the example-application repository within
234 git clone https://github.com/zephyrproject-rtos/example-application my-app
241 Advanced example-application Usage
244 You can also use the example-application repository as a starting point for
253 The example-application repository contains a :file:`west.yml` file and is
262 git clone https://github.com/zephyrproject-rtos/example-application my-manifest-repo
270 repository will match the example-application's contents when you clone it. You
301 Creating an Application by Hand argument
304 You can follow these steps to create a basic application directory from
305 scratch. However, using the `example-application`_ repository or one of
308 #. Create an application directory.
318 Building Zephyr or creating an application in a directory with spaces
325 It's recommended to place all application source code in a subdirectory
336 #. Place your application source code in the :file:`src` sub-directory. For
364 - ``project(my_zephyr_app)`` defines your application's CMake
373 #. Create at least one Kconfig fragment for your application (usually named
374 :file:`prj.conf`) and set Kconfig option values needed by your application
375 there. See :ref:`application-kconfig`. If no Kconfig options need to be set,
378 #. Configure any devicetree overlays needed by your application, usually in a
410 * :makevar:`BOARD`: Selects the board that the application's build
441 the application build. See :ref:`modules` for details. If you set this
450 the name without the prefix). See :ref:`application-file-suffixes` for details.
459 Application CMakeLists.txt
462 Every application must have a :file:`CMakeLists.txt` file. This file is the
464 image contains both the application and the kernel libraries.
470 configuration for your application on a new line. For example:
493 - Finally, if you set ``BOARD`` in your application :file:`CMakeLists.txt`
496 #. If your application uses a configuration file or files other than
510 #. If your application uses devicetree overlays, you may need to set
514 #. If your application has its own kernel configuration options,
516 application's :file:`CMakeLists.txt`.
521 An (unlikely) advanced use case would be if your application has its own
525 If you just want to set application specific **values** for existing Zephyr
530 .. literalinclude:: application-kconfig.include
543 the application directory, but it is also possible for it to be
547 #. Specify that the application requires Zephyr on a new line, **after any
561 #. Now add any application source files to the 'app' target
580 leverages the application configuration provided by
582 with the hex file generated when building the Zephyr application.
607 Application Configuration
612 Application Configuration Directory
615 Zephyr will use configuration files from the application's configuration
620 The application configuration directory is defined by the
628 ``find_package(Zephyr)`` then this folder is used a the application's
631 2. The application's source directory.
638 Application configuration options are usually set in :file:`prj.conf` in the
639 application directory. For example, C++ support could be enabled with this
675 CMake configure time when you build an application:
716 ``prj.conf`` will be used, no application devicetree overlay will be used.
731 Application-Specific Code
734 Application-specific source code files are normally added to the
735 application's :file:`src` directory. If the application adds a large
739 Application-specific source code should not use symbol name prefixes that have
747 It is possible to build library code outside the application's :file:`src`
748 directory but it is important that both application and library code targets
749 the same Application Binary Interface (ABI). On most architectures there are
755 build system has defined CMake functions that give application build
774 Building an Application
777 The Zephyr build system compiles and links all components of an application
778 into a single application image that can be run on simulated hardware or real
798 choose to use ``west build`` to build your application know that it will
833 #. Navigate to the application directory :file:`<app>`.
834 #. Enter the following commands to build the application's :file:`zephyr.elf`
843 If desired, you can build the application using the configuration settings
845 parameter. These settings will override the settings in the application's
882 * :file:`build.ninja`, which can be invoked to build the application.
894 used to build the application.
903 compiled kernel and application code.
905 * :file:`zephyr.elf`, which contains the final combined application and
911 Rebuilding an Application argument
914 Application development is usually fastest when changes are continually tested.
915 Frequently rebuilding your application makes debugging less painful
916 as the application becomes more complex. It's usually a good idea to
917 rebuild and test after any major changes to the application's source files,
922 The Zephyr build system rebuilds only the parts of the application image
923 potentially affected by the changes. Consequently, rebuilding an application
926 Sometimes the build system doesn't rebuild the application correctly
928 the build system to rebuild the entire application from scratch with the
935 ``west`` or ``cmake`` directly to delete the application's generated
937 application's current configuration information.
951 the application's current configuration information for those board
968 #. Rebuild the application normally following the steps specified
1004 Run an Application
1007 An application image can be run on a real board or emulated hardware.
1016 Follow these instructions to flash and run an application on real
1019 #. Build your application, as described in :ref:`build_an_application`.
1042 Each time you run the flash command, your application is rebuilt and flashed
1062 It allows you to run and test an application virtually, before
1067 Follow these instructions to run an application via QEMU:
1069 #. Build your application for one of the QEMU boards, as described in
1090 #. Press :kbd:`Ctrl A, X` to stop the application from running
1093 The application stops running and the terminal console prompt
1096 Each time you execute the run command, your application is rebuilt and run
1120 to your application without having to add them to the Zephyr tree.
1127 Add the custom board to your application or a dedicated repository using the
1180 Once the board structure is in place, you can build your application
1193 Zephyr binary into your application directory.
1195 You can also define the ``BOARD_ROOT`` variable in the application
1204 be used. Relative paths are treated relatively to the application directory.
1260 Once the SOC structure is in place, you can build your application
1273 Zephyr binary into your application directory.
1278 Or you can define the ``SOC_ROOT`` variable in the application
1287 used. Relative paths are treated relatively to the application directory.
1318 You can also define the variable in the application :file:`CMakeLists.txt`
1327 used. Relative paths are treated relatively to the application directory.
1347 .. _example-application: https://github.com/zephyrproject-rtos/example-application