The all-clusters example implements a server which can be accessed by a CHIP controller and can accept basic cluster commands.
The example is based on Project CHIP and the NXP RT1170 SDK, and provides a prototype application that demonstrates device commissioning and different cluster control.
The RT1170 all-cluster application provides a working demonstration of the RT1170 board integration, built using the Project CHIP codebase and the NXP RT1170 SDK.
The example supports:
The example targets the NXP MIMXRT1170-EVKB board by default.
Here are listed configurations that allow to support Matter over Wi-Fi & Matter over Thread on RT1170 :
Host part:
Transceiver part :
To support SPI on the MIMXRT1170-EVK-B board, it is required to remove 0Ω resistors R404,R406,R2015.
Plug IW612 module to M.2 connector on Murata uSD to M2 adapter
The Murata uSD-M2 adapter should be plugged to the RT1170 via SD-IO.
The below tables explain pin settings (SPI settings) to connect the MIMXRT1170-EVK-B (host) to a IW612 transceiver (rcp).
Jumpers positions on Murata uSD to M2 adapter:
Use USB-C power supply | Jumper | Position| | :----: | :-----: | | J1 | 1-2 | | J12 | 1-2 | | J13 | 1-2 | | J14 | 1-2 | | JP1.1 (back side)| ON |
Jumpers positions on MIMXRT1170-EVK-B:
Jumper | Position |
---|---|
J56 | 2-3 |
I2C connection to program IO_Expander
on the IW612 module
MIMXRT1170-EVK-B | uSD-M2 adapter |
---|---|
I2C_SDA (J10.18) | J5.2 |
I2C_SDL (J10.20) | J5.4 |
SPI connection between RT1170 and uSD-M2 adapter
MIMXRT1170-EVK-B | uSD-M2 adapter |
---|---|
SPI_MOSI (J10.8) | J5.10 |
SPI_MISO (J10.10) | J9.7 |
SPI_CLK (J10.12) | J9.8 |
SPI_CS (J10.6) | J5.8 |
SPI_INT (J26.4) | J5.6 |
GND (J10.14) | J5.15 |
UART BLE and Reset connections between RT1170 and uSD-M2 adapter
MIMXRT1170-EVK-B | uSD-M2 adapter |
---|---|
RESET (J26.2) | J9.3 |
UART_RXD (J25.13) | J9.1 |
UART_TXD (J25.15) | J9.2 |
UART_CTS (J25.9) | J8.4 |
UART_RTS (J25.11) | J8.3 |
GND (J26.1) | J7.6 |
In order to build the Project CHIP example, we recommend using a Linux distribution. Supported Operating Systems are listed in BUILDING.md.
sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev \ libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev \ python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev
user@ubuntu:~/Desktop/git/connectedhomeip$ scripts/checkout_submodules.py --shallow --platform nxp --recursive
user@ubuntu:~/Desktop/git/connectedhomeip$ source scripts/activate.sh
If the script says the environment is out of date, you can update it by running the following command:
user@ubuntu:~/Desktop/git/connectedhomeip$ source scripts/bootstrap.sh
user@ubuntu:~/Desktop/git/connectedhomeip$ third_party/nxp/nxp_matter_support/scripts/update_nxp_sdk.py --platform common
Note: By default update_nxp_sdk.py will try to initialize all NXP SDKs. Arg “-- help” could be used to view all available options.
user@ubuntu:~/Desktop/git/connectedhomeip$ cd examples/all-cluster-app/nxp/rt/rt1170/
user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rt1170$ gn gen --args="chip_enable_wifi=true iwx12_transceiver=true chip_config_network_layer_ble=true chip_enable_ble=true " out/debug user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rt1170$ ninja -C out/debug
user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-cluster/nxp/rt/rt1170$ gn gen --args="chip_enable_openthread=true iwx12_transceiver=true chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=true" out/debug user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-cluster/nxp/rt/rt1170/$ ninja -C out/debug
This configuration supports the Thread Border Router management cluster to provision the Thread credentials. Enabling the Matter CLI in order to control the Thread network on the Border Router is optional but recommended for other features like the Thread credential sharing.
Note that the Thread Border Router management cluster is only supported on the thermostat application for now.
user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rt11170$ gn gen --args="chip_enable_wifi=true iwx12_transceiver=true chip_config_network_layer_ble=true chip_enable_ble=true chip_enable_openthread=true nxp_enable_matter_cli=true" out/debug user@ubuntu:~/Desktop/git/connectedhomeip/examples/all-clusters-app/nxp/rt/rt1170$ ninja -C out/debug
The resulting output file can be found in out/debug/chip-rt1170-all-cluster-example.
Optional GN options that can be added when building an application:
chip_enable_secondary_nwk_if=true
and chip_device_config_thread_network_endpoint_id=3
must be added to the gn gen command. Note that this is only supported when building the Matter over Wifi + OpenThread Border Router configuration. Note that is only supported on the on the thermostat application for now.nxp_enable_matter_cli=true
must be added to the gn gen command.is_debug=true optimize_debug=false
must be added to the gn gen command.nxp_use_factory_data=true
must be added to the gn gen command. For more information, see Guide for writing manufacturing data on NXP deviceschip_enable_ota_requestor=true no_mcuboot=false
must be added to the gn gen command. More information about the OTA Requestor feature in OTA Requestor README.See Guide for writing manufacturing data on NXP devices
Other comments:
The all cluster app demonstrates the usage of encrypted Matter manufacturing data storage. Matter manufacturing data should be encrypted using an AES 128 software key before flashing them to the device flash.
In order to flash the application we recommend using MCUXpresso IDE (version >= 11.5.0).
File -> Import -> C/C++ -> Existing Code as Makefile Project
Right click on the Project -> Properties -> C/C++ Build -> MCU Settings -> Select MIMXRT1170 -> Apply & Close
Sometimes when the MCU is selected it will not initialize all the memory regions (usually the BOARD_FLASH
, BOARD_SDRAM
and NCACHE_REGION
) so it is required that this regions are added manually like in the image above. In addition to that on the BOARD_FLASH
line, in the driver tab:
click inside the tab and on the right side a button with three horizontal dots will appear click on the button and an window will show form the dropdown menu select the MIMXRT1170_SFDP_QSPI driver
Right click on the Project -> C/C++ Build-> Tool Chain Editor -> NXP MCU Tools -> Apply & Close
Create a debug configuration:
MIMXRT1170-EVK-B board supports CMSIS-DAP debug protocol by default. It should be switched to JLink.
Right click on the Project -> Debug -> As->SEGGER J-Link probes -> OK -> Select elf file
Right click on the Project -> Debug As -> Debug configurations... -> Startup set non-stop on set pagination off set mi-async set remotetimeout 60000 ##target_extended_remote## set mem inaccessible-by-default ${mem.access} mon ondisconnect ${ondisconnect} set arm force-mode thumb ${load}
Right click on the Project -> Utilities -> Open Directory Browser here -> edit .launch file: <booleanAttribute key="vector.catch" value="false"/>
To know how to commission a device over BLE, follow the instructions from chip-tool's README.md ‘Commission a device over BLE’.
To know how to commissioning a device over IP, follow the instructions from chip-tool's README.md ‘Pair a device over IP’
The “ble-wifi” pairing method can be used in order to commission the device.
The “ble-thread” pairing method can be used in order to commission the device.
In order to create or join a Thread network on the Matter Border Router, the TBR management cluster or the otcli
commands from the matter CLI can be used. For more information about using the TBR management cluster follow instructions from ‘Using the TBR management cluster’. For more information about using the matter shell, follow instructions from ‘Testing the all-clusters application with Matter CLI’.
In this configuration, the device can be commissioned over Wi-Fi with the ‘ble-wifi’ pairing method.
Prepare the board with the flashed All-cluster application
(as shown above).
The All-cluster example uses UART1 to print logs while running the server. To view raw UART output, start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
Open a terminal connection on the board and watch the printed logs.
On the client side, start sending commands using the chip-tool application as it is described here.
Testing the all-clusters application with Matter CLI enabled:
The Matter CLI can be enabled with the all-clusters application.
For more information about the Matter CLI default commands, you can refer to the dedicated ReadMe.
The All-clusters application supports additional commands :
> help [...] mattercommissioning Open/close the commissioning window. Usage : mattercommissioning [on|off] matterfactoryreset Perform a factory reset on the device matterreset Reset the device
matterfactoryreset
command erases the file system completely (all Matter settings are erased).matterreset
enables the device to reboot without erasing the settings.Here are described steps to use the all-cluster-app with the Matter CLI enabled
Prepare the board with the flashed All-cluster application
(as shown above).
The matter CLI is accessible in UART1. For that, start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
The All-cluster example uses UART2 to print logs while running the server. To view raw UART output, a pin should be plugged to an USB to UART adapter (connector J9 pin 4), then start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
On the client side, start sending commands using the chip-tool application as it is described here.
For Matter with OpenThread Border Router support, the matter CLI can be used to start/join the Thread network, using the following ot-cli commands. (Note that setting channel, panid, and network key is not enough anymore because of an Open Thread stack update. We first need to initialize a new dataset.)
> otcli dataset init new Done > otcli dataset Active Timestamp: 1 Channel: 25 Channel Mask: 0x07fff800 Ext PAN ID: 42af793f623aab54 Mesh Local Prefix: fd6e:c358:7078:5a8d::/64 Network Key: f824658f79d8ca033fbb85ecc3ca91cc Network Name: OpenThread-b870 PAN ID: 0xb870 PSKc: f438a194a5e968cc43cc4b3a6f560ca4 Security Policy: 672 onrc 0 Done > otcli dataset panid 0xabcd Done > otcli dataset channel 25 Done > otcli dataset commit active Done > otcli ifconfig up Done > otcli thread start Done > otcli state leader Done
To enable Thread Border Router support see the build section.
The complete Border Router guide is located here.