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 Mar 21, 2024
1 parent 3190fa5 commit ab567a5
Show file tree
Hide file tree
Showing 8 changed files with 739 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})
14 changes: 14 additions & 0 deletions samples/dect/dect_phy_simple/Kconfig
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
#


module = DECT_PHY_SIMPLE
module-str = Dect Phy simple
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"

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

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.


.. 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 every x seconds (Kconfig ref) on the hard-coded channel.
* If a transmission is detected, the device takes the role as a receiver. In this role, the device will listen for incomming messages.
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, stop is entered in the terminal or an irrecoverable error occurs.
A device in the receiving role will also exit if no message is received within x seconds.

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>`
7 changes: 7 additions & 0 deletions samples/dect/dect_phy_simple/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONFIG_DK_LIBRARY=y
CONFIG_LOG=y

CONFIG_MODEM_ANTENNA_AT_MAGPIO=""
CONFIG_MODEM_ANTENNA_AT_COEX0=""

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 ab567a5

Please sign in to comment.