If you are experiencing degraded performance on the MGM12P, it is important to be aware that some versions of the MGM12P have an LNA FEM for improved link budget and receiver sensitivity. In many cases, this will not be configured properly by AppBuilder and will need to be manually setup for proper operation. The FEM must be turned on during any radio operation as it will not transmit if it is in shutdown mode.
There are two components that need to be setup on the EFR32 for this to work: The FEM Control Plugin and the FEM shutdown control.
FEM Control Plugin
The FEM Control Plugin is found in the HAL section of the Plugins tab. The plugin sets up the Peripheral Reflex System (PRS) to operate the mode control (CRX) for the FEM. This is a single wire setup with PD10 controlling CRX. PD10 is internal to the MGM12P module and not exposed externally.
It does not setup TX Active, so the checkbox for TX Active can be left unchecked. Because of this, PRS channel for TX, PRS location for TX and the TX Active Low box are disregarded by the plugin.
TX Active - Unchecked
PRS channel for TX - N/A
PRS location for TX - N/A
TX Active Low - N/A
However RX Active is utilized by the the FEM Control plugin. Thus you must set the PRS channel for RX and PRS location for RX. RX Active is high, so leave that box unchecked
RX Active - Checked
PRS channel for RX - see below
PRS location for RX - see below
RX Active Low - Unchecked
The PRS channel and location for PD10 CRX are shown in the following table:
Make sure that the PRS channel selected is not utilized by any other peripherals on the EFR32.
An example of these settings can be found here:
FEM shutdown control
FEM shutdown control (CSD) needs to be enabled in code. CSD is controlled by GPIO PD11. PD11 is internal to the MGM12P module and not exposed externally. Here are the code snippets to utilize the FEM control:
First is the code to enable PD11 as a GPIO:
// FEM Shutdown GPIO enable CMU_ClockEnable(cmuClock_HFPER, true); CMU_ClockEnable(cmuClock_GPIO, true); GPIO_PinModeSet(gpioPortD,11,gpioModePushPull,1);
The first two lines enable the clocks to turn on GPIO functionality, they are most likely enabled already, but the redundancy won't hurt. The 3rd line setups the pin for output and turns on the GPIO, enabling the FEM.
To turn the GPIO/FEM on and off, use this code:
GPIO_PinOutSet(gpioPortD,11); // turn on the FEM GPIO_PinOutClear(gpioPortD,11); // turn off the FEM
Turning the FEM on and off is only a requirement for sleepy end devices for power savings. In routers and always on devices, the FEM can remain on during all operation.
In an SOC setup, you will need to enable the following callbacks and add the above code to the callbacks as noted:
emberAfMainInitCallback() // enable the GPIOs for the FEM here emberAfPluginIdleSleepOkToSleepCallback() // turn off the FEM in this callback emberAfPluginIdleSleepWakeUpCallback() // turn on the FEM in this callback
In an NCP setup, you will need to enable the following callbacks and add the above code to the callbacks as noted:
emberAfMainInitCallback() // enable the GPIOs for the FEM here halRadioPowerDownHandler() // turn off the FEM in this callback halRadioPowerUpHandler() // turn on the FEM in this callback