diff --git a/samples/wifi/radio_test/CMakeLists.txt b/samples/wifi/radio_test/multi_domain/CMakeLists.txt similarity index 100% rename from samples/wifi/radio_test/CMakeLists.txt rename to samples/wifi/radio_test/multi_domain/CMakeLists.txt diff --git a/samples/wifi/radio_test/Kconfig.sysbuild b/samples/wifi/radio_test/multi_domain/Kconfig.sysbuild similarity index 100% rename from samples/wifi/radio_test/Kconfig.sysbuild rename to samples/wifi/radio_test/multi_domain/Kconfig.sysbuild diff --git a/samples/wifi/radio_test/README.rst b/samples/wifi/radio_test/multi_domain/README.rst similarity index 100% rename from samples/wifi/radio_test/README.rst rename to samples/wifi/radio_test/multi_domain/README.rst diff --git a/samples/wifi/radio_test/boards/thingy91x_nrf9151_ns.overlay b/samples/wifi/radio_test/multi_domain/boards/thingy91x_nrf9151_ns.overlay similarity index 100% rename from samples/wifi/radio_test/boards/thingy91x_nrf9151_ns.overlay rename to samples/wifi/radio_test/multi_domain/boards/thingy91x_nrf9151_ns.overlay diff --git a/samples/wifi/radio_test/ficr.rst b/samples/wifi/radio_test/multi_domain/ficr.rst similarity index 100% rename from samples/wifi/radio_test/ficr.rst rename to samples/wifi/radio_test/multi_domain/ficr.rst diff --git a/samples/wifi/radio_test/inc/nrf_wifi_radio_test_shell.h b/samples/wifi/radio_test/multi_domain/inc/nrf_wifi_radio_test_shell.h similarity index 100% rename from samples/wifi/radio_test/inc/nrf_wifi_radio_test_shell.h rename to samples/wifi/radio_test/multi_domain/inc/nrf_wifi_radio_test_shell.h diff --git a/samples/wifi/radio_test/prj.conf b/samples/wifi/radio_test/multi_domain/prj.conf similarity index 100% rename from samples/wifi/radio_test/prj.conf rename to samples/wifi/radio_test/multi_domain/prj.conf diff --git a/samples/wifi/radio_test/radio_test_subcommands.rst b/samples/wifi/radio_test/multi_domain/radio_test_subcommands.rst similarity index 100% rename from samples/wifi/radio_test/radio_test_subcommands.rst rename to samples/wifi/radio_test/multi_domain/radio_test_subcommands.rst diff --git a/samples/wifi/radio_test/sample.yaml b/samples/wifi/radio_test/multi_domain/sample.yaml similarity index 96% rename from samples/wifi/radio_test/sample.yaml rename to samples/wifi/radio_test/multi_domain/sample.yaml index d8285a70f996..76c1843c9c2a 100644 --- a/samples/wifi/radio_test/sample.yaml +++ b/samples/wifi/radio_test/multi_domain/sample.yaml @@ -63,7 +63,7 @@ tests: sample.nrf7002_eb.thingy53.radio_test: sysbuild: true build_only: true - extra_args: radio_test_SHIELD=nrf7002eb + extra_args: multi_domain_SHIELD=nrf7002eb integration_platforms: - thingy53/nrf5340/cpuapp platform_allow: thingy53/nrf5340/cpuapp @@ -78,7 +78,7 @@ tests: build_only: true extra_args: - FILE_SUFFIX=wifi_combo - - radio_test_SHIELD="nrf7002eb_interposer_p1;nrf7002eb" + - multi_domain_SHIELD="nrf7002eb_interposer_p1;nrf7002eb" - SNIPPET=nrf70-wifi integration_platforms: - nrf54h20dk/nrf54h20/cpuapp diff --git a/samples/wifi/radio_test/sample_description.rst b/samples/wifi/radio_test/multi_domain/sample_description.rst similarity index 100% rename from samples/wifi/radio_test/sample_description.rst rename to samples/wifi/radio_test/multi_domain/sample_description.rst diff --git a/samples/wifi/radio_test/src/ficr_prog.c b/samples/wifi/radio_test/multi_domain/src/ficr_prog.c similarity index 100% rename from samples/wifi/radio_test/src/ficr_prog.c rename to samples/wifi/radio_test/multi_domain/src/ficr_prog.c diff --git a/samples/wifi/radio_test/src/ficr_prog.h b/samples/wifi/radio_test/multi_domain/src/ficr_prog.h similarity index 100% rename from samples/wifi/radio_test/src/ficr_prog.h rename to samples/wifi/radio_test/multi_domain/src/ficr_prog.h diff --git a/samples/wifi/radio_test/src/nrf_wifi_radio_ficr_shell.c b/samples/wifi/radio_test/multi_domain/src/nrf_wifi_radio_ficr_shell.c similarity index 100% rename from samples/wifi/radio_test/src/nrf_wifi_radio_ficr_shell.c rename to samples/wifi/radio_test/multi_domain/src/nrf_wifi_radio_ficr_shell.c diff --git a/samples/wifi/radio_test/src/nrf_wifi_radio_test_main.c b/samples/wifi/radio_test/multi_domain/src/nrf_wifi_radio_test_main.c similarity index 100% rename from samples/wifi/radio_test/src/nrf_wifi_radio_test_main.c rename to samples/wifi/radio_test/multi_domain/src/nrf_wifi_radio_test_main.c diff --git a/samples/wifi/radio_test/src/nrf_wifi_radio_test_shell.c b/samples/wifi/radio_test/multi_domain/src/nrf_wifi_radio_test_shell.c similarity index 100% rename from samples/wifi/radio_test/src/nrf_wifi_radio_test_shell.c rename to samples/wifi/radio_test/multi_domain/src/nrf_wifi_radio_test_shell.c diff --git a/samples/wifi/radio_test/sysbuild.conf b/samples/wifi/radio_test/multi_domain/sysbuild.conf similarity index 100% rename from samples/wifi/radio_test/sysbuild.conf rename to samples/wifi/radio_test/multi_domain/sysbuild.conf diff --git a/samples/wifi/radio_test/single_domain/CMakeLists.txt b/samples/wifi/radio_test/single_domain/CMakeLists.txt new file mode 100644 index 000000000000..6c5f0c01e025 --- /dev/null +++ b/samples/wifi/radio_test/single_domain/CMakeLists.txt @@ -0,0 +1,23 @@ +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(wifi_ble_radio_test) + +target_include_directories(app PRIVATE + inc +) + +# Application sources +FILE(GLOB app_sources src/*.c) + +# NORDIC SDK APP START +target_sources(app PRIVATE + ${app_sources} +) +# NORDIC SDK APP END diff --git a/samples/wifi/radio_test/single_domain/Kconfig b/samples/wifi/radio_test/single_domain/Kconfig new file mode 100644 index 000000000000..599b714ae1db --- /dev/null +++ b/samples/wifi/radio_test/single_domain/Kconfig @@ -0,0 +1,27 @@ +# +# Copyright (c) 2020 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +mainmenu "Nordic Wi-Fi BLE Radio test sample" + +config RADIO_TEST_SD_POWER_CONTROL_AUTOMATIC + bool "Automatic power control" + depends on FEM + default y + help + Set SoC output power and front-end module gain to achieve Tx output power requested + by user. If the exact value cannot be achieved, power is set to closest value which does + not exceed the limits. If this option is disabled, user has to set SoC output power and + fem gain with separate commands. + +config RADIO_TEST_SD_RX_TIMEOUT + int "RX packet reception timeout" + default 10 + help + Specifies the time in seconds that the application waits for the first packet to be + received in RX mode when a specified number of packets are set to be received. + If the timeout is reached before the first packet is received, the radio will be disabled. + +source "Kconfig.zephyr" diff --git a/samples/wifi/radio_test/single_domain/README.rst b/samples/wifi/radio_test/single_domain/README.rst new file mode 100644 index 000000000000..abdcd90c994b --- /dev/null +++ b/samples/wifi/radio_test/single_domain/README.rst @@ -0,0 +1,20 @@ +.. _wifi_radio_test_sd: + +Wi-Fi BLE Radio Test Sample +########################### + +The Wi-Fi BLE Radio Test sample demonstrates how to use the radio test for both Wi-Fi and BLE protocols using a single domain image i.e., both running on the same core. +The sample demonstrates how to use the radio test subcommands to configure the radio test parameters and run the radio test. + +The Wi-Fi Radio test also supports programming the Factory Information Configuration Registers (FICR) fields defined in the nRF7002 one-time programmable (OTP) memory. + +See the subpages for detailed documentation on the sample and its features. + +.. toctree:: + :maxdepth: 1 + :caption: Subpages: + + sample_description.rst + peripheral_radio_test.rst + radio_test_subcommands.rst + ficr.rst diff --git a/samples/wifi/radio_test/single_domain/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/wifi/radio_test/single_domain/boards/nrf54l15dk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..e029d65ce7bf --- /dev/null +++ b/samples/wifi/radio_test/single_domain/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable the unsupported driver +CONFIG_NRFX_TIMER0=n + +# Enable the necessary drivers +CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_GPPI=y diff --git a/samples/wifi/radio_test/single_domain/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/wifi/radio_test/single_domain/boards/nrf54l15pdk_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..482eca1189d6 --- /dev/null +++ b/samples/wifi/radio_test/single_domain/boards/nrf54l15pdk_nrf54l15_cpuapp.conf @@ -0,0 +1,12 @@ +# +# Copyright (c) 2023 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# Disable the unsupported driver +CONFIG_NRFX_TIMER0=n + +# Enable the necessary drivers +CONFIG_NRFX_TIMER10=y +CONFIG_NRFX_GPPI=y diff --git a/samples/wifi/radio_test/single_domain/ficr.rst b/samples/wifi/radio_test/single_domain/ficr.rst new file mode 100644 index 000000000000..aa3b80857716 --- /dev/null +++ b/samples/wifi/radio_test/single_domain/ficr.rst @@ -0,0 +1,104 @@ +.. _wifi_ficr_prog: + +FICR programming subcommands +############################ + +.. contents:: + :local: + :depth: 2 + +``wifi_radio_ficr_prog`` is the Wi-Fi® radio FICR programming command and it supports the following subcommands. + +.. _wifi_radio_ficr_prog_subcmds: + +Wi-Fi radio FICR subcommands +**************************** + +.. list-table:: Wi-Fi radio FICR subcommands + :widths: 15 15 10 30 70 + :header-rows: 1 + + * - Subcommand + - Register + - Offset + - Argument(s) + - Description + * - otp_get_status + - N/A + - N/A + - N/A + - Reads out the OTP status of user region and status of each field (programmed or not). + * - otp_read_params + - N/A + - N/A + - N/A + - Reads out all the OTP parameters (excluding QSPI_KEY which cannot be read). + * - otp_read_retrim_version + - PRODRETEST.PROGVERSION + - N/A + - N/A + - Reads out program version of Retrim parameters. + * - otp_read_retrim_params + - PRODRETEST.TRIM[n] + - N/A + - N/A + - Reads out all the Retrim parameters. + * - otp_write_params + - REGION_PROTECT + - 0x100 + - arg + - | arg = 0x50FA50FA : Enable R/W permission + | arg = 0x00000000 : Lock Region from Writing + | arg = Others : Invalid + | All four REGION_PROTECT registers are written with this 32-bit argument. + * - otp_write_params + - QSPI_KEY + - 0x110 + - arg1 arg2 arg3 arg4 + - | All four key arguments are 32-bit values forming the required 128-bit (Q)SPI key for encryption. + | For example, if QSPI key is "112233445566778899aabbccddeeff00" then arg1=0x44332211 arg2=0x88776655 arg3=0xccbbaa99 arg4=0x00ffeedd + * - otp_write_params + - MAC_ADDRESS0 + - 0x120 + - arg1 arg2 + - If MAC address is AA:BB:CC:DD:EE:FF, then arg1=0xDDCCBBAA and arg2=0xFFEE. + * - otp_write_params + - MAC_ADDRESS1 + - 0x128 + - arg1 arg2 + - If MAC address is AA:BB:CC:DD:EE:FF, then arg1=0xDDCCBBAA and arg2=0xFFEE. + * - otp_write_params + - CALIB_XO + - 0x130 + - arg + - arg is 7-bit unsigned XO value. Bits [31:7] unused. Adjusts capacitor bank, 0 : Lowest capacitance (Highest frequency), 127 : Highest capacitance (Lowest frequency). + * - otp_write_params + - REGION_DEFAULTS + - 0x154 + - arg + - | Register default enable control. + | arg is 32-bit value where a specific bit is set to ``0`` implies that the corresponding OTP field is programmed. The following list shows the bit and field mapping: + | + | bit 0 : QSPI_KEY + | bit 1 : MAC0 Address + | bit 2 : MAC1 Address + | bit 3 : CALIB_XO + | bit 4 : Reserved + | bit 5 : Reserved + | bit 6 : Reserved + | bit 7 : Reserved + | bit 8 : Reserved + | bit 9 : Reserved + | bit 10 : Reserved + | bit 11 : Reserved + | bit 12-31 : Reserved + * - otp_write_retrim_version + - PRODRETEST.PROGVERSION + - N/A + - arg + - arg is 32-bit data. + * - otp_write_retrim_params + - PRODRETEST.TRIM[n] + - index between (0-14) + - arg + - arg is 32-bit data. When index = 5, PRODRETEST.TRIM[5] is written with 32-bit argument. diff --git a/samples/wifi/radio_test/single_domain/inc/nrf_wifi_radio_test_shell.h b/samples/wifi/radio_test/single_domain/inc/nrf_wifi_radio_test_shell.h new file mode 100644 index 000000000000..6105c91cf456 --- /dev/null +++ b/samples/wifi/radio_test/single_domain/inc/nrf_wifi_radio_test_shell.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2022 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* @file + * @brief nRF Wi-Fi radio-test mode shell module + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct nrf_wifi_ctx_zep_rt { + struct nrf_wifi_fmac_priv *fmac_priv; + struct rpu_conf_params conf_params; +}; diff --git a/samples/wifi/radio_test/single_domain/peripheral_radio_test.rst b/samples/wifi/radio_test/single_domain/peripheral_radio_test.rst new file mode 100644 index 000000000000..127f19170ca8 --- /dev/null +++ b/samples/wifi/radio_test/single_domain/peripheral_radio_test.rst @@ -0,0 +1,305 @@ +.. _radio_test_sd: + +Radio test (short-range) +######################## + +.. contents:: + :local: + :depth: 2 + +The Radio test sample demonstrates how to configure the 2.4 GHz short-range radio (Bluetooth® LE, IEEE 802.15.4 and proprietary) in a specific mode and then test its performance. +The sample provides a set of predefined commands that allow you to configure the radio in three modes: + +* Constant RX or TX carrier +* Modulated TX carrier +* RX or TX sweep + +Requirements +************ + +The sample supports the following development kits: + +.. table-from-sample-yaml:: + +You can use any one of the development kits listed above. + +.. note:: + On nRF5340 DK and nRF7002 DK, the sample is designed to run on the network core and requires the :ref:`nrf5340_remote_shell` running on the application core. + This sample uses the :ref:`shell_ipc_readme` library to forward shell data through the physical UART interface of the application core. + +The sample also requires one of the following testing devices: + + * Another development kit with the same sample. + See :ref:`radio_test_testing_board`. + * Another development kit connected to a PC with the `RSSI Viewer app`_ (available in the `nRF Connect for Desktop`_). + See :ref:`radio_test_testing_rssi`. + +.. note:: + You can perform the radio test also using a spectrum analyzer. + This method of testing is not covered by this documentation. + +nRF21540 front-end module +========================= + +.. include:: /includes/sample_dtm_radio_test_fem.txt + +You can configure the nRF21540 front-end module (FEM) transmitted power control, antenna output and activation delay using the main shell commands of the :ref:`radio_test_ui`. + +Skyworks front-end module +========================= + +.. include:: /includes/sample_dtm_radio_test_skyworks.txt + +You can configure the Skyworks front-end module (FEM) antenna output and activation delay using the main shell commands of the :ref:`radio_test_ui`. + +Overview +******** + +To run the tests, connect to the development kit through the serial port and send shell commands. +Zephyr's :ref:`zephyr:shell_api` module is used to handle the commands. +At any time during the tests, you can dynamically set the radio parameters, such as output power, bit rate, and channel. +In sweep mode, you can set the time for which the radio scans each channel from one millisecond to 99 milliseconds, in steps of one millisecond. +The sample also allows you to send a data pattern to another development kit. + +The sample first enables the high frequency crystal oscillator and configures the shell. +You can then start running commands to set up and control the radio. +See :ref:`radio_test_ui` for a list of available commands. + +.. note:: + For the IEEE 802.15.4 mode, the start channel and the end channel must be within the channel range of 11 to 26. + Use the ``start_channel`` and ``end_channel`` commands to control this setting. + + +.. _radio_test_ui: + +User interface +************** +.. list-table:: Main shell commands (in alphabetical order) + :header-rows: 1 + + * - Command + - Argument + - Description + * - cancel + - + - Cancel the sweep or the carrier. + * - data_rate + - + - Set the data rate. + * - end_channel + - + - End channel for the sweep (in MHz, as difference from 2400 MHz). + * - fem + - + - Set front-end module (FEM) parameters. + * - output_power + - + - Output power set. + If a front-end module is attached and the :ref:`CONFIG_RADIO_TEST_SD_POWER_CONTROL_AUTOMATIC ` Kconfig option is enabled, it has the same effect as the ``total_output_power`` command. + * - parameters_print + - + - Print current delay, channel, and other parameters. + * - print_rx + - + - Print the received RX payload. + * - start_channel + - + - Start channel for the sweep or the channel for the constant carrier (in MHz, as difference from 2400 MHz). + * - start_duty_cycle_modulated_tx + - + - Duty cycle in percent (two decimal digits, between 01 and 90). + * - start_rx + - + - Start RX (continuous RX mode is used if no argument is provided). + * - start_rx_sweep + - + - Start the RX sweep. + * - start_tx_carrier + - + - Start the TX carrier. + * - start_tx_modulated_carrier + - + - Start the modulated TX carrier (continuous TX mode is used if no argument is provided). + * - start_tx_sweep + - + - Start the TX sweep. + * - time_on_channel + -