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?
Parents
  • 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.

  • 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?



  • Apologies for the delay.

    First of all you should not use 8dBm output power from the nRF52840 with the nRF21540, the maximum tolerated input power on the TRX pin is +5dBm.

    Chandu@1996 said:

    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

    Based on this screen shot it looks like there is no transmission at all, with 2440MHz being low compared to the rest of the spectrum.

    Can you share a picture of your setup?

     

    Chandu@1996 said:

    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.

    parameters_print only show the nRF52840 configuration, since you are building without automatic power control. If you enable automatic power control you can use the total_output_power command to set the total output power, aka nRF52840 output power + nRF21540 Tx gain.

  • Hi,
    As suggested, by enabling 

    CONFIG_RADIO_TEST_POWER_CONTROL_AUTOMATIC=y (also reverted the previous changes in proj.conf)

    Thereby using total_output_power command to set the total ouput power(aka nRF52840 output power + nRF21540 Tx gain)


    Note: Set up env is also added.
    And in radio test documentation (https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/nrf/samples/peripheral/radio_test/README.html#testing), it explains about two ways of radio tetesting. Im using RSSI viewer app to test the tx power. But the app has configurable levels only from -110 to -20dbm.  How to verify the FEM amplifier with +21dbm settings using RSSI viewer app?

  • Thanks for the picture, this clears thing up for me. The nRF21540EK is mounted on the nRF21540DK. The nRF21540DK already have a nRF52840+nRF21540 so there is no need to add the nRF21540EK on top of it. The EK is intended to be used with other development kit if you want to use a FEM with for example the nRF5340.
     

    When using the nRF21540DK you don't need to modify the device tree. The board files for the nRF21540DK already have the correct device tree node for the nRF21540, just build for the nrf21540dk/nrf52840 target.

    The RSSI viewer app can't really be used for measuring the output power, but you can use it to see if the FEM is actually working, as you will se a higher RSSI when using the nRF21540DK vs a nRF52840DK.

     

    To use the nRF21540EK with a development kit you also need a MXHT83QE3000 cable to connect the RF output of the development kit to the TRX connector on the EK.

Reply
  • Thanks for the picture, this clears thing up for me. The nRF21540EK is mounted on the nRF21540DK. The nRF21540DK already have a nRF52840+nRF21540 so there is no need to add the nRF21540EK on top of it. The EK is intended to be used with other development kit if you want to use a FEM with for example the nRF5340.
     

    When using the nRF21540DK you don't need to modify the device tree. The board files for the nRF21540DK already have the correct device tree node for the nRF21540, just build for the nrf21540dk/nrf52840 target.

    The RSSI viewer app can't really be used for measuring the output power, but you can use it to see if the FEM is actually working, as you will se a higher RSSI when using the nRF21540DK vs a nRF52840DK.

     

    To use the nRF21540EK with a development kit you also need a MXHT83QE3000 cable to connect the RF output of the development kit to the TRX connector on the EK.

Children
Related