Thingy53 ESB and FEM

Hi,

I am working with Thingy53 using the ESB (Enhanced ShockBurst) library.
I have my basic app running with multi-point comms and power control. This was done without using the Thingy53 nRF21540 FEM module (CONFIG_MPSL_FEM=n). This means that the Thingy53 antenna switch selects ANT2.

Now I would like to take the FEM module and ANT1 into use, but I think the ESB library does not directly support it. At least I think esb_set_tx_power() does not know how to control power using the FEM. But I am not sure if there are any other problems. I did find some adjacent old posts which seemed to indicate that there is some FEM support in ESB, but I did not really understand what that meant.

Q1: Does ESB already support using FEM in Thingy53. If so, how do I select between ANT1 and ANT2?

Q2: If not, can I still use ESB with FEM and handle power control separately? I would probably have to disable ESB power control somehow so that there would not be conflicting power settings.

Q3: If I can do FEM control independently of ESB, then what would be the recommended API to use?
It seems that at least the MPSL API (https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/mpsl/doc/api.html#) is an option.
There is also a simpler option abstracting the MPSL API: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/others/fem_al.html
Are these both supported "equally"? Obviously the FEM AL API looks more attractive since I basically only want to change power with reasonably high resolution and some adaptivity. I don't think I need any very advanced functions.

Best regards,

Petri Haavisto

Finland

Parents Reply Children
  • Hi!

    Thank you for the confirmation!
    I tried again and it is now working, at least to some extent.
    My initial problem was that when I took FEM into use (CONFIG_MPSL_FEM=y) I also did the following:
    CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL=y
    CONFIG_MPSL_FEM_POWER_MODEL=y

    These are both explained in the link you provided and they seemed like a good idea when I actually wanted to control the power dynamically;-)
    However, this did not compile for Thingy53 and I made the quick (wrong) conclusion that FEM is not supported.
    Now that I looked into this again, I noticed that it was only the setting CONFIG_MPSL_FEM_POWER_MODEL that causes the problem. It will not compile complaining that "undefined reference to `mpsl_fem_power_model_to_use_get'". I verified this with the simplest esb_prx() sample code by just adding that config parameter, and it will not work. This is not a problem and using the power model would have only been a nice extra.

    I am still confused about whether this CONFIG_MPSL_FEM_NRF21540_RUNTIME_PA_GAIN_CONTROL really allows me to set power freely within the FEM range. The role of CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTA and CONFIG_MPSL_FEM_NRF21540_TX_GAIN_DB_POUTB is a bit unclear since parts of the link seem to suggest that only those two values should be used. That does not make much sense so I assume it means something else. I have not yet been able to measure whether TX power actually changes more than between two different values.

    Regarding ANT1/ANT2 choice, my current assumption is that there simply is no need to use ANT2. I don't think that I can just control antenna selection externally from FEM control since the same line is connected to FEM power-down pin. Since there is no run-time option in ESB to switch antennas (and hence power-down the FEM) I am sure ESB would get confused if FEM would be powered down. I only wanted to have run-time switching between the antennas for test purposes, but compile-time changing is fine as well.

    However, this question is clear to me now. Thank you for a very quick response!

    Petri

Related