FEM Tx Gain Configuration

Hi,

I'm working with the nRF21540 Development Bundle (DB), which includes the nRF21540 DK and nRF21540 EK. I need to use the FEM module with the GPIO+SPI interface to boost TX power.

Changes Made

I added the following line to CMakeLists.txt while building the application:

set(SHIELD nrf21540ek)

I followed this guide to enable and control the FEM module with GPIO+SPI.

Device Tree Changes

nrf21540dk_nrf52840.dts

nrf_radio_fem: nrf21540_fem {
    compatible = "nordic,nrf21540-fem";
    tx-en-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
    rx-en-gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>;
    pdn-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
    ant-sel-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
    mode-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
    spi-if = <&nrf_radio_fem_spi>;
    supply-voltage-mv = <3000>;
};

fem_spi: &spi3 {
    status = "okay";
    cs-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;

    pinctrl-0 = <&spi3_default>;
    pinctrl-1 = <&spi3_sleep>;
    pinctrl-names = "default", "sleep";

    nrf_radio_fem_spi: nrf21540_fem_spi@0 {
        compatible = "nordic,nrf21540-fem-spi";
        status = "okay";
        reg = <0>;
        spi-max-frequency = <8000000>;
    };
};

nrf21540dk_nrf52840-pinctrl.dtsi

spi3_default: spi3_default {
    group1 {
        psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
                <NRF_PSEL(SPIM_MISO, 1, 14)>,
                <NRF_PSEL(SPIM_MOSI, 1, 13)>;
    };
};

spi3_sleep: spi3_sleep {
    group1 {
        psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
                <NRF_PSEL(SPIM_MISO, 1, 14)>,
                <NRF_PSEL(SPIM_MOSI, 1, 13)>;
        low-power-enable;
    };
};

Observed Behavior

  • TX power settings:
    • SoC (nRF52840) TX power: 0 dBm
    • Booster (nRF21540) TX power: +20 dBm
  • The following changes were generated in .config:
    # CONFIG_MPSL_FEM_ONLY is not set
    CONFIG_MPSL_FEM_ANY_SUPPORT=y
    CONFIG_MPSL_FEM_NRF21540_GPIO_SUPPORT=y
    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI_SUPPORT=y
    CONFIG_MPSL_FEM_NCS_SUPPORTED_FEM_USED=y
    CONFIG_MPSL_FEM_API_AVAILABLE=y
    CONFIG_MPSL_FEM=y
    # CONFIG_MPSL_FEM_NRF21540_GPIO is not set
    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y
    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=20
    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA=20
    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTB=10
    CONFIG_MPSL_FEM_NRF21540_RX_GAIN_DB=13
    CONFIG_BT_CTLR_TX_PWR_ANTENNA=20
    
  • Issue: While measuring current, I only observe 20–35 mA, which is much lower than expected. It seems like the FEM is not boosting TX power.

Questions

  1. Are there any additional configurations required to ensure the FEM is correctly enabled?
  2. How can I confirm that the FEM is active during TX?
  • Hi,

    The current measurement connector on the nRF21540DK only measures the current draw of the nRF52840, to measure the current draw of the nRF21540 you need to cut solder bridge SB16 and connect the ammeter between TP26 and TP48:

    • Are there any additional configurations required to ensure the FEM is correctly enabled?
    • How can I confirm that the FEM is active during TX?

    The configuration looks correct, to verify that the FEM is working you can use the RSSI Viewer application in nRF Connect for Desktop. If you test the same application on a nRF52840DK you should see that the measured RSSI is lower than on the nRF21540DK.

     

    Best regards,

    Bendik

  • If you measure current on the nRF21540 DK then the power to the nRF21540 doesn't go through the measurement header: you only measure the current to the nRF52840 (you can see this in the schematic of the DK).

    If you use the DK then the output power will be -20/30/40dBm (dont' remember the number from the top of my head but it is very low) if you haven't gotten the nRF21540 enabled correctly. This should be possible to detect by looking at the RSSI on the receiver side.

  • Hi,
    The test points you mentioned are connected to the nRF21540 SOC on the DK board. However, when using the nRF21540-EK, I'm bypassing the SOC on the DK board. Do you think it's still a viable option to check those test points in this setup?

  • The test points are only relevant for the nRF21540-DK, the nRF21540-EK have a separate power measurement connector P5. To use it you need to remove R3, this is shown in the nRF21540-EK documentation:

    https://docs.nordicsemi.com/bundle/ug_nrf21540_ek/page/UG/nrf21540_DK/prepare_board.html

  • I tested the radio functionality using two boards:

    • Device A: nRF21540DK
    • Device B: nRF52840-DK

    Test Setup

    Without FEM (nRF21540-EK)

    I flashed the radio test example on Device A and the RSSI viewer program on Device B.
    Device A was set to TX mode using the following commands (as per the README.md instructions):

    1. data_rate ble_2Mbit
    2. start_channel 40
    3. start_tx_modulated_carrier

    With FEM (nRF21540-EK)

    Changes made in proj.conf:

    CONFIG_FEM=y
    CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC=n
    
    • The radio peripheral output_power was set to 8 dBm.
    • The FEM module was configured using the tx_power_control command to set FEM_TX_PWR.
    • However, the total output power still displayed 8 dBm instead of the expected higher value.

    Can you help me troubleshooting, why the FEM module isn't increasing the output power?



Related