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 22, 2024
1 parent 3190fa5 commit 95ee4a7
Show file tree
Hide file tree
Showing 8 changed files with 757 additions and 1 deletion.
14 changes: 14 additions & 0 deletions samples/dect/dect_phy/hello_dect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# 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(hello_dect)

# NORDIC SDK APP START
target_sources(app PRIVATE src/main.c)
# NORDIC SDK APP END
42 changes: 42 additions & 0 deletions samples/dect/dect_phy/hello_dect/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_HELLO
module-str = DECT NR+ PHY hello DECT
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/hello_dect/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
.. _nrf_modem_dect_phy_hello:

nRF91x1: DECT NR+ PHY hello 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 regulation and availability of the channels varies in different countries.
It is the responsibility of the developer to operate the devices according to the local regulation, both at the development site and the device operation regions.

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 to other devices on a hard-coded channel.

During initialization the devices listens on the channel for broadcast transmissions.
Dependent on the detection of transmissions, 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.
* If a transmission is detected, the device takes the role as a receiver. In this role, the device listens for incomming messages.
By comparing the counter value with the previous one, the device detects if messages are 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.
#. 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/hello_dect/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/hello_dect/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 95ee4a7

Please sign in to comment.