|
1 |
| -# example-application |
2 |
| -Example out-of-tree application that is also a module |
| 1 | +# Zephyr Example Application |
| 2 | + |
| 3 | +This repository contains a Zephyr example application. The main purpose of this |
| 4 | +repository is to serve as a reference on how to structure Zephyr based |
| 5 | +applications. Some of the features demonstrated in this example are: |
| 6 | + |
| 7 | +- Basic application skeleton |
| 8 | +- [Custom boards][board_porting] |
| 9 | +- Custom [devicetree bindings][bindings] |
| 10 | +- Out-of-tree [drivers][drivers] |
| 11 | +- Documentation using Doxygen and Sphinx |
| 12 | +- Example CI configuration (using Github Actions) |
| 13 | + |
| 14 | +[board_porting]: https://docs.zephyrproject.org/latest/guides/porting/board_porting.html |
| 15 | +[bindings]: https://docs.zephyrproject.org/latest/guides/dts/bindings.html |
| 16 | +[drivers]: https://docs.zephyrproject.org/latest/reference/drivers/index.html |
| 17 | + |
| 18 | +## Getting Started |
| 19 | + |
| 20 | +Before getting started, make sure you have a proper Zephyr development |
| 21 | +environment. You can follow the official |
| 22 | +[Zephyr Getting Started Guide](https://docs.zephyrproject.org/latest/getting_started/index.html). |
| 23 | + |
| 24 | +### Initialization |
| 25 | + |
| 26 | +The first step is to initialize the workspace folder (``my-workspace``) where |
| 27 | +the ``example-application`` and all Zephyr modules will be cloned. You can do |
| 28 | +that by running: |
| 29 | + |
| 30 | +```shell |
| 31 | +# initialize my-workspace for the example-application (main branch) |
| 32 | +west init -m https://github.com/zephyrproject-rtos/example-application --mr main my-workspace |
| 33 | +# update Zephyr modules |
| 34 | +cd my-workspace |
| 35 | +west update |
| 36 | +``` |
| 37 | + |
| 38 | +### Build & Run |
| 39 | + |
| 40 | +The application can be built by running: |
| 41 | + |
| 42 | +```shell |
| 43 | +west build -b $BOARD -s app |
| 44 | +``` |
| 45 | + |
| 46 | +where `$BOARD` is the target board. A sample debug configuration is also |
| 47 | +provided. You can apply it by running: |
| 48 | + |
| 49 | +```shell |
| 50 | +west build -b $BOARD -s app -- -DOVERLAY_CONFIG=debug.conf |
| 51 | +``` |
| 52 | + |
| 53 | +Note that you may also use it together with `rtt.conf` if using Segger RTT. Once |
| 54 | +you have built the application you can flash it by running: |
| 55 | + |
| 56 | +```shell |
| 57 | +west flash |
| 58 | +``` |
0 commit comments