Skip to content

Commit 0da85f6

Browse files
Kamil Gawormbolivar-nordic
authored andcommitted
samples: use nRF21540-EK shield instead of devicetree overlays
Direct Test Mode and Radio Test samples used a custom devicetree overlay to enable nRF21540 support. This commit removes the obsolete overlay and updates documentation to properly use recently introduced nRF21540-EK shield. Signed-off-by: Kamil Gawor <[email protected]>
1 parent 0872c94 commit 0da85f6

File tree

8 files changed

+15
-120
lines changed

8 files changed

+15
-120
lines changed

doc/nrf/includes/sample_dtm_radio_test_fem.txt

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,14 @@
11
You can add support for the nRF21540 front-end module (FEM) to the sample.
2-
Set ``-DNRF21540EK_FEM=y`` when you invoke ``west build`` or ``cmake`` in your sample directory.
3-
Follow the instructions in :ref:`cmake_options`.
4-
For example:
52

6-
``west build -b nrf5340dk_nrf5340_cpunet -- -DNRF21540EK_FEM=y``
7-
8-
When you set ``NRF21540EK_FEM=y`` the :file:`dts-nrf21540-fem.overlay` devicetree overlay file is used to override the default settings.
9-
The configuration from this file is merged with the additional development kit overlay file from the :file:`boards` folder if it exists.
10-
11-
The :file:`dts-nrf21540-fem.overlay` is located in the |fem_file_path| folder.
12-
Make sure that the GPIOs and the SPI configuration in the file correspond to those in which your front-end module is connected.
3+
To add support for the nRF21540 FEM, build the sample for a board containing nRF21540 FEM like :ref:`nrf21540dk_nrf52840 <zephyr:nrf21540dk_nrf52840>` or create a devicetree overlay file describing how FEM is connected to nRF5 SoC in your device.
134

145
.. note::
15-
You must set ``NRF21540EK_FEM=y`` if you use the nRF21540 EK.
6+
If you use the nRF21540 EK, append ``nrf21540_ek`` shield to your build command instructing build system to append the appropriate devicetree overlay file.
167
If you use the nRF21540 DK, build your application for the :ref:`nrf21540dk_nrf52840 <zephyr:nrf21540dk_nrf52840>` board.
178
The devicetree for the nRF21540 DK already contains the required FEM configuration, so you do not need to set an additional build option.
189

19-
Sometimes, you may need to add an extra overlay file.
20-
The easiest way to add the file when building is to set it in the ``DTC_OVERLAY_FILE`` variable.
21-
However, that will override the default settings.
22-
When you set the ``DTC_OVERLAY_FILE`` variable, you must specify all overlay files that are needed for building.
23-
24-
Follow the instructions in :ref:`cmake_options` to specify the ``DTC_OVERLAY_FILE`` variable.
2510
For example, to build the sample from the command line for an nRF5340 DK with an attached nRF21540 EK, invoke the following command within the sample directory:
26-
``west build -b nrf5340dk_nrf5340_cpunet -- -DDTC_OVERLAY_FILE="boards/nrf5340dk_nrf5340_cpunet.overlay;../configuration/dts-nrf21540-fem.overlay;your_overlay_file.overlay"``
27-
28-
See :ref:`zephyr:set-devicetree-overlays` for different ways of adding the overlay file.
29-
30-
Alternatively, you can copy the contents of :file:`dts-nrf21540-fem.overlay` to the board's overlay file.
11+
``west build -b nrf5340dk_nrf5340_cpunet -- -DSHIELD=nrf21540_ek``
3112

3213
.. note::
3314
The nRF5340 DK network core peripherals, like UART and SPI, share an ID and a base address.

doc/nrf/includes/sample_fem_support.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@
55
You can add support for the nRF21540 front-end module to the sample.
66
See :ref:`ug_radio_fem` for more information.
77

8-
To add support for the nRF21540 FEM, build the sample for a board containing nRF21540 FEM like nrf21540dk_nrf52840 or create a devicetree overlay file describing how FEM is connected to nRF5 SoC in your device.
8+
To add support for the nRF21540 FEM, the devicetree must contain the description of the nRF21540 FEM.
9+
To include this description in your application, use one of the following options, depending on your hardware:
910

