nRF21540 custom gain with MPSL

Hello,

To follow the talk we add on this ticket.

 How can I configure a custom TX gain with the MPSL library ?

I want to have an output power of 8 dBm on the nRF21540.

I tried to change the MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA and set CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL configs but the signal on a analyzer was -23dBm and not near 8 dBm as I wanted.

When I just use the default value of 10 dBm, the analyzer get a power near 10 dBm as wanted.

Regards,

Andrew

  • Hi, 

    Please kindly share the whole content of the conf file. Thanks. 

    Regards,
    Amanda H. 

  • Here is the conf file used with the radio_test project for the nrf21540dk_nrf52840 board:

    #
    # Copyright (c) 2020 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    CONFIG_CONSOLE=y
    CONFIG_CONSOLE_HANDLER=y
    CONFIG_SHELL=y
    
    CONFIG_DYNAMIC_INTERRUPTS=y
    
    CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL=y
    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y
    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA=8
    
    CONFIG_NRFX_TIMER0=y
    
    CONFIG_ENTROPY_GENERATOR=y
    
    CONFIG_SHELL_BACKEND_RTT=y
    CONFIG_SENSOR=y

    WIth this one, when I use the command "total_output_power 8" and then "start_tx_modulated_carrier" I have -23dBm on the analyzer.

    Regards,

    Andrew

  • Hi, 

    What NCS version are you using?

    A known bug was identified which lead to incorrect values being set in the TXPOWER register, sounding very similar to the issue you describe, and we have a fix to the issue which is covered by this pull request.

    Would you be able to apply this PR on your end and see if it fixes your issue? If it doesn't work in your version, is it possible for you to test the PR with v2.2.0? 

    In order to apply the PR to your local NCS installation you can use the following Git commands:

    // Open a Git bash and navigate to the nrf folder of the v2.2.0 installation
    git fetch origin pull/10120/head:pr_10120_test_branch
    git checkout pr_10120_test_branch
    west update
    
    // In order to go back
    git checkout v2.2.0
    west update

    Regards,
    Amanda H.

  • Hi,

    I'm using NCS v2.2.0.
    As I can see the PR resolve a problem with the HCI driver.
    But I don't use it as I use the 802.15.4 driver on my main project. And the bug is also here with my main project.

    I will try to use the PR but I'm not sure if it will change something.

    Regards,

    Andrew

  • Hi,

    The PR didn't help...

    When I use my project (802.15.4 nrf driver with a TX power configured at 10dBm) and check with wireshark (nrf52840-DK sniffer), without those configs: 

    CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL=y
    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y
    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA=8

    I have a RSSI of -22dBm at 5cm.

    With those configs, I have a RSSI of -40dBm at 5cm...

    Same code, same TX power requested. The only change is those 3 lines inside the prj.conf file.

    Regards,

    Andrew

Related