Add nRF21540 FEM to existing ESB application

I'm having some troubles adding FEM support to an existing ESB application. Which changes do I require to add to an existing project to support FEM?

I'm using a custom board using a nRF5340 SoC and a nrf21540 FEM. I've already configured the gpio forwarder and added the FEM to the cpunet overlay. But the ESB (TX and RX) seems to not be working. This same application works fine without the FEM (tested with both an nrf52840dk and nrf5340dk).

cpuapp.overlay:

&gpio_fwd {
	nrf21540-gpio-if {
		gpios = <&gpio0 26 0>,		/* tx-en-gpios */
			<&gpio0 3 0>,		/* rx-en-gpios */
			<&gpio0 27 0>,		/* pdn-gpios */
			<&gpio1 9 0>;		/* mode-gpios */
	};
};

cpunet.overlay:

/ {
	nrf_radio_fem: nrf21540_fem {
		compatible = "nordic,nrf21540-fem";
		tx-en-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; //P0.26
		rx-en-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; //P0.03
		pdn-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; //P0.27
		mode-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; //P1.09
        status = "okay";
	};
};

cpunet.conf:

# ESB configuration
CONFIG_ESB=y
CONFIG_ESB_MAX_PAYLOAD_LENGTH=252
CONFIG_ESB_RX_FIFO_SIZE=100

# FEM configuration
CONFIG_MPSL=y
CONFIG_MPSL_FEM=y
CONFIG_MPSL_FEM_NRF21540_GPIO=y
CONFIG_MPSL_FEM_LOG_LEVEL_DBG=y

PS: This devices works as a receiver. The transmitter does not have an FEM.

Parents
  • Hi Diogo

    You mean to say the ESB protocol doesn't work at all, or is it just the FEM configuration that is missing? 

    Which SDK version are you using?

    Have you tested it with FEM enabled on the nRF52840DK? 
    The nRF5340 is a bit more complicated because of the dual core architecture, and possibly there is some additional configuration needed to properly enable the FEM control pins. 

    If you can answer my questions above I will try to reproduce the issue on my end, and get back to you. 

    Best regards
    Torbjørn

  • Hi Torbjørn,

    The issue is clearly on some FEM misconfiguration in my side. I'm having no issue with either the nRF5340DK or the nRF52840DK (both without the FEM). My application works just fine without the FEM on the equation. I'm currently using v2.4.0 (which from my research already includes the FEM support to ESB). I'm currently using a custom board designed by our client, and I haven't tested the FEM with a DK (not sure if I even have an nRF21540dk on the office, need to check that with my colleagues).

  • Hi Diogo

    Would you be able to scope the FEM control lines to see if there is any activity? 

    I can't really see anything wrong with your configuration. I used more or less the same overlays and was able to run the ESB PTX sample on the nRF5340 netcore and hello_world on the appcore, and can see that the FEM control lines are toggling as expected:

    For some reason P0.03 didn't work on the DK, so I had to change to P1.04, but this might be different on your side since you use custom hardware. 

    Here are my test projects:

    310448_5340_fem_issue.zip

    Are you using custom board files, or are you using the nRF5340DK board files? 

    Best regards
    Torbjørn

Reply
  • Hi Diogo

    Would you be able to scope the FEM control lines to see if there is any activity? 

    I can't really see anything wrong with your configuration. I used more or less the same overlays and was able to run the ESB PTX sample on the nRF5340 netcore and hello_world on the appcore, and can see that the FEM control lines are toggling as expected:

    For some reason P0.03 didn't work on the DK, so I had to change to P1.04, but this might be different on your side since you use custom hardware. 

    Here are my test projects:

    310448_5340_fem_issue.zip

    Are you using custom board files, or are you using the nRF5340DK board files? 

    Best regards
    Torbjørn

Children
No Data
Related