EFR32xG1 based radio boards use 1.0uF capacitor at DC-DC output by default, but the recommended value is 4.7uF for new designs. The EFR32xG1 software defaults to using 1.0 µF, use of 4.7 µF on EFR32xG1 requires modifications in the software. This KBA provides details how to do this modification.
The following methods are valid for Flex SDK 2.4. For other SDK versions, the folder paths or line numbers might be different.
There are 2 options to do this software modification:
1. Look for the following file in your computer: "C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v2.4\platform\emlib\inc\em_emu.h"
Lines 725-752 are responsible for choosing if 1uF or 4.7uF capacitor is present at the DC-DC output. By default, the software uses 1uF for EFR32xG1 series, in order to change that to 4.7uF the following modification should be made:
Swap "emuDcdcLnCompCtrl_1u0F" (line 737) with "emuDcdcLnCompCtrl_4u7F" (line 751). This will make 4.7uF the default value.
2. Place line "#define _SILICON_LABS_GECKO_INTERNAL_SDID_80" in a comment section in the part specific header file (e.g. "efr32mg1p233f256gm48.h"). You can find this file at "C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v2.4\platform\Device\SiliconLabs\EFR32xG1x\Include" folder.
The Connect stack provides an extensible CLI (Command Line Interface) implementation. By default all Connect example project has more or less already implemented CLI commands to interact with the application through the device's UART interface.
The example project to explain how additional CLI command can be added described through Connect (SoC): Wire-Replacement application. Create the project by going through the example application project wizard.
To add new CLI command first open AppBuilder (it opens automatically when new project created) and switch to the Printing tab.
In the Command Line Configuration frame click on the Add New button which will insert a new line at the end of the command line list (since it will be inserted at the end maybe scrolling down to the bottom of the list is necessary for the new line to appear).
There are three column for a command:
Command
Arglist
Callback
The Command is the command name as it will be available on the UART console, Arglist is the list of the type of the arguments which will be accepted by the command and Callback is the function which will be called on execution of the command from the command line.
Command and Callback are straightforward but Arglist may require detailed explanation. The following argument types are accepted:
u: one-byte unsigned integer
v: two-byte unsigned integer
w: four-byte unsigned integer
s: one-byte signed integer
b: string
The string argument can be entered in ASCII by using quotes, for example: "string". It can also be entered in hexadecimal values by using curly braces, for example: { 48 45 58 0A }.
This description of parameters can be find also in command-interpreter2.h file in the command-interpreter folder of the project at declaration of EmberCommandEntry.
Modify the Command field to printParams, the Callback field to printParamsCommand and the Arglist to bu (a string and a 8-bit value) and click on the Generate button.
The generate action will create the prototype of the callback in flex-cli.c
void printParamsCommand(void);
and add the newly created command to the emberCommandTable[] - the corresponding line should look like
The last parameter is an empty string which could be the help for the command but the AppBuilder does not provide way to specify it and making changes in AppBuilder will overwrite the modifications made manually in flex-cli.c.
The next step is to implement the callback - flex-callbacks.c is a suitable place for that purpose.
The file command-interpreter2-util.c contains the helper functions for retrieving values of the command line arguments, the most often used functions are:
emberUnsignedCommandArgument()
emberSignedCommandArgument()
emberStringCommandArgument()
In all cases the first parameter of the call is the spot of the argument in the argument list (zero based index value). In case of emberStringCommandArgument() the second parameter is a pointer to the value of the string length.
If the project successfully compiled, the new command should be appear in the help:
Executing the command should print the arguments' values on the console:
All Silicon Labs EFR32 radio board equipped with external SPI flash memory. Although, the standby current consumption of these devices are low some application need to eliminate even this amount of current consumption to reach extremely low power consumption (the achievable current consumption of a Connect based application exploiting Connect's lowest power mode (EM2) is ~2-4uA)). This mode of the SPI flash called "Deep Power Down" mode, which is available by sending the 0xB9 command to the flash (on the SPI interface).
First, the SPI Flash plugin must be enabled in AppBuilder (Plugins tab):
Don't forget to re-generate project files.
Beside enabling the SPI Flash plugin it is necessary to add the initialization and deep power down command to the project by calling the two API functions below:
halEepromInit()
halEepromShutdown()
It is practical to call these functions at startup of the application, for example from emberAfMainTickCallback() which located in flex-callbacks.c like in the example below:
In some cases customer wants to build a project directly by IAR Embedded WorkBench. Since the Simplicity Studio generated IAR project files may have some mistakes and may not be able to fix by Simplicity Studio design team in a short time, here is a workaround solution.
Take railtest_efr32 project as an example, after we generate it with IAR toolchain in Simplicity Studio, we should also check if it can pass compiling/building process in Simplicity Studio with IAR toolchain firstly. It is supposed the building with SS should be OK.
Then open the project railtest_efr32.eww with IAR workbench directly. The compile may fail, we found below errors. Test on Flex SDK 2.4.1.0. If you use Flex SDK 2.3.1.0, you may only have issue 2.
1, File link mistake.
2, EFR32MG12P332F1024GL125.icf cannot found.
3, Files is not included.
If you also found it failed to build the project, you could try below modifications, after doing these 2 steps, the IAR Embedded WorkBench compiling was supposed to be successful.
1, In file railtest_efr32.ewp. Make the files link correct and entirety.
Change the line
$PROJ_DIR$\..\railapp\railapp_antenna.c
to
$PROJ_DIR$\railapp_antenna.c
Add gpio_ci.c and zwave_ci.c into the project.
After changed, it will look like below:
2, Browse to Options-->Linker-->Config-->Linker configuration file, Uncheck “override default” option. Make the icf link correct.
After all the changing, you will can compile success and get a screen like this:
int MAIN(void)
{
#if defined(__CONNECT_CONFIG__) && !defined(CORTEXM3_EMBER_MICRO)
emberAfMain();
#endif
halInit();
INTERRUPTS_ON();
emberSerialInit((uint8_t)APP_SERIAL, (SerialBaudRate)APP_BAUD_RATE, (SerialParity)PARITY_NONE, 1);
emberSerialPrintfLine(APP_SERIAL, "%s-app ready", emAppName);
emberSerialPrintfLine(APP_SERIAL,
"channel %u (0x%x), node id 0x%2x, pan id 0x%2x",
emberGetRadioChannel(), emberGetRadioChannel(),
emberGetNodeId(), emberGetPanId());
emberSerialPrintf(APP_SERIAL, "%s> ", emAppName);
emberSerialWaitSend(APP_SERIAL);
// Call the main NCP thread. This should never return
ncpThreadMain(NULL);
// should never hit this, but here to suppress compiler warning
return 0;
}
Proprietary Knowledge Base
EFR32xG1 SW changes if 4.7uF DC-DC capacitor is used
EFR32xG1 based radio boards use 1.0uF capacitor at DC-DC output by default, but the recommended value is 4.7uF for new designs. The EFR32xG1 software defaults to using 1.0 µF, use of 4.7 µF on EFR32xG1 requires modifications in the software. This KBA provides details how to do this modification.
The following methods are valid for Flex SDK 2.4. For other SDK versions, the folder paths or line numbers might be different.
There are 2 options to do this software modification:
1. Look for the following file in your computer: "C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v2.4\platform\emlib\inc\em_emu.h"
Lines 725-752 are responsible for choosing if 1uF or 4.7uF capacitor is present at the DC-DC output. By default, the software uses 1uF for EFR32xG1 series, in order to change that to 4.7uF the following modification should be made:
Swap "emuDcdcLnCompCtrl_1u0F" (line 737) with "emuDcdcLnCompCtrl_4u7F" (line 751). This will make 4.7uF the default value.
2. Place line "#define _SILICON_LABS_GECKO_INTERNAL_SDID_80" in a comment section in the part specific header file (e.g. "efr32mg1p233f256gm48.h"). You can find this file at "C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v2.4\platform\Device\SiliconLabs\EFR32xG1x\Include" folder.
从RAIL示例项目中删除对UART的依赖
所有RAIL示例项目都依赖于UART,就连一些根本没有用到UART的项目(如Simple TRX )都依赖于UART, 因为
retargetserial.c
是由HAL library插件自动添加到项目中的。在AppBuilder 或Hardware Configurator 中禁用UART及所有串口的相关选项(如下图),都不能解除对UART的依赖。
其根本原因是
retargetserial.c
包含了retargetserialhalconfig.h
,如果hal-config.h
中没有有效UART定义的话就会触发#error "Invalid UART type"
。编译就会报如下(或相似)的错误:解决方法是从项目中移除
retargetserial.c
(位于hal-efr32目录) 。移除后即可成功编译了。有一点要注意,通过AppBuilder重新生成项目后,一定要记得重新移除这个文件。
英文原文:https://www.silabs.com/community/wireless/proprietary/knowledge-base.entry.html/2018/11/10/remove_uart_dependen-tRaj
How to Add CLI command to Connect applications
The Connect stack provides an extensible CLI (Command Line Interface) implementation. By default all Connect example project has more or less already implemented CLI commands to interact with the application through the device's UART interface.
The example project to explain how additional CLI command can be added described through
Connect (SoC): Wire-Replacement
application. Create the project by going through the example application project wizard.To add new CLI command first open AppBuilder (it opens automatically when new project created) and switch to the Printing tab.
In the Command Line Configuration frame click on the Add New button which will insert a new line at the end of the command line list (since it will be inserted at the end maybe scrolling down to the bottom of the list is necessary for the new line to appear).
There are three column for a command:
The Command is the command name as it will be available on the UART console, Arglist is the list of the type of the arguments which will be accepted by the command and Callback is the function which will be called on execution of the command from the command line.
Command and Callback are straightforward but Arglist may require detailed explanation. The following argument types are accepted:
The string argument can be entered in ASCII by using quotes, for example: "string". It can also be entered in hexadecimal values by using curly braces, for example: { 48 45 58 0A }.
This description of parameters can be find also in
command-interpreter2.h
file in thecommand-interpreter
folder of the project at declaration ofEmberCommandEntry
.Modify the Command field to
printParams
, the Callback field toprintParamsCommand
and the Arglist tobu
(a string and a 8-bit value) and click on the Generate button.The generate action will create the prototype of the callback in
flex-cli.c
and add the newly created command to the
emberCommandTable[]
- the corresponding line should look likeThe last parameter is an empty string which could be the help for the command but the AppBuilder does not provide way to specify it and making changes in AppBuilder will overwrite the modifications made manually in
flex-cli.c
.The next step is to implement the callback -
flex-callbacks.c
is a suitable place for that purpose.The file
command-interpreter2-util.c
contains the helper functions for retrieving values of the command line arguments, the most often used functions are:In all cases the first parameter of the call is the spot of the argument in the argument list (zero based index value). In case of
emberStringCommandArgument()
the second parameter is a pointer to the value of the string length.If the project successfully compiled, the new command should be appear in the help:
Executing the command should print the arguments' values on the console:
Enable Deep Power Down mode of external flash on radio boards using Connect stack
All Silicon Labs EFR32 radio board equipped with external SPI flash memory. Although, the standby current consumption of these devices are low some application need to eliminate even this amount of current consumption to reach extremely low power consumption (the achievable current consumption of a Connect based application exploiting Connect's lowest power mode (EM2) is ~2-4uA)). This mode of the SPI flash called "Deep Power Down" mode, which is available by sending the
0xB9
command to the flash (on the SPI interface).First, the SPI Flash plugin must be enabled in AppBuilder (Plugins tab):
Don't forget to re-generate project files.
Beside enabling the SPI Flash plugin it is necessary to add the initialization and deep power down command to the project by calling the two API functions below:
halEepromInit()
halEepromShutdown()
It is practical to call these functions at startup of the application, for example from
emberAfMainTickCallback()
which located inflex-callbacks.c
like in the example below:After applying the above the current consumption should be reduced by ~8-10uA.
How to build RAIL project by IAR Embedded WorkBench
In some cases customer wants to build a project directly by IAR Embedded WorkBench. Since the Simplicity Studio generated IAR project files may have some mistakes and may not be able to fix by Simplicity Studio design team in a short time, here is a workaround solution.
Take railtest_efr32 project as an example, after we generate it with IAR toolchain in Simplicity Studio, we should also check if it can pass compiling/building process in Simplicity Studio with IAR toolchain firstly. It is supposed the building with SS should be OK.
Then open the project railtest_efr32.eww with IAR workbench directly. The compile may fail, we found below errors. Test on Flex SDK 2.4.1.0. If you use Flex SDK 2.3.1.0, you may only have issue 2.
1, File link mistake.
2, EFR32MG12P332F1024GL125.icf cannot found.
3, Files is not included.
If you also found it failed to build the project, you could try below modifications, after doing these 2 steps, the IAR Embedded WorkBench compiling was supposed to be successful.
1, In file railtest_efr32.ewp. Make the files link correct and entirety.
Change the line
to
Add gpio_ci.c and zwave_ci.c into the project.
After changed, it will look like below:
2, Browse to Options-->Linker-->Config-->Linker configuration file, Uncheck “override default” option. Make the icf link correct.
After all the changing, you will can compile success and get a screen like this:
怎样在EFR32 sub-GHz参考匹配网络中插入SAW 滤波器 / RF 开关 / FEM模块
现有的EFR32无线小壁虎系列sub-GHz频段参考匹配网络中,使用所谓的直接相连的拓扑结构,即Tx和Rx通路直接连在一起而不使用外部的射频开关。为了在参考匹配网络中插入SAW 滤波器/ RF开关或 FEM模块,需要将Tx通路与Rx通路分离开来,这是因为不建议在Tx通路使用SAW滤波器,具体原因如下:
- SAW滤波器相当大的插损会降低期望的功率效率,
- SAW滤波器典型应用是低功率等级,也即会产生功率限制问题,
- SAW滤波器通常对高频率信号(也即RF谐波成分)衰减相对较弱,因此总是推荐使用分立LPF。
EFR32带SAW滤波器的推荐原理图结构如下:
- Tx通路的匹配保持现有的参考匹配电路,推荐匹配元件值已在AN923中说明,或参考现在的参考设计。
- LPF低通滤波器部分可以基于功率水平,谐波抑制的要求来改变。
- Rx通路匹配利用一个标准的4元件分立巴伦匹配网络,相应的在AN643里面有详细说明。仿真元器件值如下表所示。
- RF开关被用来分开TX和RX通路的匹配,这两个通路被连接到相同的天线端口。
- SAW滤波器独自的匹配网络并非必须的 (LW1, LW2, CW1, CW2, CW3 and CW4),具体请参考给定SAW滤波器规格书。
对于只用RF开关的设计,上述原理图是可用的,不焊接SAW滤波器及其匹配元件即可。但是,推荐在4元件离散巴伦单端端口和RF开关之间串入旁路/DC隔离电容。
下图所示是一典型的带FEM的设计,在这里,RF开关可被FEM取代。SAW滤波器在下图没显示出来,但如果使用的话,可将其应用在FEM的RX端口上。在FEM(带LNA)设计中推荐SAW滤波器放在FEM的分立RX端口上,并确保在接收通路上RF模块的顺序如下:天线 --> 分立 LPF(因TX谐波抑制需要) --> SAW滤波器 --> FEM LNA --> 4元件分立巴伦匹配网络 --> EFR32 LNA。这种方法可确保即使在嘈杂的环境中也有强悍的接收性能。在无噪声环境中,如果将SAW滤波器置于4元件匹配巴伦和FEM的LNA之间,则可以实现更好的链路预算。芯科建议使用上述方法,因为将LNA引入接收器路径一般会产生更好的灵敏度,但会导致更差的线性和阻塞性能。如果可以保证无噪声环境,那么SAW滤波器在设计中是不必要的。
同样,对于在Tx通路上的分立匹配方案(也即去掉EFR32和FEM之间的外部陶瓷巴伦),请参考以下链接的KBA:
https://www.silabs.com/community/wireless/proprietary/knowledge-base.entry.html/2018/11/06/discrete_matchingso-IKyv
Connect: 避免NCP设备宕机
Connect 支持NCP(Network Co-Processor)工作模式(通过UART接口)。这种情况下应用程序与协议栈分别运行于不同的设备上。协议栈运行在EFR32设备(target)上,而应用程序运行在另一MCU/CPU(host)上。
在当前的实现,在NCP进行了一些打印操作后,通信会宕机在EFR32 NCP侧。
为避免这种问题,应在ncp-main/ncp-main.c中,在ThreadMain(NULL);这一行前加上emberSerialWaitSend(APP_SERIAL);
如下: