OpenThread on EFR32 Example

This directory contains example platform drivers for the Silicon Labs EFR32 based on EFR32™ Mighty Gecko Wireless Starter Kit.

The example platform drivers are intended to present the minimal code necessary to support OpenThread. EFR32MG12P SoC 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.

Toolchain

Download and install the GNU toolchain for ARM Cortex-M.

Build Examples

  1. Download and install the Simplicity Studio.
  1. Install Flex (Gecko) SDK including RAIL Library from Simplicity Studio.
    • Connect EFR32MG12P Wireless Starter Kit to Simplicity Studio.
    • Find the latest Flex SDK in the Software Update page and click Install.
    • Flex SDK will be installed in the path: /SimplicityStudio_v4/developer/sdks/gecko_sdk_suite.

For more information on configuring, building, and installing applications for the Wireless Gecko (EFR32) portfolio using RAIL, see Getting Started with RAIL Library quick start guide. For more information on RAIL, see Radio Abstraction Interface Layer.

  1. Configure the path to Flex SDK source code.
$ cd <path-to-openthread>/third_party
$ mkdir silabs
$ cd <path-to-Simplicity-Studio>/developer/sdks
$ cp -rf gecko_sdk_suite <path-to-openthread>/third_party/silabs/
  1. Build OpenThread Firmware (CLI example) on EFR32 platform.
$ cd <path-to-openthread>
$ ./bootstrap
$ make -f examples/Makefile-efr32

After a successful build, the elf files are found in <path-to-openthread>/output/efr32/bin.

Flash Binaries

Compiled binaries may be flashed onto the EFR32 using JLinkGDBServer. EFR32 Starter kit mainboard integrates an on-board SEGGER J-Link debugger.

$ cd <path-to-JLinkGDBServer>
$ sudo ./JLinkGDBServer -if swd -device EFR32MG12PxxxF1024
$ cd <path-to-openthread>/output/efr32/bin
$ arm-none-eabi-gdb ot-cli-ftd
$ (gdb) target remote 127.0.0.1:2331
$ (gdb) load
$ (gdb) monitor reset
$ (gdb) c

Note: Support for the “EFR32MG12PxxxF1024” device was added to JLinkGDBServer V6.14d.

Run the example with EFR32 boards

  1. Flash two EFR32 boards with the CLI example firmware (as shown above).
  2. Open terminal to first device /dev/ttyACM0 (serial port settings: 115200 8-N-1). Type help for a list of commands.
> help
help
channel
childtimeout
contextreusedelay
extaddr
extpanid
ipaddr
keysequence
leaderweight
masterkey
mode
netdataregister
networkidtimeout
networkname
panid
ping
prefix
releaserouterid
rloc16
route
routerupgradethreshold
scan
start
state
stop
whitelist
  1. Start a Thread network as Leader.
> panid 0xface
Done
> ifconfig up
Done
> thread start
Done

wait a couple of seconds...

> state
leader
Done
  1. Open terminal to second device /dev/ttyACM1 (serial port settings: 115200 8-N-1) and attach it to the Thread network as a Router.
> panid 0xface
Done
> routerselectionjitter 1
Done
> ifconfig up
Done
> thread start
Done

wait a couple of seconds...

> state
router
Done
  1. List all IPv6 addresses of Leader.
> ipaddr
fdde:ad00:beef:0:0:ff:fe00:fc00
fdde:ad00:beef:0:0:ff:fe00:800
fdde:ad00:beef:0:5b:3bcd:deff:7786
fe80:0:0:0:6447:6e10:cf7:ee29
Done
  1. Send an ICMPv6 ping to Leader's Mesh-EID IPv6 address.
> ping fdde:ad00:beef:0:5b:3bcd:deff:7786
8 bytes from fdde:ad00:beef:0:5b:3bcd:deff:7786: icmp_seq=1 hlim=64 time=24ms

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.

$ cd <path-to-openthread>
$ ./bootstrap
$ make -f examples/Makefile-efr32 COMMISSIONER=1 JOINER=1 DHCP6_CLIENT=1 DHCP6_SERVER=1

For a list of all available commands, visit OpenThread CLI Reference README.md.

Verification

The following toolchain has been used for testing and verification:

  • gcc version 4.9.3

The EFR32 example has been verified with following Flex SDK/RAIL Library version:

  • Flex SDK version 1.1.1.0, RAIL Library version 1.5.2
  • Flex SDK version 1.2.0.0, RAIL Library version 1.6.0