Skip to content

Commit

Permalink
[nrf noup] treewide: Adapt to NCS
Browse files Browse the repository at this point in the history
Adapt original Zephyr repo to NCS, including the manifest and the doc.

Signed-off-by: Carles Cufi <[email protected]>
Signed-off-by: Markus Tacker <[email protected]>
Signed-off-by: Pekka Niskanen <[email protected]>
Signed-off-by: Jamie McCrae <[email protected]>
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Signed-off-by: Gerard Marull-Paretas <[email protected]>
  • Loading branch information
carlescufi authored and gmarull committed May 2, 2024
1 parent ca6f534 commit 9d60f65
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 76 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @gmarull @carlescufi
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Zephyr Example Application
# nRF Connect SDK example application

<a href="https://zephyrproject-rtos.github.io/example-application">
<a href="https://nrfconnect.github.io/ncs-example-application">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-3D578C?logo=sphinx&logoColor=white">
</a>
<a href="https://zephyrproject-rtos.github.io/example-application/doxygen">
<a href="https://nrfconnect.github.io/ncs-example-application/doxygen">
<img alt="API Documentation" src="https://img.shields.io/badge/API-documentation-3D578C?logo=c&logoColor=white">
</a>

This repository contains a Zephyr example application. The main purpose of this
repository is to serve as a reference on how to structure Zephyr-based
applications. Some of the features demonstrated in this example are:
This repository contains an nRF Connect SDK example application. The main
purpose of this repository is to serve as a reference on how to structure nRF Connect
SDK based applications. Some of the features demonstrated in this example are:

- Basic [Zephyr application][app_dev] skeleton
- [Zephyr workspace applications][workspace_app]
Expand All @@ -23,12 +23,12 @@ applications. Some of the features demonstrated in this example are:
- Custom [west extension][west_ext]
- Doxygen and Sphinx documentation boilerplate

This repository is versioned together with the [Zephyr main tree][zephyr]. This
means that every time that Zephyr is tagged, this repository is tagged as well
This repository is versioned together with the [nRF Connect SDK main tree][sdk-nrf]. This
means that every time that nRF Connect SDK is tagged, this repository is tagged as well
with the same version number, and the [manifest](west.yml) entry for `zephyr`
will point to the corresponding Zephyr tag. For example, the `example-application`
v2.6.0 will point to Zephyr v2.6.0. Note that the `main` branch always
points to the development branch of Zephyr, also `main`.
will point to the corresponding nRF Connect SDK tag. For example, the `ncs-example-application`
v2.5.0 will point to nRF Connect SDK v2.5.0. Note that the `main` branch always
points to the development branch of nRF Connect SDK, also `main`.

[app_dev]: https://docs.zephyrproject.org/latest/develop/application/index.html
[workspace_app]: https://docs.zephyrproject.org/latest/develop/application/index.html#zephyr-workspace-app
Expand All @@ -37,25 +37,25 @@ points to the development branch of Zephyr, also `main`.
[board_porting]: https://docs.zephyrproject.org/latest/guides/porting/board_porting.html
[bindings]: https://docs.zephyrproject.org/latest/guides/dts/bindings.html
[drivers]: https://docs.zephyrproject.org/latest/reference/drivers/index.html
[zephyr]: https://github.com/zephyrproject-rtos/zephyr
[sdk-nrf]: https://github.com/nrfconnect/sdk-nrf
[west_ext]: https://docs.zephyrproject.org/latest/develop/west/extensions.html

## Getting Started
## Getting started

