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:
Channel
3
4
5
6
Location
9
1
0
12
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.
SOC Setup
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
NCP Setup
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
LQI, or Link Quality Index is a value used to compute Link Cost for Zigbee and other stacks. Link Cost can be used for creating network routes, selecting network parents, determining neighbors and managing routing tables. In both the Zigbee and IEEE 802.15.4 standards, LQI is required, but unlike RSSI (Receive Signal Strength Indication -- a standardized value), it is left to the manufacturer to determine how to implement LQI. On-chip radios differ significantly, so the mechanisms to evaluate LQI must be specific to the radio.
Zigbee
Per the Zigbee Specification, (R21):
The ZigBee routing algorithm uses a path cost metric for route comparison during route discovery and maintenance. In order to compute this metric, a cost, known as the link cost, is associated with each link in the path and link cost values are summed to produce the cost for the path as a whole.
802.15.4
The most common way to provide a Link Cost is to make use of the LQI specified in the IEEE 802.15.4-2003 MAC and PHY:
6.7.8 LQI The LQI measurement is a characterization of the strength and/or quality of a received packet. The measurement may be implemented using receiver ED, a signal-to-noise ratio estimation, or a combination of these methods. The use of the LQI result by the network or application layers is not specified in this standard.
The LQI measurement shall be performed for each received packet, and the result shall be reported to the MAC sublayer using PD-DATA.indication (see 6.2.1.3) as an integer ranging from 0x00 to 0xff. The minimum and maximum LQI values (0x00 and 0xff) should be associated with the lowest and highest quality IEEE 802.15.4 signals detectable by the receiver, and LQ values in between should be uniformly distributed between these two limits. At least eight unique values of LQ shall be used.
Hardware Implementation
LQI is derived from low-level radio information, basically a correlation between automatically-sensed radio errors and bit or packet error rates. Silicon Labs' EFR32 hardware is a significantly different architecture from EM2xx and EM3xx, and LQI is computed differently between the two designs.
EM3xx
In the Silicon Labs EM3xx parts, the LQI value is an unsigned 8-bit integer (int8u) ranging from 0 to 255, with the maximum value representing the best possible link quality. The relationship between LQI and link “cost” for purposes of route/neighbor maintenance in the stack is such that LQI values of 200 map to the lowest costs of 1, 3 and 5, while LQIs below 200 represent links with high error rates, so the worst-case cost of 7 is assigned. The LQI value of 200 represents approximately 80% reliability of receiving the packet intact. Note that the LQI measurement is based on the chip error rate (similar to Bit Error Rate [BER]) of the current packet being received from the previous hop of the inbound route, so that it provides information specific to the link-layer connection to the neighboring device relaying the current packet to the local device. This LQI data is also used by the stack to determine connectivity between neighboring nodes and to select parent devices when joining the network as a ZigBee End Device.
EFR32
In the Silicon Labs EFR32MG1 and EFR32MG1x families, the bit error rate is not available to the RAIL layer, so LQI is derived from RSSI values. The RSSI value is a signed 8-bit integer (int8s) ranging from approximately -100 (based on the receive sensitivity rating for the chip you’re using) to 127, with each value representing the energy level (in dBm) at the radio’s receiver.
The RSSI measurement is based on the peak (highest) energy level detected by the radio on the current frequency over the first 8 symbol periods (about 128 microseconds) of the current packet being received. A drawback to using RSSI is that signal energy at a given frequency can come from any transmitter/interferer on that frequency, whether it is another nearby node on the same network, a device from a different PAN on the same channel, or a non-ZigBee, non-802.15.4 interferer, such as a WiFi transmitter or microwave. For EFR32, the RSSI range of [-100..-36] is mapped to an LQI range [0..255].
Note: Prior to the EmberZnet stack 6.2.0, there is a biased route selection issue in the hybrid network with EFR32 and EM35x chips since the network prefers to choose the EM35x chips as routing path during the route discovery process. We have fixed this issue in the EmberZnet 6.2.0 and later. The mapping used to determine the cost of a link on EFR32 chips has changed. The former mapping was overly strict and only assigned good cost values to links with extremely high link margins. This resulted in very stable links being assigned high costs, which is undesirable. One consequence was that in mixed networks of EM3xx and EFR32 chips, the routing algorithm would avoid using EFR32 chips as relays. The new mapping brings the EFR32 cost assignments more closely into line with the EM3xx assignments.
Zigbee & Thread Knowledge Base
Configuring the MGM12P FEM
LQI in Silicon Labs EM3xx and EFR32 Parts
LQI Description
LQI, or Link Quality Index is a value used to compute Link Cost for Zigbee and other stacks. Link Cost can be used for creating network routes, selecting network parents, determining neighbors and managing routing tables. In both the Zigbee and IEEE 802.15.4 standards, LQI is required, but unlike RSSI (Receive Signal Strength Indication -- a standardized value), it is left to the manufacturer to determine how to implement LQI. On-chip radios differ significantly, so the mechanisms to evaluate LQI must be specific to the radio.
Zigbee
Per the Zigbee Specification, (R21):
The ZigBee routing algorithm uses a path cost metric for route comparison during route discovery and maintenance. In order to compute this metric, a cost, known as the link cost, is associated with each link in the path and link cost values are summed to produce the cost for the path as a whole.
802.15.4
The most common way to provide a Link Cost is to make use of the LQI specified in the IEEE 802.15.4-2003 MAC and PHY:
6.7.8 LQI
The LQI measurement is a characterization of the strength and/or quality of a received packet. The measurement may be implemented using receiver ED, a signal-to-noise ratio estimation, or a combination of these methods. The use of the LQI result by the network or application layers is not specified in this standard.
The LQI measurement shall be performed for each received packet, and the result shall be reported to the MAC sublayer using PD-DATA.indication (see 6.2.1.3) as an integer ranging from 0x00 to 0xff. The minimum and maximum LQI values (0x00 and 0xff) should be associated with the lowest and highest quality IEEE 802.15.4 signals detectable by the receiver, and LQ values in between should be uniformly distributed between these two limits. At least eight unique values of LQ shall be used.
Hardware Implementation
LQI is derived from low-level radio information, basically a correlation between automatically-sensed radio errors and bit or packet error rates. Silicon Labs' EFR32 hardware is a significantly different architecture from EM2xx and EM3xx, and LQI is computed differently between the two designs.
EM3xx
In the Silicon Labs EM3xx parts, the LQI value is an unsigned 8-bit integer (int8u) ranging from 0 to 255, with the maximum value representing the best possible link quality. The relationship between LQI and link “cost” for purposes of route/neighbor maintenance in the stack is such that LQI values of 200 map to the lowest costs of 1, 3 and 5, while LQIs below 200 represent links with high error rates, so the worst-case cost of 7 is assigned. The LQI value of 200 represents approximately 80% reliability of receiving the packet intact. Note that the LQI measurement is based on the chip error rate (similar to Bit Error Rate [BER]) of the current packet being received from the previous hop of the inbound route, so that it provides information specific to the link-layer connection to the neighboring device relaying the current packet to the local device. This LQI data is also used by the stack to determine connectivity between neighboring nodes and to select parent devices when joining the network as a ZigBee End Device.
EFR32
In the Silicon Labs EFR32MG1 and EFR32MG1x families, the bit error rate is not available to the RAIL layer, so LQI is derived from RSSI values. The RSSI value is a signed 8-bit integer (int8s) ranging from approximately -100 (based on the receive sensitivity rating for the chip you’re using) to 127, with each value representing the energy level (in dBm) at the radio’s receiver.
The RSSI measurement is based on the peak (highest) energy level detected by the radio on the current frequency over the first 8 symbol periods (about 128 microseconds) of the current packet being received. A drawback to using RSSI is that signal energy at a given frequency can come from any transmitter/interferer on that frequency, whether it is another nearby node on the same network, a device from a different PAN on the same channel, or a non-ZigBee, non-802.15.4 interferer, such as a WiFi transmitter or microwave. For EFR32, the RSSI range of [-100..-36] is mapped to an LQI range [0..255].
Note: Prior to the EmberZnet stack 6.2.0, there is a biased route selection issue in the hybrid network with EFR32 and EM35x chips since the network prefers to choose the EM35x chips as routing path during the route discovery process. We have fixed this issue in the EmberZnet 6.2.0 and later. The mapping used to determine the cost of a link on EFR32 chips has changed. The former mapping was overly strict and only assigned good cost values to links with extremely high link margins. This resulted in very stable links being assigned high costs, which is undesirable. One consequence was that in mixed networks of EM3xx and EFR32 chips, the routing algorithm would avoid using EFR32 chips as relays. The new mapping brings the EFR32 cost assignments more closely into line with the EM3xx assignments.