Skip to content

Commit

Permalink
samples: dect: add simple sample
Browse files Browse the repository at this point in the history
Add simple dect sample.

Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
  • Loading branch information
eivindj-nordic committed Apr 9, 2024
1 parent 3190fa5 commit 4eb86e9
Show file tree
Hide file tree
Showing 8 changed files with 756 additions and 1 deletion.
13 changes: 13 additions & 0 deletions samples/dect/dect_phy_simple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(dect_phy_simple)

FILE(GLOB app_sources src/main.c)
target_sources(app PRIVATE ${app_sources})
42 changes: 42 additions & 0 deletions samples/dect/dect_phy_simple/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config CARRIER
int "Carrier to use"
default 1677 #during development, remove default from sample so cutomer must address it?-
help
The availability of the channels and the exact regulation to use them varies in different countries.
See ETSI TS 103 636-2 5.4.2 for the calculation.

config MCS
int
default 1
help
The MCS impacts how much data can be fit into subslots/slots.
This is now hardcoded assuming MCS 1.

config TX_POWER
int "Transmission power"
range 0 11
default 1
help
TX power, 11 == 19 dBm, maximum of the HW(!)

config TX_INTERVAL_SECONDS
int "Transmission interval in seconds"
default 5

config TX_TRANSMISSION_CYCLES_BEFORE_EXIT
int "Number of transmissions lost before receiver device times out"
default 3

module = DECT_PHY_SIMPLE
module-str = DECT NR+ PHY simple sample
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"

menu "Zephyr Kernel"
source "Kconfig.zephyr"
endmenu
95 changes: 95 additions & 0 deletions samples/dect/dect_phy_simple/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
.. _nrf_modem_dect_phy_simple:

nRF91x1: DECT NR+ PHY simple sample
###################################

.. contents::
:local:
:depth: 2

This sample demonstrates how to set up a simple DECT NR+ application with the DECT PHY modem firmware.

.. important::

DECT NR+ operates on free but regulated radio channels. The availability of the channels and the exact regulation to use them varies in different countries.
It is the responsibility of the developer to operate the devices according to the local regulation, at development site and at the installation locations of the devices.

Requirements
************

The sample needs at least two nRF91x1 Development Kits.

See :ref:`nrf91x1_ug_intro` for more details.

.. note::

The :ref:`nrf_modem_dect_phy_simple` require a special modem firmware to run on the nRF91x1 modem core. Please contact our sales department to know more.


.. include:: /includes/tfm.txt

Overview
********

The sample shows a simple broadcast of DECT NR+ messages from one device that is received on other devices.

During initialization the devices listens on a hard-coded channel for another device that is broadcasting messages.
Dependent on the detection of messages, the device takes one of the following roles:

* If no transmission is detected, the device takes the role as a tranceiver. In this role, the device sends an incrementing counter value on the hard-coded channel. The period between each transmission is decided by the :kconfig:option:`CONFIG_TX_INTERVAL_SECONDS` Kconfig option.

Check warning on line 39 in samples/dect/dect_phy_simple/README.rst

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TYPO_SPELLING

samples/dect/dect_phy_simple/README.rst:39 'tranceiver' may be misspelled - perhaps 'transceiver'?
* If a transmission is detected, the device takes the role as a receiver. In this role, the device will listen for incomming messages.

Check warning on line 40 in samples/dect/dect_phy_simple/README.rst

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TYPO_SPELLING

samples/dect/dect_phy_simple/README.rst:40 'incomming' may be misspelled - perhaps 'incoming'?
Comparing the counter value with the previous, it can detect if one or more messages were lost in transmission.

The device will exit the sample if the user presses button 1, ``exit`` is entered in the terminal or if an irrecoverable error occurs.
A device in the receiving role will also exit if no message is received within a given number of transmission cycles, see :kconfig:option:`CONFIG_TX_TRANSMISSION_CYCLES_BEFORE_EXIT.
Upon exit, devices in the receiving role will print a simple statistics.
Each device can be reset to run the sample again.
TX Mode: led 1 on, led 2 blinks
RX mode: led 1 off, led 2 blinks
User interface
***************
Button 1:
Exits the sample.
Building and running
********************
.. |sample path| replace:: :file:`samples/modem_trace_flash`

.. include:: /includes/build_and_run_ns.txt

Testing
=======

|test_sample|

After programming the sample to your development kits, test it by performing the following steps:

#. |connect_kit|
#. |connect_terminal|
#. Observe that the device will start listening for incomming data. If data is received, the device will take the receiver role, if not the device will take the transmitter role.

Check warning on line 75 in samples/dect/dect_phy_simple/README.rst

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TYPO_SPELLING

samples/dect/dect_phy_simple/README.rst:75 'incomming' may be misspelled - perhaps 'incoming'?
#. Observe that the transmitter device will transmit a counter value that is received by the other devices.
#. Press button 1 on the transmitter device. Observe that the device stops transmitting, and the other devices stop receiving.
#. After some time, observe that the receiver devices prints the simple statistics and exit the sample.


Dependencies
************

It uses the following `sdk-nrfxlib`_ libraries:

* :ref:`nrfxlib:nrf_modem`

It uses the following Zephyr libraries:

* :ref:`zephyr:uart_api`


In addition, it uses the following secure firmware components:

* :ref:`Trusted Firmware-M <ug_tfm>`
9 changes: 9 additions & 0 deletions samples/dect/dect_phy_simple/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CONFIG_DK_LIBRARY=y
CONFIG_LOG=y

CONFIG_MODEM_ANTENNA_AT_MAGPIO=""
CONFIG_MODEM_ANTENNA_AT_COEX0=""

CONFIG_NRF_MODEM_LIB=y

CONFIG_NRF_MODEM_LINK_BINARY_DECT_PHY=y
9 changes: 9 additions & 0 deletions samples/dect/dect_phy_simple/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sample:
name: Modem trace flash
tests:
sample.nrf9160.modem_trace_flash:
build_only: true
integration_platforms:
- nrf9160dk_nrf9160_ns
platform_allow: nrf9160dk_nrf9160_ns
tags: ci_build
Loading

0 comments on commit 4eb86e9

Please sign in to comment.