nrf21540 gain control

Hi All!

Hope you are doing well. I am using NCS 2.0.2 and VSCODE studio. Radio Test example using nrf52833+nrf21540(custom HW) . I want to ask a question how to control the gain of nrf21540 ? 

How to enable it in the radio test example and what will be the sequence of commands for that?

I am using a sequence of commands with only nrf52833DK to ensure FW is working. And output RSSI value is increasing.

output_power pos0dB  /3db /8db

 start_channel 20
 end_channel 60
 start_tx_carrier
 start_tx_sweep

Thanks & Regards,

Parents Reply Children
  • Just want to share I understood the reason CONFIG_FEM was not set to y. Its dependency MPSL_FEM_ANY_SUPPORT was not set for boards without FEMs.

    # From nrf/subsys/mpsl/fem/Kconfig
    
    config MPSL_FEM_ANY_SUPPORT
    	bool
    	default $(dt_nodelabel_enabled,nrf_radio_fem)

    Thus, if you build for a board with nrf_radio_fem, CONFIG_FEM and consequently CONFIG_MPSL and CONFIG_MPSL_FEM_ONLY should be enabled on their own.

  • HI Hieu 

    Again thank you for your concern and support. I will try to enable it as per your instructions. Facing some issues. Will try to update you on this.

    Thanks & Regards,

  • Hi Hieu

    Thank you for your support and response! I am facing the same issue.

    when 

    Thus, if you build for a board with nrf_radio_fem, CONFIG_FEM and consequently CONFIG_MPSL and CONFIG_MPSL_FEM_ONLY should be enabled on their ow

     

     I set the board "nrf21540_nrf52840" instead of nrf52833DK

     I got the following error!  for build2

    and 

    Can you please help me where is the issue ? 

    Thanks & Regards,

    Muhammad Usman

  • Hi Hieu

    One more observation, when I updated the NCS to 2.3.0. It Enabled the following options.

    In kconfig options:

    .conf file

    But when I restarted the Vscode studio above options were disabled. Can you please also help me in this regard where is the issue?

    Thanks & Regards

    Muhammad Usman

  • Hi Muhammad,

    Muhammad Usman said:

     I set the board "nrf21540_nrf52840" instead of nrf52833DK

     I got the following error!  for build2

    Looking at the error, I guess that you are working with a standalone project you created based on the radio_test sample. However, the radio_test sample does not work that way. You will need to build it from its location within the nRF Connect SDK.

    Muhammad Usman said:
    But when I restarted the Vscode studio above options were disabled. Can you please also help me in this regard where is the issue?

    Firstly, I don't understand what you mean by the above options being disabled. Do you mean that you cannot set them for some reasons? Or do you mean their values are reset somehow?

    If it's their values getting reset, please check if you are using the Save or Save to file button. "Save" only stores the changes to the <build folder>/zephyr/.config file, while only "Save to file" would store the changes to your prj.conf file for subsequent builds.

    Secondly, I see that you are updating CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA and CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTB. Do you fully understand what those configurations do? They refer to the actual POUTA and POUTB in your nRF21540, which can be one-time configured (it's only once over the chip's entire lifetime).

    The factory default of POUTA is 20dB and of POUTB is 10dB. Unless you have performed the one-time configuration of the nRF21540 I mentioned above, then these cannot be changed.

    Related to that, CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB can only be either the value of POUTA or POUTB.

    For more information regarding the two output levels, please refer to the nRF21540 Product Specification.

    Regards,

    Hieu

Related