How do you switch antenna paths on EFR32MG21 and MGM210x in EmberZNet stack, and what are the defaults?
Answer
The value of antennaConfig.defaultPath in halInitAntenna() determines which antenna is in use.
At the time of publication of this article (EmberZNet 6.7.5), the RF2G4_IO2 pin is selected by default on both EFR32MG21 and MGM210x.
EFR32MG21
In EFR32MG21, the 2.4 GHz antenna interface consists of two single-ended pins, RF2G4_IO1 and RF2G4_IO2. See Figure 1.
Figure 1.
EFR32MG21 chip pinout.
MGM210P
The MGM210P module has a built-in antenna on non-exposed pin RF2G4_IO1 and an external antenna attached to RF2G4_IO2 pin. See Figure 2.
Figure 2.
MGM210P module pinout.
MGM210L
The MGM210L includes a built-in PCB trace antenna and does not support the use of an external, alternative antenna.
The following Figure 3. shows the lack of the RF pin.
Figure 3.
MGM210L module pinout.
Path configuration
After the antennas and default paths are clarified, take a look at the application where this setting is applied. The stack first initializes the antenna GPIOs prior to any other radio settings being applied.
This is done by the EmberStatus halInitAntenna(void) function through the Antenna Stub plugin.
It can be found in "...\v2.7\platform\base\hal\plugin\antenna-stub\antenna-stub.c ". See Figure 4.
Figure 4.
Code snippet from antenna-stub.c .
The antennaConfig.defaultPath can be
0 for selecting RF2G4_IO1
non-zero for selecting RF2G4_IO2
The following table maps the above values with the corresponding pin configurations. See Table 1.
Table 1.
Path mapping.
The BSP_ANTDIV_SEL_LOC macro is defined to 1 in antenna.h, which means that the default path is the external U.FL for MGM210P and built-in PCB trace antenna for MGM210L.
Zigbee & Thread Knowledge Base
Switching antenna path on Series 2 devices (EFR32MG21, MGM210) in EmberZNet stack
Question
How do you switch antenna paths on EFR32MG21 and MGM210x in EmberZNet stack, and what are the defaults?
Answer
The value of antennaConfig.defaultPath in halInitAntenna() determines which antenna is in use.
At the time of publication of this article (EmberZNet 6.7.5), the RF2G4_IO2 pin is selected by default on both EFR32MG21 and MGM210x.
EFR32MG21
In EFR32MG21, the 2.4 GHz antenna interface consists of two single-ended pins, RF2G4_IO1 and RF2G4_IO2. See Figure 1.
Figure 1.
EFR32MG21 chip pinout.
MGM210P
The MGM210P module has a built-in antenna on non-exposed pin RF2G4_IO1 and an external antenna attached to RF2G4_IO2 pin. See Figure 2.
Figure 2.
MGM210P module pinout.
MGM210L
The MGM210L includes a built-in PCB trace antenna and does not support the use of an external, alternative antenna.
The following Figure 3. shows the lack of the RF pin.
Figure 3.
MGM210L module pinout.
Path configuration
After the antennas and default paths are clarified, take a look at the application where this setting is applied. The stack first initializes the antenna GPIOs prior to any other radio settings being applied.
This is done by the
EmberStatus halInitAntenna(void)
function through the Antenna Stub plugin.It can be found in "...\v2.7\platform\base\hal\plugin\antenna-stub\antenna-stub.c ". See Figure 4.
Figure 4.
Code snippet from antenna-stub.c .
The antennaConfig.defaultPath can be
The following table maps the above values with the corresponding pin configurations. See Table 1.
Table 1.
Path mapping.
The
BSP_ANTDIV_SEL_LOC
macro is defined to 1 in antenna.h, which means that the default path is the external U.FL for MGM210P and built-in PCB trace antenna for MGM210L.