Getting Started with i.MX 8M Mini and Matter
Brand: NXP Semiconductors
Document Version: Rev. 1.0
1 Introduction
Matter (previously known as Project CHIP) is a new single, unified, application-layer connectivity standard designed to enable developers to connect and build reliable, secure IoT (Internet of Things) ecosystems and increase compatibility among Smart Home and Building devices.
For enabling Matter devices, NXP offers scalable, flexible and secure platforms to enable the variety of use cases Matter addresses – from end nodes to gateways – so device manufacturers can focus on product innovation and accelerating time to market.
This document focuses on NXP's solution for Matter controller and OpenThread Border Router (OTBR) using the i.MX8M Mini Processor family.
The i.MX 8M Mini is NXP's first embedded multicore applications processor built using advanced 14LPC FinFET process technology, providing more speed and improved power efficiency. With commercial and industrial level qualification and backed by NXP's product longevity program, the i.MX 8M Mini family may be used in any general purpose industrial and IoT application.
Learn more: NXP i.MX 8M Mini Product Page
2 Hardware Setup
There are two possible hardware solutions for the i.MX8M Mini Matter enablement:
- i.MX8MM + 88W8987 (WiFi-BT combo Module) + K32W (OpenThread RCP module)
- i.MX8MM + IW612 (WiFi-BT-Thread tri-radio single-chip module)
2.1 Hardware Requirements
For i.MX 8M Mini Evaluation Kit (EVK):
- i.MX 8M Mini EVK
- USB Type C power supply
- USB A to micro USB cable
- USB A to USB C cable
For K32W061 DK006:
- K32W061 DK006
- K32W061 DK006 + OM15082
- K32W USB Dongle or K32W061 DK006
- USB A to MINI USB
- USB type C to A
For IW612 A1 RD Board:
- Micro-SD to SD adapter
- SDIO adapter with ribbon cable
- RD-IW612-CSP-IPA-2A-V2 evaluation board
Additional Hardware:
- Linux host computer
- Wi-Fi Access Point which supports IPv6 and IPv6 DHCP server
2.2 Software Requirements
- Universal Update Utility (UUU)
- A serial COM terminal for the host computer (refer to page 14 in the i.MX 8M Mini LPDDR4 EVKB Hardware User's Guide for setup instructions).
2.3 Hardware Connections
Diagram Description: A diagram illustrates the hardware connections for the OTBR i.MX8MM setup with either an 88W8987 + K32W configuration or an IW612 configuration. The diagram shows power connections (Wall Power, Power Adapter), a Host PC connection, and the respective modules (88w8987, K32W (RCP) or IW612). Icons representing Wi-Fi (?), Bluetooth (?), and Thread (?) are shown near the wireless modules.
Configuration 1: OTBR i.MX8MM + 88W8987 + K32W
Connections include:
- Wall Power -> Power Adapter -> i.MX8MM board
- Host PC -> i.MX8MM board
- K32W (RCP) connected to i.MX8MM board
- 88w8987 module connected to i.MX8MM board
Configuration 2: OTBR i.MX8MM + IW612
Connections include:
- Wall Power -> Power Adapter -> i.MX8MM board
- Host PC -> i.MX8MM board
- IW612 module connected to i.MX8MM board
Note: The IW612 driver in L5.15.52 BSP supports Wi-Fi/BT but not Thread. For Matter enablement, the IW612 OTBR driver and firmware must be built separately.
3 Matter Environment Setup
Matter development relies on open-source resources, leveraging Linux-based operating systems like Ubuntu and tools such as git, gcc, and python. It also includes GN (a meta build system) and Ninja (a build system).
The Matter SDK (Software Development Kit) contains all necessary components for installing tools, source code, and vendor applications.
To build a Matter application, a Linux environment is required. Recommended options are:
- A native Linux machine.
- If using Windows: Windows Subsystem for Linux (WSL) or a Linux Virtual Machine.
3.1 WSL Ubuntu 20.04 LTS
The Windows Subsystem for Linux (WSL) provides a GNU/Linux environment directly on Windows.
Steps to install WSL Ubuntu 20.04 LTS:
- On Windows 10, open PowerShell as administrator and run the following commands to enable WSL and Virtual Machine Platform features:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart your machine to complete the WSL installation.
- Install Ubuntu 20.04 LTS from the Microsoft Store.
Screenshot Description: A screenshot shows the Microsoft Store page for Ubuntu 20.04 LTS, highlighting its availability and installation options.
Create a user account and password for your new Linux distribution.
After installation, you may need to check and activate WSL 1 if WSL 2 is used. Run the following command in PowerShell as administrator:
wsl --list --verbose
wsl --set-version Ubuntu-20.04 1
Screenshot Description: A screenshot shows the Ubuntu terminal after installation, indicating successful setup. Another screenshot shows the Windows search results for 'Ubuntu 20.04 LTS' with an option to 'Run as administrator'.
3.2 Linux Virtual Machine
Steps to install VirtualBox and Ubuntu:
- Download and install VirtualBox from virtualbox.org.
- Download the Ubuntu 20.04 Focal desktop image ISO.
- Create a virtual machine with the following configuration:
- Operating System: Linux Ubuntu 20.04 (64-bit)
- Disk Size: More than 20GB
- Enable USB controller (USB 1.1 OHCI, USB 2.0 recommended via Extension Pack).
- Enable network adapter (Adapter 1 attached to Bridged Adapter).
Screenshot Description: A screenshot shows the VirtualBox Manager window with the settings for an Ubuntu 20.04 virtual machine, displaying general configuration details like Name, OS Type, and Version.
3.3 Setting up Matter Environment
Follow these steps to create a Matter build environment for the K32W0x1 MCU:
- Matter Dependencies:
- Update package lists and upgrade existing packages:
$ sudo apt update
$ sudo apt upgrade -y
- Install
dos2unix
(useful for WSL):
$ sudo apt-get install dos2unix
- Install Matter dependencies:
$ sudo apt-get install git gcc g++ python 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 gcc-arm-none-eabi
Restart the Linux machine.
- Generating the i.MX8MM Yocto image:
The Yocto Project (YP) is an open-source collaboration project that helps developers create custom Linux-based systems. It provides tools and a platform for sharing technologies, software stacks, and configurations for embedded and IoT devices.
- To build the Yocto Project, install the required packages:
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \ pylint3 xterm npm zstd build-essential libpython3-dev libdbus-1-dev python3.8-venv
- Install the
repo
tool:
$ mkdir ~/bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=~/bin:$PATH
- Install Python dependency packages:
$ wget https://raw.githubusercontent.com/project-chip/connectedhomeip/master/scripts/constraints.txt
$ pip3 install -r constraints.txt
$ pip3 install build mypy==0.910 types-setuptools pylint==2.9.3
$ pip install dbus-python
- Configure the Git environment if not already done:
$ git config --global user.name "Your Name"
$ git config --global user.email "Your Email"
- Setup the Yocto build environment:
Note: The Yocto source code is maintained with a repo manifest. The repo
tool downloads the source code.
$ mkdir ~/bin
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=${PATH}:~/bin
$ mkdir ${MY_YOCTO}
$ cd ${MY_YOCTO}
$ repo init -u https://github.com/nxp-imx/imx-manifest-b imx-linux-kirkstone -m imx-5.15.52-2.1.0.xml
$ repo sync
- Integrate the meta-matter recipe into the Yocto codebase:
$ cd ${MY_YOCTO}/sources/
$ git clone https://github.com/NXPmicro/meta-matter.git
Note: If using IW612 as RCP, add -DOT_POSIX_CONFIG_RCP_BUS=SPI
to sources/meta-matter/recipes-otbr/otbr/otbr.bb
.
More information on the Yocto release can be found in the i.MX Yocto Project User's Guide on the NXP website.
Ensure your Linux host's default Python is Python 2.7.x:
$ python -version
Python 2.7.x
Change directory to the Yocto source code top directory and execute the setup script:
$MACHINE=imx8mmevk DISTRO=fsl-imx-xwayland source sources/meta-matter/tools/imx-iot-setup.sh bld-xwayland-imx8mm
The system will create and enter the bld-xwayland-imx8mm/
directory to generate Yocto images. Execute the following command:
$ Bitbake imx-image-multimedia
Screenshot Description: A screenshot shows the output of the bitbake imx-image-multimedia
command, including build configuration details and task execution progress.
After the Yocto image is generated, it will be located at ${MY_YOCTO}/bld-xwayland-imx8mm/tmp/deploy/images/imx8mmevk/imx-image-multimedia-imx8mmevk.wic.bz2
.
Copy the .bz2
image to a separate folder (e.g., ${MY_images}
) before unzipping.
$ cp ${MY_YOCTO}/bld-xwayland-imx8mm/tmp/deploy/images/imx8mmevk/imx-image-multimedia-imx8mmevk.wic.bz2 ${MY_images}
Unzip the file using bzip2 -d
and then use dd
to program the output file to a microSD card. Caution: Verify the correct device name (e.g., /dev/sdc
) before executing the dd
command.
$ cd ${MY_images}
$ bzip2 -d imx-image-multimedia-imx8mmevk.wic.bz2
$ sudo dd if=imx-image-multimedia-imx8mmevk.wic of=/dev/sdc bs=4M conv=fsync
Alternatively, use the uuu
tool to flash the image:
$ uuu -b emmc_all imx-image-multimedia-imx8mmevk.wic.bz2
3. Generating the i.MX8MM Yocto SDK:
Generate the Yocto SDK using the command:
$ cd ${MY_YOCTO}/bld-xwayland-imx8mm
$ bitbake imx-image-multimedia -c populate_sdk
Install the NXP Yocto SDK and set environment variables by running the installation script:
$ sudo tmp/deploy/sdk/fsl-imx-xwayland-glibc-x86_64-imx-image-multimedia-armv8a-imx8mmevk-toolchain-5.15-kirkstone.sh
Follow the prompts to set the target directory for the SDK.
After installation, source the environment setup script (e.g., /opt/fsl-imx-xwayland/5.15-kirkstone-imx8mm/environment-setup-armv8a-poky-linux
) to import the Yocto build environment.
4. Matter Building Setup Instructions:
- Clone the Matter SDK using the public repository:
$ mkdir ${MY_Matter_Apps}
$ cd ${MY_Matter_Apps}
$ git clone https://github.com/project-chip/connectedhomeip.git
$ cd connectedhomeip
$ git checkout -t origin/v1.0-branch-imx
$ git submodule update --init
$ source scripts/activate.sh
Screenshot Description: A screenshot shows the terminal output after running the activate.sh
script, indicating that the Matter environment is ready.
4 Building and Running OpenThread Border Router Binaries with Yocto SDK
Fetch and build the latest OTBR source codes:
$ git clone https://github.com/openthread/ot-br-posix
$ cd ot-br-posix
$ git checkout -t origin/main
$ git submodule update --init
$ source ${yocto_matter_sdk}/environment-setup-cortexa53-crypto-poky-linux
For i.MX8MM + K32W configuration:
$./script/cmake-build -DOTBR_BORDER_ROUTING=ON -DOTBR_WEB=ON \ -DBUILD_TESTING=OFF \
DOTBR_DBUS=ON -DOTBR_DNSSD_DISCOVERY_PROXY=ON \-DOTBR_SRP_ADVERTISING_PROXY=ON \
DOT_THREAD_VERSION=1.3 \-DOTBR_INFRA_IF_NAME=mlan0 \-DOTBR_BACKBONE_ROUTER=ON \
DOTBR_BACKBONE_ROUTER_MULTICAST_ROUTING=ON \-DOTBR_MDNS=mDNSResponder \- \
DCMAKE_TOOLCHAIN_FILE=./examples/platforms/nxp/linux-imx/aarch64.cmake
For i.MX8MM + IW612 configuration:
$ ./script/cmake-build -DOTBR_BORDER_ROUTING=ON -DOTBR_WEB=ON \ -DBUILD_TESTING=OFF -DOTBR_DBUS=ON \
DOTBR_DNSSD_DISCOVERY_PROXY=ON \ -DOTBR_SRP_ADVERTISING_PROXY=ON -DOT_THREAD_VERSION=1.3 \ - \
DOTBR_INFRA_IF_NAME=mlan0 -DOT_POSIX_CONFIG_RCP_BUS=SPI \ -DOTBR_BACKBONE_ROUTER=ON \
DOTBR_BACKBONE_ROUTER_MULTICAST_ROUTING=ON \ -DOTBR_MDNS=mDNSResponder \ - \
DCMAKE_TOOLCHAIN_FILE=./examples/platforms/nxp/linux-imx/aarch64.cmake
The built executables are:
otbr-agent
: located in${MY_OTBR}/build/otbr/src/agent/otbr-agent
otbr-web
: located in${MY_OTBR}/build/otbr/src/web/otbr-web
ot-ctl
: located in${MY_OTBR}/build/otbr/third_party/openthread/repo/src/posix/ot-ctl
These files must be copied into Yocto's /usr/sbin/
folder.
Insert the uSD card flashed with the Yocto image into the board. Connect a micro USB cable from the DEBUG port to your PC and open a serial connection with the following parameters:
- Baud rate: 115200
- 8 data bits
- 1 stop bit
- No parity
- No flow control
Power on the board. After the boot sequence, log in as root
(no password required).
4.1 Setup OTBR on IMX8MMEVK + 88W8987+K32W
- Flash the K32W RCP binary to the K32W061DK6 or USB dongle. Refer to the K32W SDK documentation for DK6Programmer installation. The
ot-rcp-check-usart-idle-not-txifo-dmacore-interface.bin
binary is designed for IMX8MM and supports Matter V1.0 firmware.
$ DK6Programmer.exe -s COM${X}-e FLASH -p ot-rcp-check-usart-idle-not-txifo-dmacore-interface.bin
- Set
/etc/radvd.conf
to enable IPv6 RA functions:
$ vi /etc/radvd.conf
interface mlan0 {
AdvSendAdvert on;
}
- Sync with current time:
$ date -s "2022-11-20 17:14"
- Connect the OTBR to the target Wi-Fi AP network:
$/usr/libexec/bluetooth/Bluetoothd&
$modprobe moal mod_para=nxp/wifi_mod_para.conf
$ sysctl -w net.ipv6.conf.mlan0.accept_ra_rt_info_max_plen=64
$ sysctl -w net.ipv6.conf.mlan0.accept_ra_rt_info_min_plen=48
$ wpa_passphrase ${SSID} ${PASSWORD} > imxrouter.conf
$ wpa_supplicant -d -B -i mlan0 -c ./imxrouter.conf
$ udhcpc -i mlan0
$ systemctl restart radvd
$ sleep 4
$ hciattach /dev/ttymxc0 any 115200 flow
$ hciconfig hci0 up
$ echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
$ echo 1 > /proc/sys/net/ipv4/ip_forward
$ echo 2 > /proc/sys/net/ipv6/conf/all/accept_ra
$ ln -sf /usr/sbin/xtables-nft-multi /usr/sbin/ip6tables
$ ipset create -exist otbr-ingress-deny-src hash:net family inet6
$ ipset create -exist otbr-ingress-deny-src-swap hash:net family inet6
$ ipset create -exist otbr-ingress-allow-dst hash:net family inet6
$ ipset create -exist otbr-ingress-allow-dst-swap hash:net family inet6
- Setup OpenThread:
$ ./otbr-agent -I wpan0 -B mlan0 'spinel+hdlc+uart:///dev/ttyUSB0?uartbaudrate=1000000' -v -d 5 &
$ iptables -A FORWARD -i mlan0 -o wpan0 -j ACCEPT
$ iptables -A FORWARD -i wpan0 -o mlan0 -j ACCEPT
$ ip6tables -A FORWARD -i mlan0 -o wpan0 -j ACCEPT
$ ip6tables -A FORWARD -i wpan0 -o mlan0 -j ACCEPT
$ hciconfig hci0 up
$ otbr-web &
4.2 Setup OTBR on IMX8MMEVK + IW612
The IW612 driver and firmware are not integrated in the i.MX BSP. Obtain the necessary package from the provided link: IW612-18.99.1.p140.16-18.99.1.p140.16-MXM5X18354.p7_V1-MGPL
.
Change the i.MX8MM device tree blob (dtb) files to enable SPI communication with the IW612 A1 RD board:
- On PC: Copy the dtb file:
$ scp dts/imx8mm-evk-iw612-evk.dtb root@${imx8mm_ip}:/run/media/mmcblk2p1
- On i.MX8MM in uboot stage:
Uboot=> setenv fdtfile imx8mm-evk-iw612-evk.dtb
Uboot=> saveenv
Uboot=> boot
After rebooting, /dev/spidev1.0
should be visible in the filesystem.
Install IW612 driver and firmware on IMX8MM:
- On PC: Copy firmware and driver files:
$ scp fw/* root@${imx8mm_ip}:/lib/firmware/nxp
$ scp -r iw612 root@${imx8mm_ip}:/home/root
- Connect the OTBR to the AP network:
$ cd /home/root/iw612
$ date -s "2022-11-01 09:22"
$ /usr/libexec/bluetooth/Bluetoothd &
$ ./fw_loader /dev/ttymxc2 115200 0 /lib/firmware/nxp/uartspi_n61x_v1.bin.se 3000000
$ hciattach /dev/ttymxc2 any -s 3000000 3000000 flow dtron
$ hciconfig hci0 up
$ insmod mlan.ko
$ insmod sdxxx.ko mod_para=nxp/wifi_mod_para.conf
$ sysctl -w net.ipv6.conf.mlan0.accept_ra_rt_info_max_plen=64
$ sysctl -w net.ipv6.conf.mlan0.accept_ra_rt_info_min_plen=48
$ wpa_passphrase ${SSID} ${PASSWORD} > imxrouter.conf
$ wpa_supplicant -d -B -i mlan0 -c ./imxrouter.conf
$ udhcpc -i mlan0
$ systemctl restart radvd
$ sleep 4
- Configure network forwarding and IP tables:
$ echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
$ echo 1 > /proc/sys/net/ipv4/ip_forward
$ echo 2 > /proc/sys/net/ipv6/conf/all/accept_ra
$ ln -sf /usr/sbin/xtables-nft-multi /usr/sbin/ip6tables
$ ipset create -exist otbr-ingress-deny-src hash:net family inet6
$ ipset create -exist otbr-ingress-deny-src-swap hash:net family inet6
$ ipset create -exist otbr-ingress-allow-dst hash:net family inet6
$ ipset create -exist otbr-ingress-allow-dst-swap hash:net family inet6
- Setup OTBR:
$ ./otbr-agent-spi -I wpan0 -B mlan0 'spinel+spi:///dev/spidev1.0?gpio-resetdevice=/dev/gpiochip5&gpio-int-device=/dev/gpiochip5&gpio-int-line=12&gpio-resetline=13&spi-mode=0&spi-speed=1000000&spi-reset-delay=0&skip-rcp-compatibility-check=1' &
$ iptables -A FORWARD -i mlan0 -o wpan0 -j ACCEPT
$ iptables -A FORWARD -i wpan0 -o mlan0 -j ACCEPT
$ ip6tables -A FORWARD -i mlan0 -o wpan0 -j ACCEPT
$ ip6tables -A FORWARD -i wpan0 -o mlan0 -j ACCEPT
$ hciconfig hci0 up
$ other-web &
4.3 Form OTBR Network
To form the Thread Network, open the web interface, select the 'Form Window', configure the network, and press the 'Form' button.
Screenshot Description: Two screenshots show the OpenThread Border Router web interface. The first shows the 'Home' page with a question about Open Thread. The second shows the 'Form Thread Networks' page, with fields for Network Name, PAN ID, Passphrase, Network Key, Channel, On-Mesh Prefix, and a 'FORM' button.
Alternatively, set up the Thread Network using the command-line interface:
$ ./ot-ctl dataset init new
$ ./ot-ctl dataset networkkey 00112233445566778899aabbccddeeff
$ ./ot-ctl dataset channel 15
$ ./ot-ctl dataset panid 0x1234
$ ./ot-ctl dataset extpanid 1111111122222222
$ ./ot-ctl dataset networkname Matter-NXP-1
$ ./ot-ctl prefix add fd08:b89:78:f372::/64 paos med
$ ./ot-ctl ifconfig up
$ ./ot-ctl thread start
$ ./ot-ctl state
5 i.MX8MM Matter Examples
The current Matter SDK for the i.MX8MM platform provides reference examples for controller applications (CHIP-tool), OTA-provider apps, and end nodes (WiFi End Device applications).
Examples are listed under matter->examples
:
- CHIP Linux All-clusters Example
- CHIP Linux Lighting Example
- CHIP Linux Thermostat Example
- CHIP Linux CHIP-tool Example
- CHIP Linux OTA-provider Example
5.1 Matter Application Building Instruction
The following build example uses the CHIP-tool app:
- Set SDK environment variables:
$ export IMX_SDK_ROOT=/opt/fsl-imx-xwayland/5.15-kirkstone
- Start build environment by running the activate script:
$ source ./scripts/activate.sh
- Build the Chip-Tool:
$./scripts/build/build_examples.py --target imx-chip-tool build
- Alternatively, build an end-node app (e.g., Thermostat app):
$./scripts/build/imxlinux_examples.shexamples/nxp-thermostat/linux/out/nxpthermosta debug
Screenshot Description: A screenshot shows the terminal output of the build_examples.py
script for building the imx-chip-tool
, indicating successful compilation of targets.
After the build is complete, results are found in /connectedhomeip/out/imx-chip-tool/folder
.
5.2 Deploying Matter Application to the i.MX8MM Board
The chip-tool application needs to be transferred to the i.MX8 Mini. This can be done via SCP transfer software (e.g., WinSCP) or by copying it to the SD card used to flash the i.MX8 Mini image.
Transfer via SCP (using Windows machine):
- Connect the board to the same WiFi network as the PC running chip-tool.
- Discover the i.MX IPv4 address using the command:
ifconfig
. Look for the IPv4 address in themlan0
interface. - Open a new connection on WinSCP using the IPv4 address.
Screenshot Description: A screenshot shows the WinSCP login interface, with fields for Host name, User name, and Password, ready to connect to the i.MX8MM board.
Transfer via uSD card:
- Connect the uSD card to a PC using a card reader.
- Two new volumes, "USB Drive" and "BOOT", will appear.
- Open "BOOT" and copy the chip-tool application there.
- Plug the uSD card back into the i.MX8 Mini board and boot it up.
- Copy the chip-tool file from
/run/media/mmcblk1p1/
to the/home/root
folder on the board.
Screenshot Description: A screenshot shows Windows File Explorer with the contents of a USB drive, highlighting the 'BOOT' partition and the 'chip-tool' file within it. Another screenshot shows the WinSCP interface with files being transferred.
6 Matter Network – Chip Tool Commissioning and Control
This section requires the K32W0x1 to be set up as a Matter light app. Refer to "Getting started with K32W0X1 in Matter" for setup instructions.
The following instructions guide you on how to commission and run basic Matter Cluster commands from the CHIP-tool application built on the i.MX8MM platform.
Commissioning K32W0x1 over Bluetooth LE (Low Energy):
- Get the operational active dataset from the Thread Network by running the following command on the i.mx8m mini:
$ ot-ctl dataset active -x
Screenshot Description: A screenshot shows the output of the ot-ctl dataset active -x
command, displaying the active dataset in hexadecimal format.
- Activate BLE (Bluetooth Low Energy) advertising on the K32W0x platform by pressing the User Interface button.
- Commission the device to the Thread Network using the following command:
$ ./chip-tool pairing ble-thread {NODE_ID_TO_ASSIGN} {ACTIVE_DATASET} {SETUP_PIN_CODE}{DISCRIMINATOR}
Where:
{NODE_ID_TO_ASSIGN}
: The Matter node ID.{ACTIVE_DATASET}
: The Thread operational active dataset (hex format).{SETUP_PIN_CODE}
: The PIN code (default is 20202021).{DISCRIMINATOR}
: The discriminator (default is 3840).
Example:
$ ./chip-tool pairing ble-thread 1 hex:0e080000000000010000000300000f35060004001fffe0020811111111222222220708fd8e93c50a ce6eae051000112233445566778899aabbccddeeff030e47265616444656d6f01021234041061e1206d2 c2b46e079eb775f41fc72190c0402a0fff8 20202021 3840
Sending cluster commands to K32W0x1:
Commands are sent from the i.MX8m mini shell terminal.
The format is: $ ./chip-tool <cluster_name> <command_name> <param1, param2 ...>
Example usages:
- Toggle command on endpoint 1:
$ ./chip-tool onoff toggle 1 1
- Turn On command on endpoint 1:
$ ./chip-tool onoff on 1 1
- Turn Off command on endpoint 1:
$ ./chip-tool onoff off 1 1
- Send Attribute reporting configuration (min/max interval = 300s) for on-off attribute on endpoint 1:
$ ./chip-tool onoff report on-off 300 301 1 1
- Read Channel Attribute from Thread Diagnostic cluster:
$ ./chip-tool threadnetworkdiagnostics read channel 1 0
- Read fabrics list from basic cluster:
$ ./chip-tool operationalcredentials read fabrics-list 1 0
7 Matter Demo
7.1 Add a K32W end device in Matter Network
Diagram Description: A diagram illustrates the Matter demo setup. It shows a Wi-Fi Access Point (Wireless Router) connected to an i.MX8MM acting as an OTBR. The OTBR is connected via 'ble-thread' to a K32W device running a 'lighting-app'. The 8987 module is shown near the AP, indicating Wi-Fi connectivity.
7.1.1 Pairing commissionee (Lighting node) to commissioner (OTBR)
- Flash the K32W061 board with the lighting app (refer to K32W documentation).
- Press the reset button to power-cycle the board.
- Press the SW2 button on OM15802. After 6 seconds, this will reset the device's persistent configuration and initiate a reboot.
- Press the USERINTERFACE button to start BLE Advertising, which is mandatory for device commissioning.
NOTE: If the K32W061 device was previously paired, it's recommended to erase the external flash before pressing SW2 for a factory reset. Run DK6Programmer.exe -s COMxx -p k32w061dk6_EraseExtFlash.bin
, then input '1' on the UART console to start 'Erase Chip...' until 'Chip Erased !!!' is logged.
- Pair the board to the i.MX8M MINI controller using the ble-thread commissioning option:
$ ./chip-tool pairing ble-thread 1 hex:0e080000000000010000000300000f35060004001fffe0020811111111222222220708fd8e93c50a ce6eae051000112233445566778899aabbccddeeff030e47265616444656d6f01021234041061e1206d2 c2b46e079eb775f41fc72190c0402a0fff8 20202021 3840
Note: The commissioning process typically takes about 20 seconds. A "Device commissioning completed with success" message in the chip-tool log indicates successful network joining.
7.1.2 Control the device
- Send an on/off command:
$ chip-tool onoff toggle 1 1
You will observe the LED3 switching state between ON/OFF.
7.2 Android CHIP-TOOL
In this demo, an Android smartphone acts as the controller. The i.MX8M MINI serves as the OTBR, and the K32W is added as an end device in the Matter Network. Refer to the Android chip-tool build guide for more information.
Diagram Description: A diagram shows the Android CHIP-TOOL demo setup. An Android phone labeled 'Android Chip-Tool' connects via Wi-Fi to an 'AP Wireless Router'. The router is also connected to an 'imx8mm chip-tool OTBR' via IW612. The OTBR connects via 'ble-thread' to a K32W device running a 'lighting-app'.
Demo Setup Checks:
- Verify your AP has IPv6 capabilities and DHCPv6 server enabled.
- Check if the WAN supports IPv6.
- Ensure the i.MX received an IPv6 address other than the link-local address (starting with
inet6 fe80::
).
Screenshot Description: A screenshot shows the output of the ifconfig
command, displaying network interface details including IPv4 and IPv6 addresses.
- Connect the smartphone to your PC and install the chip-tool APK:
adb.exe install -r app-debug-nxp-v1.apk
- Factory reset the K32W.
- In the app, choose "Provision chip device with thread" and scan the QR code. The light app logs provide a link to the pairing QR code (e.g.,
https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3A6FCJ142C00KA0648G00
). - Alternatively, manually input the pairing code in the text box.
Screenshot Description: A screenshot shows the CHIPTool mobile application interface with a field to input a device address and a 'SUBMIT' button. The text 'MT:6FCJ142000KA0648600' is visible in the input field.
- Click submit, then input OTBR network information that was previously set up.
- If pairing succeeds, you will be able to control the ON/OFF and Level Control clusters.