nRF21540 FCC +20 dBm / ETSI +10 dBm gain switching in software (on dual-core nRF5340)

We are currently adding the nRF21540 to our nRF5340 based product to increase our communication range. More precisely: We are switching from Fanstel BT40 to BT40N. We have also migrated our software project to NCS v2.9.0 in the progress.

Currently, we can configure our system for +10 dBm or +20 dBm via Kconfig, we are setting the desired transmit power via CONFIG_BT_CTLR_TX_PWR_ANTENNA :

##### FEM Config #####
CONFIG_FEM=y
CONFIG_MPSL=y
CONFIG_MPSL_FEM=y
CONFIG_MPSL_FEM_NRF21540_GPIO=y
#CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=n
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

##### TX Power Config #####
CONFIG_BT_CTLR_TX_PWR_ANTENNA=20

As we do not want to create separate firmware versions for FCC and ETSI regions, we are looking for a way to configure the gain control via software, making it possible to configure the region (transmit power) via a parameter in NVM. It seems like CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL=y would be what we need, but I could not find any information about how to actively switch the transmit power in software. The nRF21540's driver documentation page doesn't specify any software API's to switch the configuration during runtime. What's worse, I fear that the power has to be controlled on the nRF5340's net core (which is running hci_ipc), and our current project is only running on the app core.

Is there an easy way to implement dynamic gain control from the nRF5340's app core? Some API like "SetBluetoothTxPower(int dbm)"? If so, do we need special Kconfig artefacts to enable this function on the app core?

According to my understanding, if we would simply use the nRF21540 without any Zephyr driver support, we could simply switch the MODE pin to switch between +10 dBm and +20 dBm. But it seems a bit tricky doing this in NCS and Zephyr...

Best regards,
Michael

Parents
  • If you set the power on the antenna in SW to the value you want then the SW will give you that power so you will have to change the max value used based on the region you will operate in. Setting 20 should give you 20dBm, setting 10 should give you 10dBm. This is done on the application processor. The kconfig is the default value at power can be changed runtime.

    If you are planning to use the 10dBm setting then the recommendation is to also use the SPI as that allows a tighter power control to get you as close to 10dBm over temperature and frequency as possible, without the SPI there will be larger margin to the limit.

  • Thanks for the hint with using SPI for thighter power control! Will this also optimize gain over different temperatures?

    Ok, assuming I want +10 dBm as default value at power-on and increase it by software to +20 dBm when operated under FCC, I would change the kconfig values to the following settings:

    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y
    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=10
    CONFIG_BT_CTLR_TX_PWR_ANTENNA=10

    After that, how can I change the default tx power during runtime (including advertising, not connection-specific)? It is really difficult to find the correct command (and necessary kconfig settings to activate the feature) as it is not mentioned anywhere in the documentation.

Reply
  • Thanks for the hint with using SPI for thighter power control! Will this also optimize gain over different temperatures?

    Ok, assuming I want +10 dBm as default value at power-on and increase it by software to +20 dBm when operated under FCC, I would change the kconfig values to the following settings:

    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y
    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=10
    CONFIG_BT_CTLR_TX_PWR_ANTENNA=10

    After that, how can I change the default tx power during runtime (including advertising, not connection-specific)? It is really difficult to find the correct command (and necessary kconfig settings to activate the feature) as it is not mentioned anywhere in the documentation.

Children
No Data
Related