10-
See :ref:`zephyr:set-devicetree-overlays` for different ways of adding the overlay file.
11+
* Build the sample for one board that contains the nRF21540 FEM, such as :ref:`nrf21540dk_nrf52840 <zephyr:nrf21540dk_nrf52840>`.
12+
* Manually create a devicetree overlay file that describes how FEM is connected to the nRF5 SoC in your device.
13+
See :ref:`zephyr:set-devicetree-overlays` for different ways of adding the overlay file.
14+
* Provide nRF21540 FEM capabilities by using a :ref:`shield <zephyr:shields>`, for example the :ref:`ug_radio_fem_nrf21540_ek` shield that is available in the |NCS|.
15+
In this case, build the project for a board connected to the shield you are using with an appropriate variable included in the build command.
16+
This variable instructs the build system to append the appropriate devicetree overlay file.
17+
For example, to build the sample from the command line for an nRF52833 DK with the nRF21540 EK attached, use the following command within the sample directory:
1118

12-
.. note::
13-
If you use the nRF21540 EK, append ``nrf21540_ek`` shield to your build command instructing build system to append the appropriate devicetree overlay file.
14-
15-
For example, to build the sample from the command line for an nRF52833 DK with an attached nRF21540 EK, invoke the following command within the sample directory:
16-
17-
.. code-block:: console
19+
.. code-block:: console
1820

19-
west build -b nrf52833dk_nrf52833 -- -DSHIELD=nrf21540_ek
21+
west build -b nrf52833dk_nrf52833 -- -DSHIELD=nrf21540_ek
2022

21-
To add support for other front-end modules, add the respective devicetree file entries to the board devicetree file or a devicetree overlay file.
23+
To add support for other front-end modules, add the respective devicetree file entries to the board devicetree file or the devicetree overlay file.

samples/bluetooth/direct_test_mode/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,6 @@
55
#
66
cmake_minimum_required(VERSION 3.8)
77

8-
option(NRF21540EK_FEM "Enable support for the nRF21540-EK FEM." OFF)
9-
10-
if(NRF21540EK_FEM)
11-
set(DTC_OVERLAY_FILE
12-
"${CMAKE_CURRENT_SOURCE_DIR}/configuration/dts-nrf21540-fem.overlay"
13-
CACHE STRING "" FORCE)
14-
15-
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay")
16-
set(DTC_OVERLAY_FILE "${DTC_OVERLAY_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay"
17-
CACHE STRING "" FORCE)
18-
endif()
19-
endif()
20-
218
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
229
project(NONE)
2310

samples/bluetooth/direct_test_mode/README.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ In other words, for the first antenna, antenna pin 1 is active, for the second a
122122
nRF21540 front-end module
123123
=========================
124124

125-
.. |fem_file_path| replace:: :file:`samples/bluetooth/direct_test_mode/configuration`
126-
127125
.. include:: /includes/sample_dtm_radio_test_fem.txt
128126

129127
You can configure the transmitted power gain and activation delay in nRF21540 using vendor-specific commands, see `Vendor-specific packet payload`_.

samples/bluetooth/direct_test_mode/configuration/dts-nrf21540-fem.overlay

Lines changed: 0 additions & 29 deletions
This file was deleted.

samples/peripheral/radio_test/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,6 @@
66

77
cmake_minimum_required(VERSION 3.13.1)
88

9-
option(NRF21540EK_FEM "Enable support for the nRF21540-EK FEM." OFF)
10-
11-
if(NRF21540EK_FEM)
12-
set(DTC_OVERLAY_FILE
13-
"${CMAKE_CURRENT_SOURCE_DIR}/configuration/dts-nrf21540-fem.overlay"
14-
CACHE STRING "" FORCE)
15-
16-
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay")
17-
set(DTC_OVERLAY_FILE "${DTC_OVERLAY_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay"
18-
CACHE STRING "" FORCE)
19-
endif()
20-
endif()
21-
229
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
2310
project(NONE)
2411

samples/peripheral/radio_test/README.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ The sample also requires one of the following testing devices:
5959
nRF21540 front-end module
6060
=========================
6161

62-
.. |fem_file_path| replace:: :file:`samples/peripheral/radio_test/configuration`
63-
6462
.. include:: /includes/sample_dtm_radio_test_fem.txt
6563

6664
The nRF21540 transmitted power gain, antenna and an activation delay can be configured using the user interface :ref:`radio_test_ui`.

samples/peripheral/radio_test/configuration/dts-nrf21540-fem.overlay

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)