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 8, 2024
1 parent 3190fa5 commit 75b84b3
Show file tree
Hide file tree
Showing 8 changed files with 768 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
Defining carrier to use, please modify according to region.
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 TRANSMISSIONS_LOST_BEFORE_TIMEOUT
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
107 changes: 107 additions & 0 deletions samples/dect/dect_phy_simple/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
.. _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.

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

The sample needs 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 another.

During initialization the devices listens on a hard-coded channel if another device is broadcasting any 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 34 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:34 '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 35 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:35 '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 in both roles if the user presses button 1, if stop 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 after a given number of transmission cycles, see :kconfig:option:`CONFIG_TX_TRANSMISSION_CYCLES.
Upon exit, the device in the receiving roll will print a simple statistics.
The 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
*******************************************************************************
PRINTOUT RX. NOTE that logging must be on and level INF should be used.
Logging is faster than printk, so the progress uses logging output
RECEIVED DATA, 1386, rssi_2, -50, DATA, 20314, missed/crc errors, 19
RECEIVED DATA, 1387, rssi_2, -50, DATA, 20315, missed/crc errors, 19
...
PCC CRC ERROR, rssi_2, -52, crc error count, 7
RECEIVED DATA, 1389, rssi_2, -50, DATA, 20318, missed/crc errors, 20
...
exit on timeout or button
*********************************************
Received messages 1409
Missed messages 13
CRC errors 7
RSSI_2 AVG (rounded) -53
*********************************************
END OF TEMP
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 ...


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 75b84b3

Please sign in to comment.