Setting TX power for nRF5340+nRF21540

Hello, I need some input on TX Power configuration for nRF5340+nRF21540.
(We are on NCS 2.7, and not yet migrated ot using sysbuild. Still using parent+child image.)
Seems there are multiple ways of configuring TX power, via code and Kconfig.
Need help in being able to control the output of nRF5340, gain for nRf21540 and hence TX power at antenna.
We are using nRF21540 GPIO+SPI configuration, and I have set PA gain to be 20 dB.
I have the following MPSL Config in .config for Netcore image:
#
# Multiprotocol service layer (MPSL)
#
# 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_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL is not set
CONFIG_MPSL_FEM_POWER_MODEL=y
CONFIG_MPSL_FEM_POWER_MODEL_NRF21540_USE_BUILTIN=y
CONFIG_MPSL_FEM_BUILTIN_POWER_MODEL_UPDATE_PERIOD=2000
CONFIG_MPSL_FEM_DEVICE_CONFIG_254=y
CONFIG_MPSL_FEM_INIT_PRIORITY=50
CONFIG_MPSL_THREAD_COOP_PRIO=6
CONFIG_MPSL_TIMESLOT_SESSION_COUNT=0
# CONFIG_MPSL_ASSERT_HANDLER is not set
# CONFIG_MPSL_TRIGGER_IPC_TASK_ON_RTC_START is not set
CONFIG_MPSL_LOW_PRIO_IRQN=26
# end of Multiprotocol service layer (MPSL)
I am setting Gain of 20 dB with this config.
I want to configure +3 dBm TX power on nRF5340 to get +23 dBm TX power at the antenna.
If I set CONFIG_BT_CTLR_TX_PWR_ANTENNA=23
I don't have CONFIG_BT_CTLR_TX_PWR_DBM in .config for netcore image, what will the value of nRF5340 TX power output be in this case? 
1) Will it be 3 dBm even though .config does not say it?
2) Are there any additional settings or voltage requirements needed to enable +3dbm?
Parents
  • Hi.

    Beware that, as stated in the datasheet, the maximum output power of the nRF21540 is +22 dBm, not +23 dBm.

    To achieve +22dBm, in the BLE stack +22 dBm of output power must be requested by the BLE stack. This +22 dBm will be then split into +2 dBm of the SoC (internally Neg1dBm but with high voltage enabled, giving +2 dBm of the SoC output) and 20 dB of FEM gain.

    Control of high voltage is automatic, so the ability to achieve +1, +2, and +3 dBm of the SoC output is performed automatically, based on the request coming from the BLE stack. It is available even if not using any FEM.

    20 dB gain of NRF21540 can be achieved by:

    • Using SPI to control the nrf21540, so CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y if there is a hardware connection between SoC's SPI and nRF21540's SPI.
    • In the GPIO mode, CONFIG_MPSL_FEM_NRF21540_GPIO=y, the MODE pin must be set to the low state (select POUTA gain). If the MODE pin is connected to the SoC (and the relevant device tree description is present, see mode-gpios property https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/fem/fem_nRF21540_optional_properties.html), setting CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=20 would set the gain to 20dB by setting the MODE pin to 0.

    Please also note that the CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB should be set for the network core image.

    In v2.7.0, the child image for the Bluetooth-only app is hci_ipc. The build for samples/bluetooth/central_uart is

    ncs/nrf/samples/bluetooth/central_uart# west build --no-sysbuild -p -b nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf21540ek -Dhci_ipc_SHIELD=nrf21540ek -Dhci_ipc_CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=20

    The NETCORE_IMAGE_NAME, which is hci_ipc above, can be one of the names in the list found here:
    https://github.com/nrfconnect/sdk-nrf/blob/v2.7.0/sysbuild/Kconfig.netcore#L143
    depending on what you've selected. It's necessary to know the name of the network core image to properly pass the kconfig to it.

    Best regards,
    Mathias

  • ok thanks Mathias. based on your reply, the only change I need to make is to set CONFIG_BT_CTLR_TX_PWR_ANTENNA=22 instead of 23, and seems I will get 2 dB, at output of nRF5340 and 22 dBm at output of nRF21540/antenna.

    Everything else seems correctly set already.

  • Hi again, Dhara.

    I've been away on holiday since my last response to you. Did everything work out ok?

Reply Children
Related