Before getting started, make sure you have a proper Zephyr development
environment. Follow the official
[Zephyr Getting Started Guide](https://docs.zephyrproject.org/latest/getting_started/index.html).
Before getting started, make sure you have a proper nRF Connect SDK development environment.
Follow the official
[Installation guide](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/installation/install_ncs.html).

### Initialization

The first step is to initialize the workspace folder (``my-workspace``) where
the ``example-application`` and all Zephyr modules will be cloned. Run the following
the ``example-application`` and all nRF Connect SDK modules will be cloned. Run the following
command:

```shell
# initialize my-workspace for the example-application (main branch)
west init -m https://github.com/zephyrproject-rtos/example-application --mr main my-workspace
# update Zephyr modules
# initialize my-workspace for the ncs-example-application (main branch)
west init -m https://github.com/nrfconnect/ncs-example-application --mr main my-workspace
# update nRF Connect SDK modules
cd my-workspace
west update
```
Expand All @@ -71,9 +71,8 @@ west build -b $BOARD app

where `$BOARD` is the target board.

You can use the `custom_plank` board found in this
repository. Note that Zephyr sample boards may be used if an
appropriate overlay is provided (see `app/boards`).
You can use the `custom_plank` board found in this repository. Note that you can use
Zephyr and nRF Connect SDK sample boards if an appropriate overlay is provided (see `app/boards`).

A sample debug configuration is also provided. To apply it, run the following
command:
Expand Down
27 changes: 0 additions & 27 deletions app/boards/nucleo_f302r8.overlay

This file was deleted.

3 changes: 1 addition & 2 deletions app/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
# so that you can easily test all of them locally or in CI.
sample:
description: Example application
name: example-application
name: example-application
common:
build_only: true
integration_platforms:
- custom_plank
- nucleo_f302r8
tests:
app.default: {}
app.debug:
Expand Down
16 changes: 12 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Example Application'
project = 'NCS Example Application'
copyright = '2024, The Zephyr Community'
author = 'The Zephyr Community'
release = '1.0.0'
Expand All @@ -27,14 +27,22 @@
# -- Options for Intersphinx -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html

intersphinx_mapping = {'zephyr': ('https://docs.zephyrproject.org/latest/', None)}
intersphinx_mapping = {
'ncs': ('https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/', None),
'nrfx': ('https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/', None),
'nrfxlib': ('https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/', None),
'zephyr': ('https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/', None),
'mcuboot': ('https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/', None),
'tfm': ('https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/tfm/', None),
'matter': ('https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/matter/', None),
}

## -- Options for Breathe ----------------------------------------------------
# https://breathe.readthedocs.io/en/latest/index.html
#
# WARNING: please, check breathe maintainership status before using this
# extension in production!

breathe_projects = {'example-application': '_build_doxygen/xml'}
breathe_default_project = 'example-application'
breathe_projects = {'ncs-example-application': '_build_doxygen/xml'}
breathe_default_project = 'ncs-example-application'
breathe_default_members = ('members', )
8 changes: 4 additions & 4 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Welcome to Example Application's documentation!
===============================================
Welcome to NCS Example Application's documentation!
===================================================

This is a simple Sphinx documentation setup for ``example-application``.
This is a simple Sphinx documentation setup for ``ncs-example-application``.

.. toctree::
:maxdepth: 2
:caption: Contents

drivers/index
lib/index
zephyr
references

Indices and tables
==================
Expand Down
13 changes: 13 additions & 0 deletions doc/references.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
References
==========

You can easily reference items on the NCS documentation from all docsets,
including anchors, functions, files... For example:

* NCS: :external+ncs:ref:`create_application`, :external+ncs:c:func:`bt_scan_start`
* nrfx: :external+nrfx:c:func:`nrf_comp_enable`
* nrfxlib: :external+nrfxlib:ref:`nrf_modem`, :external+nrfxlib:c:func:`nrf_modem_init`
* Zephyr: :external+zephyr:ref:`getting_started`, :external+zephyr:c:func:`k_sleep`
* mcuboot: :external+mcuboot:doc:`index-ncs`
* Trusted Firmware-M: :external+tfm:ref:`tf-m_configuration`
* Matter: :external+matter:ref:`matter_index`
5 changes: 0 additions & 5 deletions doc/zephyr.rst

This file was deleted.

17 changes: 6 additions & 11 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ manifest:
west-commands: scripts/west-commands.yml

remotes:
- name: zephyrproject-rtos
url-base: https://github.com/zephyrproject-rtos
- name: ncs
url-base: https://github.com/nrfconnect

projects:
- name: zephyr
remote: zephyrproject-rtos
- name: nrf
remote: ncs
repo-path: sdk-nrf
revision: main
import:
# By using name-allowlist we can clone only the modules that are
# strictly needed by the application.
name-allowlist:
- cmsis # required by the ARM port
- hal_nordic # required by the custom_plank board (Nordic based)
- hal_stm32 # required by the nucleo_f302r8 board (STM32 based)
import: true

0 comments on commit 9d60f65

Please sign in to comment.