本文主要是介绍Silicon Labs EFR32 NodeTest,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、NodeTest是一个由Silicon Labs提供的预先构建的应用程序,用于在开发板或定制设计的硬件上执行射频评估、功能测试和硬件验证。NodeTest应用程序提供了对无线电的低级控制,可以用于执行以下任务:
- 测试无线电性能。
- 设置制造和堆栈参数(令牌)。
- 在生产后验证适当的功能。
- 为许多国家要求的认证过程适当地控制无线电。
2、NodeTest应用程序支持命令解析器,并以一致的、易于解析的格式提供结果。虽然NodeTest没有源代码可用,但大多数NodeTest的RF测试功能也可以通过EmberZNet PRO中公开的制造库API (mfglib)和Silicon Labs线程通过mfglib库(用于SOC平台)或mfglib串行命令(用于NCP平台)获得。因此,自定义构建的应用程序可以在为其板配置专门设计的应用程序中本地合并此功能,而无需依赖预构建的NodeTest固件。NodeTest应用程序包含在EmberZNet PRO和Silicon Labs线程堆栈安装目录中,它们都包含一组/build/ NodeTest -xxx子目录,用于给定的处理器/体系结构变体xxx。这些目录包含。s37和.ebl文件映像,这些映像可以通过基于串行线或jtag的固件加载过程安装到芯片上。
3、NodeTest固件在:SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v2.4\protocol\zigbee\build,不过只包含一部分IC型号的固件,可以使用Commander直接烧录 nodetest.s37文件到芯片上,烧录后可以使用Simplicity Studio打开对应的J-link Console,选择Serial1,在输入区域按回车,然后NodeTest会初始化:
然后输入help,按回车键发送:
4、NodeTest包含以下10项测试:
- Token测试
---- token-test ----initTokens - Invoke top level token initializationtokRead u2 - Read all data of a token (u2=creator code)tokReadIdx u2u1 - Read an index of a token (u2=creator code, u1=idx)tokWrite u2 - Write all data of a token (u2=creator code)tokWriteIdx u2u1 - Write an index of a token (u2=creator code, u1=idx)tokReadResp u2 - Similar to tokRead but follows platformtest format (u2=creator code)tokWriteResp u2b - Similar to tokWrite but follows platformtest format (u2=creator code, b={hex_data_buffer})tokDump - Dump the entire token data set
---- token-cortexm3-test ----tokMap - Print the Token Memory MaploadToks - Load stack and application token defaults
- Button测试
---- button-test ----button u1 - Test Buttons. Use u1!=0 for pollingcrashinfo - Print crash information
- 外挂Flash测试
---- extflash-test ----appblver - Report the version of the installed app bootloaderefInit - Initialize the external flash driverefshutdown - Shutdown the external flash driverefChipErase - Erase the external flash chipefPageErase u4u4 - (address len) Erase pages on the external flash chipefRead u4u2 - (address len) Read data from the external flash chipefWrite u4u2 - (address len) Write random data to the external flash chipefWriteTest u4u4u4 - (address len seed) Write random data, lengths to the external flash chipefReadTest u4u4u4 - (address len seed) Verify random data, lengths read from the external flash chipefStream - Init and erase ext flash and then accept hex data to be written sequentiallyefBootload - Verify image in external flash and then invoke bootloader to install it
- GPIO测试
---- gpio-test ----gpioRead - Print GPIO stategpioSet u4u4* - (port pinmask) or (portpin) Set the masked pins on the given GPIO port high.gpioOut u4u4 - (port pins) or (portpin value) Set the given GPIO port to the given pin state.gpioClear u4u4* - (port pinmask) or (portpin) Clear the masked pins on the given GPIO port.gpioCfg u4u4u4* - (port MODEL MODEH) Set configuration mode for the given GPIO port.gpioMode u4u4 - (portpin mode) Set configuration mode for the given GPIO port/pin.gpioSlewrate u1u1u1 - (port slewrate slewrateAlt) Set slewrate and alternate slewrate for the given GPIO port.
- LED测试
---- led-test ----ledOn u1 - Turns on LED u1ledOff u1 - Turns off LED u1ledToggle u1 - Toggles LED u1
- 睡眠测试
---- sleep-test ----shutdown - Put the chip in the Deep Sleep state
- 系统测试
---- sys-test ----getrev - Retrieve System Revision
- 复位测试
---- reset-test ----resetstring - Print the ResetStringassertme - Resets the chip using assert()
- RF测试
---- phy-common ----initRadio - call emRadioInit().seedPnrg - Seed the PNRG with random data from the radiosetPerTest u1 - (m) Set Packet Error Rate test mode to m (0-disable, 1-enable)getChannel - Get the current channelsetChannel u1 - (c) Set the radio channel to cgetChanFreq u1 - (c) Display the center frequency for channel cgRadPowState - Get the radio current power statesRadPowState u1 - (s) Set the radio current power state to s (0-asleep, 1-awake)getCca - Get Clear Channel Assessment. 1 = Clear; 0 = Busy.getRssi - Get RSSI in dBm over 8 symbol periods.getEd - Get 802.15.4 ED (-100dBm to -36dBm : 0x00 to 0xff) over 8 symbol periods.edScan u4u4* - Perform ED scan for n samples on current channel or optional channel mask m.getCcaThresh - Get CCA-ED threshold in dBm.setCcaThresh s1 - (e) Set CCA-ED threshold to e dBm.
---- phy-common-pta ----getPta - Get state of packet traffic arbitration(0-enabled,1-disabled)setPta u1 - Enable(1)/disable(0) packet traffic arbitrationgetPtaOption - Get pta options bit masksetPtaOption u4 - Set pta options bit masksetPtaReqArb u1 - Enable(1)/disable(0) packet traffic arbitration read PTA_REQ_GPIO before asserting
---- phy-common-rx ----showPayload u1 - Enable(1)/disable(0,default) PHY payload display in RX outputrx - Receive moderxQuiet - Receive mode but don't print received packetsrxBg u1* - Enable(1)/disable(0)/toggle Receive Background mode
---- phy-common-tx ----setPerTestTx - Setup TX for IEEE 802.15.4 PER testgetTxPower - Get current radio TX power in dBmsetTxPower s1 - (p) Set radio TX power to p dBmgetTxPowerFl - Get current radio TX power in dBm * 100setTxPowerFl s2 - (p) Set floating point radio TX power to p dBm * 100 (for 10.25 dbm, input 1025getTxDelay - Get TX interpkt delay in ussetTxDelay u2 - (d) Set radio tx interpkt delay to d ustx u2 - (n) TX n pkts (0=infinite)txStream - TX continuous stream of random symbolstxTone - TX single carrier frequencygetTxPacket - Display TX pkt length & payloadsetTxLength u1 - Set TX payload lengthsetTxPayload u1u1u1u1u1 - (o d0 d1 d2 d3) Set TX pkt payload data d0-3 at offset osetCheckCca u1 - Enable(1)/disable(0) HW backoff & CCA
---- phy-em250class ----calChannel u1 - Set the channel; perform full calibrationsetSynOffset s1 - (o) Offset the synth frequency by o 9.375kHz increments.
---- phy-efr32 ----setCtune u4 - set CTUNE register (CMU->HFXOSTEADYSTATECTRL_CTUNE)getCtune - get CTUNE register value
- 平台测试
---- platformtest ----version - Prints version information.verbose u1u1u1u1u1 - Sets verbosity of header command tag delim texthelp - Prints this help menulist b - list commands of specified module name! - Recalls the previous command[tab] - Attempts to tab complete command
5、更多内容请查看官方文档《an1019-node-test.pdf》
6、如果没有找到对应芯片的固件则可以使用Manufacturing Library插件,注意要勾选两处地方,一处是Library,另一处是CLI,勾选后需要重新生成代码,点击右上角的“Generate”按钮,如图:
7、一些常用的命令可以在:SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v2.4\protocol\zigbee\documentation\120-3023-000_AF_V2_API中找到,如下图:
8、在一些官方例程的使用文档也可以找到相关描述,例如:
《ug249-occ-sensor-rd.pdf》
《ug252-lighting-rd.pdf》
《ug171-smart-outlet-rd.pdf》
大致介绍如下图:
这篇关于Silicon Labs EFR32 NodeTest的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!