|
1 | 1 | 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: |
5 | 2 |
|
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. |
13 | 4 |
|
14 | 5 | .. 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. |
16 | 7 | If you use the nRF21540 DK, build your application for the :ref:`nrf21540dk_nrf52840 <zephyr:nrf21540dk_nrf52840>` board. |
17 | 8 | The devicetree for the nRF21540 DK already contains the required FEM configuration, so you do not need to set an additional build option. |
18 | 9 |
|
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. |
25 | 10 | 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`` |
31 | 12 |
|
32 | 13 | .. note:: |
33 | 14 | The nRF5340 DK network core peripherals, like UART and SPI, share an ID and a base address. |
|
0 commit comments