1 # OpenThread on EFR32MG13 Example
3 This directory contains example platform drivers for the [Silicon Labs EFR32MG13][efr32mg13] based on [EFR32™ Mighty Gecko Wireless Starter Kit][slwstk6000b].
5 [efr32mg]: http://www.silabs.com/products/wireless/mesh-networking/efr32mg-mighty-gecko-zigbee-thread-soc
6 [slwstk6000b]: http://www.silabs.com/products/development-tools/wireless/mesh-networking/mighty-gecko-starter-kit
8 The example platform drivers are intended to present the minimal code necessary to support OpenThread. [EFR32MG13P SoC][efr32mg13p] has rich memory and peripheral resources which can support all OpenThread capabilities. See the "Run the example with EFR32MG13 boards" section below for an example using basic OpenThread capabilities.
10 See [sleepy-demo/README.md](sleepy-demo/README.md) for instructions for an example that uses the low-energy modes of the EFR32MG13 when running as a Sleepy End Device.
12 [efr32mg13p]: http://www.silabs.com/products/wireless/mesh-networking/efr32mg-mighty-gecko-zigbee-thread-soc/device.EFR32MG13P432F1024GL125
16 Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain].
18 [gnu-toolchain]: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
20 In a Bash terminal, follow these instructions to install the GNU toolchain and other dependencies.
23 $ cd <path-to-openthread>
29 1. Download and install the [Simplicity Studio][simplicity_studio].
31 [simplicity_studio]: http://www.silabs.com/products/development-tools/software/simplicity-studio
33 2. Install Flex (Gecko) SDK including RAIL Library from Simplicity Studio.
34 - Connect EFR32MG13P Wireless Starter Kit to Simplicity Studio.
35 - Find Flex SDK v2.7 in the Software Update page and click Install.
36 - Flex SDK v2.7 will be installed in the path: `/SimplicityStudio_v4/developer/sdks/gecko_sdk_suite`.
38 For more information on configuring, building, and installing applications for the Wireless Gecko (EFR32) portfolio using FLEX, see [Getting Started with the Silicon Labs Flex Software Development Kit for the Wireless Gecko (EFR32™) Portfolio][qsg138]. For more information on RAIL, see [Radio Abstraction Interface Layer][rail].
40 [qsg138]: https://www.silabs.com/documents/public/quick-start-guides/qsg138-flex-efr32.pdf
41 [rail]: http://www.silabs.com/products/development-tools/software/radio-abstraction-interface-layer-sdk
43 3. Configure the path to Flex SDK source code.
46 $ cd <path-to-openthread>/third_party
48 $ cd <path-to-Simplicity-Studio>/developer/sdks
49 $ cp -rf gecko_sdk_suite <path-to-openthread>/third_party/silabs/
52 Alternatively create a symbolic link to the Flex SDK source code.
55 $ cd <path-to-openthread>/third_party
57 $ ln -s <path-to-Simplicity-Studio>/developer/sdks/gecko_sdk_suite silabs/gecko_sdk_suite
60 4. Build OpenThread Firmware (CLI example) on EFR32 platform.
63 $ cd <path-to-openthread>
67 For EFR32MG13™ Mighty Gecko Wireless Starter Kit:
70 $ make -f examples/Makefile-efr32mg13 BOARD=BRD4168A
73 After a successful build, the `elf` files are found in `<path-to-openthread>/output/efr32mg13/bin`.
77 Compiled binaries may be flashed onto the EFR32 using [JLinkGDBServer][jlinkgdbserver]. EFR32 Starter kit mainboard integrates an on-board SEGGER J-Link debugger.
79 [jlinkgdbserver]: https://www.segger.com/jlink-gdb-server.html
82 $ cd <path-to-JLinkGDBServer>
83 $ sudo ./JLinkGDBServer -if swd -device EFR32MG13PxxxF1024
84 $ cd <path-to-openthread>/output/efr32/bin
85 $ arm-none-eabi-gdb ot-cli-ftd
86 $ (gdb) target remote 127.0.0.1:2331
92 Note: Support for the "EFR32MG13PxxxF1024" device was added to JLinkGDBServer V6.14d.
94 Or Compiled binaries also may be flashed onto the specified EFR32 dev board using [J-Link Commander][j-link-commander].
96 [j-link-commander]: https://www.segger.com/products/debug-probes/j-link/tools/j-link-commander/
99 $ cd <path-to-openthread>/output/efr32mg13/bin
100 $ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.hex
101 $ JLinkExe -device EFR32MG13PxxxF1024 -speed 4000 -if SWD -autoconnect 1 -SelectEmuBySN <SerialNo>
102 $ J-Link>loadfile ot-cli-ftd.hex
107 Note: SerialNo is J-Link serial number. Use the following command to get the serial number of the connected J-Link.
113 Alternatively Simplicity Commander provides a graphical interface for J-Link Commander.
116 $ cd <path-to-openthread>/output/efr32mg13/bin
117 $ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.ihex
118 $ <path-to-simplicity-studio>/developer/adapter_packs/commander/commander
121 In the J-Link Device drop-down list select the serial number of the device to flash. Click the Adapter Connect button. Ensure the Debug Interface drop-down list is set to SWD and click the Target Connect button. Click on the Flash icon on the left side of the window to switch to the flash page. In the Flash MCU pane enter the path of the ot-cli-ftd.s37 file or choose the file with the Browse... button. Click the Flash button located under the Browse... button.
123 ## Run the example with EFR32MG13 boards
125 1. Flash two EFR32 boards with the `CLI example` firmware (as shown above).
126 2. Open terminal to first device `/dev/ttyACM0` (serial port settings: 115200 8-N-1). Type `help` for a list of commands.
150 routerupgradethreshold
158 3. Start a Thread network as Leader.
166 Channel Mask: 0x07fff800
167 Ext PAN ID: d63e8e3e495ebbc3
168 Mesh Local Prefix: fd3d:b50b:f96d:722d::/64
169 Master Key: dfd34f0f05cad978ec4e32b0413038ff
170 Network Name: OpenThread-8f28
172 PSKc: c23a76e98f1a6483639b1ac1271e2e27
173 Security Policy: 0, onrcb
175 > dataset commit active
182 wait a couple of seconds...
189 4. Open terminal to second device `/dev/ttyACM1` (serial port settings: 115200 8-N-1) and attach it to the Thread network as a Router.
192 > dataset masterkey dfd34f0f05cad978ec4e32b0413038ff
194 > dataset commit active
196 > routerselectionjitter 1
203 wait a couple of seconds...
210 5. List all IPv6 addresses of Leader.
214 fd3d:b50b:f96d:722d:0:ff:fe00:fc00
215 fd3d:b50b:f96d:722d:0:ff:fe00:c00
216 fd3d:b50b:f96d:722d:7a73:bff6:9093:9117
217 fe80:0:0:0:6c41:9001:f3d6:4148
221 6. Send an ICMPv6 ping to Leader's Mesh-EID IPv6 address.
224 > ping fd3d:b50b:f96d:722d:7a73:bff6:9093:9117
225 16 bytes from fd3d:b50b:f96d:722d:558:f56b:d688:799: icmp_seq=1 hlim=64 time=24ms
228 The above example demonstrates basic OpenThread capabilities. Enable more features/roles (e.g. commissioner, joiner, DHCPv6 Server/Client, etc.) by assigning compile-options before compiling.
231 $ cd <path-to-openthread>
233 $ make -f examples/Makefile-efr32mg13 COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1
236 For a list of all available commands, visit [OpenThread CLI Reference README.md][cli].
238 [cli]: https://github.com/openthread/openthread/blob/master/src/cli/README.md
242 The following toolchain has been used for testing and verification:
246 The EFR32 example has been verified with following Flex SDK/RAIL Library version:
248 - Flex SDK version 2.7.0.0