1 # OpenThread on EFR32MG21 Example
3 This directory contains example platform drivers for the [Silicon Labs EFR32MG21][efr32mg] 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. [EFR32MG21 SoC][efr32mg21] has rich memory and peripheral resources which can support all OpenThread capabilities. See the "Run the example with EFR32 boards" section below for an example using basic OpenThread capabilities.
10 [efr32mg21]: https://www.silabs.com/products/wireless/mesh-networking/series-2-efr32-mighty-gecko-zigbee-thread-soc/device.efr32mg21a020f768im32
14 Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain].
16 [gnu-toolchain]: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
18 In a Bash terminal, follow these instructions to install the GNU toolchain and other dependencies.
21 $ cd <path-to-openthread>
27 1. Download and install the [Simplicity Studio][simplicity_studio].
29 [simplicity_studio]: http://www.silabs.com/products/development-tools/software/simplicity-studio
31 2. Install Flex (Gecko) SDK including RAIL Library from Simplicity Studio.
32 - Connect EFR32MG21 Wireless Starter Kit to Simplicity Studio.
33 - Find Flex SDK v2.7 in the Software Update page and click Install.
34 - Flex SDK v2.7 will be installed in the path: `/SimplicityStudio_v4/developer/sdks/gecko_sdk_suite`.
36 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].
38 [qsg138]: https://www.silabs.com/documents/public/quick-start-guides/qsg138-flex-efr32.pdf
39 [rail]: http://www.silabs.com/products/development-tools/software/radio-abstraction-interface-layer-sdk
41 3. Configure the path to Flex SDK source code.
44 $ cd <path-to-Simplicity-Studio>/developer/sdks
45 $ cp -rf gecko_sdk_suite <path-to-openthread>/third_party/silabs/
48 Alternatively create a symbolic link to the Flex SDK source code.
51 $ cd <path-to-openthread>/third_party
52 $ ln -s <path-to-Simplicity-Studio>/developer/sdks/gecko_sdk_suite silabs/gecko_sdk_suite
55 Note: Due to an error in the core_cm33.h file provided by ARM, the compiler will throw an error when pedantic option is used on the builds. To avoid this, please add the following lines of code at the top of the file core_cm33.h:
59 #pragma GCC diagnostic ignored "-Wpedantic"
63 core_cm33.h can be found at:
66 <path-to-Simplicity-Studio>/developer/sdks/gecko_sdk_suite/v2.7/platform/CMSIS/Include
69 4. Build OpenThread Firmware (CLI example) on EFR32 platform.
72 $ cd <path-to-openthread>
76 For EFR32MG21™ Mighty Gecko Wireless Starter Kit:
79 $ make -f examples/Makefile-efr32mg21 BOARD=BRD4180A
82 After a successful build, the `elf` files are found in `<path-to-openthread>/output/efr32mg21/bin`.
86 Simplicity Commander provides a graphical interface for J-Link Commander.
89 $ cd <path-to-openthread>/output/efr32mg21/bin
90 $ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.hex
91 $ <path-to-simplicity-studio>/developer/adapter_packs/commander/commander
94 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.
96 ## Run the example with EFR32MG21 boards
98 1. Flash two EFR32 boards with the `CLI example` firmware (as shown above).
99 2. Open terminal to first device `/dev/ttyACM0` (serial port settings: 115200 8-N-1). Type `help` for a list of commands.
123 routerupgradethreshold
131 3. Start a Thread network as Leader.
141 wait a couple of seconds...
148 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.
153 > routerselectionjitter 1
160 wait a couple of seconds...
167 5. List all IPv6 addresses of Leader.
171 fdde:ad00:beef:0:0:ff:fe00:fc00
172 fdde:ad00:beef:0:0:ff:fe00:800
173 fdde:ad00:beef:0:5b:3bcd:deff:7786
174 fe80:0:0:0:6447:6e10:cf7:ee29
178 6. Send an ICMPv6 ping to Leader's Mesh-EID IPv6 address.
181 > ping fdde:ad00:beef:0:5b:3bcd:deff:7786
182 8 bytes from fdde:ad00:beef:0:5b:3bcd:deff:7786: icmp_seq=1 hlim=64 time=24ms
185 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.
188 $ cd <path-to-openthread>
190 $ make -f examples/Makefile-efr32mg21 COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1
193 For a list of all available commands, visit [OpenThread CLI Reference README.md][cli].
195 [cli]: https://github.com/openthread/openthread/blob/master/src/cli/README.md
199 The following toolchain has been used for testing and verification:
203 The EFR32 example has been verified with following Flex SDK/RAIL Library version:
205 - Flex SDK version 2.7.0.0