1 #CHIP EFR32 Pigweed Example Application
3 The EFR32 example demonstrates the usage of Pigweed module functionalities in an
6 The example is based on [CHIP](https://github.com/project-chip/connectedhomeip),
7 the [Pigweed](https://pigweed.googlesource.com/pigweed/pigweed) module, which is
8 a collection of libraries that provide different functionalities for embedded
9 systems, and the EFR32 platform.
11 You can use this example as a training ground for making experiments, testing
12 Pigweed module features and checking what actions are necessary to fully
13 integrate Pigweed in a CHIP project.
15 Pigweed functionalities are being gradually integrated into CHIP. Currently, the
16 following features are available:
18 - **Echo RPC** - Creates a Remote Procedure Call server and allows sending
19 commands through the serial port to the device, which makes echo and sends
20 the received commands back.
24 - [CHIP EFR32 Pigweed Example Application](#chip-EFR32-pigweed-example-application)
25 - [Building the Example Application](#building-the-example-application)
26 - [To build the application, follow these steps:](#to-build-the-application-follow-these-steps)
27 - [Testing the Example Application](#testing-the-example-application)
31 ## Building the Example Application
33 - Download or clone the
34 [sdk_support](https://github.com/SiliconLabs/sdk_support) from GitHub
36 clone https://github.com/SiliconLabs/sdk_support.git and export the path
38 export EFR32_SDK_ROOT=<Path to cloned git repo>
41 [Simplicity Commander](https://www.silabs.com/mcu/programming-options)
42 command line tool, and ensure that `commander` is your shell search path.
43 (For Mac OS X, `commander` is located inside
44 `Commander.app/Contents/MacOS/`.)
46 export PATH=/Applications/Commander.app/Contents/MacOS:$PATH
48 - Download and install a suitable ARM gcc tool chain:
49 [GNU Arm Embedded Toolchain 9-2019-q4-major](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
51 - Install some additional tools(likely already present for CHIP developers):
53 #Linux sudo apt-get install git libwebkitgtk-1.0-0 ninja-build
55 #Mac OS X brew install ninja
61 - BRD4161A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@19dBm
62 - BRD4163A / SLWSTK6000B / Dual band Wireless Starter Kit / 2.4GHz@19dBm,
64 - BRD4164A / SLWSTK6000B / Dual band Wireless Starter Kit / 2.4GHz@19dBm,
66 - BRD4166A / SLTB004A / Thunderboard Sense 2 / 2.4GHz@10dBm
67 - BRD4170A / SLWSTK6000B / Multiband Wireless Starter Kit / 2.4GHz@19dBm,
69 - BRD4304A / SLWSTK6000B / MGM12P Module / 2.4GHz@19dBm
73 - BRD4180A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm
75 * Build the example application:
77 cd ~/connectedhomeip/examples/pigweed-app/efr32
78 git submodule update --init
79 source third_party/connectedhomeip/scripts/activate.sh
80 export EFR32_BOARD=BRD4161A
84 - To delete generated executable, libraries and object files use:
86 cd ~/connectedhomeip/examples/pigweed-app/efr32
89 ### Flashing the Application
91 - On the command line:
93 cd ~/connectedhomeip/examples/pigweed-app/efr32
94 python3 out/debug/chip-efr32-pigweed-example.flash.py
96 - With the Commander app, just load the .s37 file.
97 - Or with the Ozone debugger, just load the .out file.
99 ## Testing the Example Application
101 - Determine the serial port name for the EFR device by checking /dev: ls
104 It should look like this :
108 /dev/tty.usbmodem0004401548451
110 - Run the following command to start an interactive Python shell, where the
111 Echo RPC commands can be invoked:
113 python -m pw_hdlc.rpc_console --device /dev/tty.usbmodem0004401548451 -b 115200 <CHIP_ROOT>/third_party/pigweed/repo/pw_rpc/pw_rpc_protos/echo.proto -o /tmp/pw_rpc.out
115 - To send an Echo RPC message, type the following command, where the actual
116 message is the text in quotation marks after the `msg=` phrase:
118 rpcs.pw.rpc.EchoService.Echo(msg="hi")
120 Note: Some users might have to install the
121 [VCP driver](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)
122 before the device shows up on `/dev/tty`.
126 While most of the RAM usage in CHIP is static, allowing easier debugging and
127 optimization with symbols analysis, we still need some HEAP for the crypto and
128 OpenThread. Size of the HEAP can be modified by changing the value of the
129 `SL_STACK_SIZE` define inside of the BUILD.gn file of this example. Please take
130 note that a HEAP size smaller than 5k can and will cause a Mbedtls failure
131 during the BLE rendez-vous.