Convert nrf52840 projects to nrf21540DK target.

These seems like another dumb question. First off, I am aware that the nrf21540DK is the nrf52840 with the FEM tacked on the output. 

I know I can select the nrf21530DK/nrf52840 as a build target while creating the Build Configuration, which should give me the appropriate device tree for the FEM connections. 

What I want to know are what calls I need to make to modify the RF output power and set FEM. 
The following project Link sort of makes some changes on the fly, but I am not sure I see what modifications are needed for the FEM TX/ RX lines. I am guessing they are buried in the nrf52 radio driver. 

Comparing range with Bluetooth Low Energy of the nRF21540 DK and the nRF52840 DK - Blogs - Nordic Blog - Nordic DevZone

Parents
  • I mean it would be nice if this was just laid out in a document, but I suppose what needs to be done is add the following to the prj.conf file.

    Now that I know the variables, I can search for discussions about them.

    # FEM
    CONFIG_MPSL_FEM=y
    CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
    CONFIG_MPSL_FEM_NRF21540_RX_GAIN_DB=0
    CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB=20

  • Since I am on this journey, I will continue with what appears to be the /subsys/mpsl/fem firmware additions, which appear to be controlled by the existence for the FEM devices in the device tree. 

    So just enabling the prj.conf, I believe, enables the fem code with some default values.

    So just selecting the board target of nrf21540dk/nrf52840 with the normal prj.conf , I believe enables the FEM code with some default values.

    Is that a correct statement? 

  • Hi and that you for your patience, I had a unexpected absence. 

    Yes that is correct if you are using the DK then its already enabled in the config files for the DK. We have mentioned it sort of in some samples like here. I will ask if we can add a line somewhere fitting to make this more clear in the developing with FEM section in our documentation

    Regards

    Runar

Reply
  • Hi and that you for your patience, I had a unexpected absence. 

    Yes that is correct if you are using the DK then its already enabled in the config files for the DK. We have mentioned it sort of in some samples like here. I will ask if we can add a line somewhere fitting to make this more clear in the developing with FEM section in our documentation

    Regards

    Runar

Children
Related