Skip to content

Commit 4eb86e9

Browse files
samples: dect: add simple sample
Add simple dect sample. Signed-off-by: Eivind Jølsgard <[email protected]>
1 parent 3190fa5 commit 4eb86e9

File tree

8 files changed

+756
-1
lines changed

8 files changed

+756
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
9+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
10+
project(dect_phy_simple)
11+
12+
FILE(GLOB app_sources src/main.c)
13+
target_sources(app PRIVATE ${app_sources})

samples/dect/dect_phy_simple/Kconfig

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
config CARRIER
8+
int "Carrier to use"
9+
default 1677 #during development, remove default from sample so cutomer must address it?-
10+
help
11+
The availability of the channels and the exact regulation to use them varies in different countries.
12+
See ETSI TS 103 636-2 5.4.2 for the calculation.
13+
14+
config MCS
15+
int
16+
default 1
17+
help
18+
The MCS impacts how much data can be fit into subslots/slots.
19+
This is now hardcoded assuming MCS 1.
20+
21+
config TX_POWER
22+
int "Transmission power"
23+
range 0 11
24+
default 1
25+
help
26+
TX power, 11 == 19 dBm, maximum of the HW(!)
27+
28+
config TX_INTERVAL_SECONDS
29+
int "Transmission interval in seconds"
30+
default 5
31+
32+
config TX_TRANSMISSION_CYCLES_BEFORE_EXIT
33+
int "Number of transmissions lost before receiver device times out"
34+
default 3
35+
36+
module = DECT_PHY_SIMPLE
37+
module-str = DECT NR+ PHY simple sample
38+
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"
39+
40+
menu "Zephyr Kernel"
41+
source "Kconfig.zephyr"
42+
endmenu
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
.. _nrf_modem_dect_phy_simple:
2+
3+
nRF91x1: DECT NR+ PHY simple sample
4+
###################################
5+
6+
.. contents::
7+
:local:
8+
:depth: 2
9+
10+
This sample demonstrates how to set up a simple DECT NR+ application with the DECT PHY modem firmware.
11+
12+
.. important::
13+
14+
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.
15+
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.
16+
17+
Requirements
18+
************
19+
20+
The sample needs at least two nRF91x1 Development Kits.
21+
22+
See :ref:`nrf91x1_ug_intro` for more details.
23+
24+
.. note::
25+
26+
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.
27+
28+
29+
.. include:: /includes/tfm.txt
30+
31+
Overview
32+
********
33+
34+
The sample shows a simple broadcast of DECT NR+ messages from one device that is received on other devices.
35+
36+
During initialization the devices listens on a hard-coded channel for another device that is broadcasting messages.
37+
Dependent on the detection of messages, the device takes one of the following roles:
38+
39+
* 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.
40+
* If a transmission is detected, the device takes the role as a receiver. In this role, the device will listen for incomming messages.
41+
Comparing the counter value with the previous, it can detect if one or more messages were lost in transmission.
42+
43+
The device will exit the sample if the user presses button 1, ``exit`` is entered in the terminal or if an irrecoverable error occurs.
44+
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.
45+
46+
Upon exit, devices in the receiving role will print a simple statistics.
47+
Each device can be reset to run the sample again.
48+
49+
TX Mode: led 1 on, led 2 blinks
50+
RX mode: led 1 off, led 2 blinks
51+
52+
User interface
53+
***************
54+
55+
Button 1:
56+
Exits the sample.
57+
58+
59+
Building and running
60+
********************
61+
62+
.. |sample path| replace:: :file:`samples/modem_trace_flash`
63+
64+
.. include:: /includes/build_and_run_ns.txt
65+
66+
Testing
67+
=======
68+
69+
|test_sample|
70+
71+
After programming the sample to your development kits, test it by performing the following steps:
72+
73+
#. |connect_kit|
74+
#. |connect_terminal|
75+
#. 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.
76+
#. Observe that the transmitter device will transmit a counter value that is received by the other devices.
77+
#. Press button 1 on the transmitter device. Observe that the device stops transmitting, and the other devices stop receiving.
78+
#. After some time, observe that the receiver devices prints the simple statistics and exit the sample.
79+
80+
81+
Dependencies
82+
************
83+
84+
It uses the following `sdk-nrfxlib`_ libraries:
85+
86+
* :ref:`nrfxlib:nrf_modem`
87+
88+
It uses the following Zephyr libraries:
89+
90+
* :ref:`zephyr:uart_api`
91+
92+
93+
In addition, it uses the following secure firmware components:
94+
95+
* :ref:`Trusted Firmware-M <ug_tfm>`

samples/dect/dect_phy_simple/prj.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_DK_LIBRARY=y
2+
CONFIG_LOG=y
3+
4+
CONFIG_MODEM_ANTENNA_AT_MAGPIO=""
5+
CONFIG_MODEM_ANTENNA_AT_COEX0=""
6+
7+
CONFIG_NRF_MODEM_LIB=y
8+
9+
CONFIG_NRF_MODEM_LINK_BINARY_DECT_PHY=y
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sample:
2+
name: Modem trace flash
3+
tests:
4+
sample.nrf9160.modem_trace_flash:
5+
build_only: true
6+
integration_platforms:
7+
- nrf9160dk_nrf9160_ns
8+
platform_allow: nrf9160dk_nrf9160_ns
9+
tags: ci_build

0 commit comments

Comments
 (0)