NXP MW320 Development Boards User Manual
- June 3, 2024
- NXP
Table of Contents
NXP MW320 Development Boards
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 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 WiFi enabled platforms using the
88MW32x Micocontroller family.
The Wi-Fi® Microcontroller Platform provides a highly cost-effective, flexible, and easy-to-use hardware/software platform to build a new generation of smart connected devices delivering a broad-range of services to consumers including thermostats, appliances, lighting, home automation and remote access.
The platform is built using our high-performance 88MW32x Cortex-M4F Microcontroller and low power 802.11 b/g/n Wi-Fi® SoCs. It is powered by proven, field-tested EZ-Connect™ Software Development Kit (SDK.) This simplifies development and enables OEMs to focus on value-added features, and delivering applications and services to their customers.
https://www.nxp.com/part/MW320#/
HARDWARE SETUP
The minimum hardware required to create and run an end to end Matter setup with i.MX8MM is listed below:
- i.mx8m mini evk – acting as a Thread Border Router and Chip Controller: i.MX8MM-EVKB
- MW320 EVK – acting as Matter Accessory Device: MW320-EVK
MATTER ENVIRONMENT SETUP
Matter development relies on open-source resources, leveraging Linux based
operating systems like Ubuntu and other tools like git, gcc or python. This
also includes GN, a meta build system that generates makefiles and Ninja, a
build system meant to replace Make tool.
Matter is available as an open-source SDK containing all the necessary
components from scripts to install required tools to stack source code and
vendor provided applications.
First step in developing a Matter application is to have Linux support for the
build. The recommendation is to have a native Linux machine. If Windows is
preferred operating system, support for the build can be set by using:
- Windows Subsystem for Linux (WSL);
- Linux Virtual Machine;
WSL Ubuntu 20.04 LTS
The Windows Subsystem for Linux (WSL) provides a GNU/Linux environment
directly to Windows. Use the following steps to install the WSL Ubunut 20.04
LTS:
-
On Windows 10, open PowerShell as administrator and run the following commands:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem- Linux /all /norestart-
Enable virtual machine feature:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart -
Restart your machine to complete the WSL installation
-
-
Install the Ubuntu 20.04 from Microsoft Store
-
Create a user account and password for your new Linux distribution
-
Next you will have to check the WSL version and activate WSL 1, if 2 is used. Run PowerShell as administrator:
The following command is used to check the wsl version:
wsl –list –verbose
If wsl version 2 is used, then activate wsl 1 using:
wsl –set-version Ubuntu-20.04 1 -
After installation is complete, run Ubuntu 20.04 LTS as administrator.
-
Linux Virtual Machine
The following steps guide you through virtual box machine installation steps:
- Download and install virtual machine: https://www.virtualbox.org/wiki/Downloads
- Please consider that based on your operating system some extra steps will be required for enabling the Virtualization support.
- Download the desktop image for Ubuntu 20.04 Focal and create virtual machine using the downloaded ISO.
- Configure the virtual machine:
- Linux Ubuntu 20.04 (64 bit);
- VM disk size – more than 20GB;
- Enable USB controller -> USB 1.1(OHCI) Controller (support for USB 2.0 is recommended, if possible, this being available via the Oracle VM VirtualBox Extension Pack);
- Enable network adapter-> Adapter 1 -> Attached to Bridged Adapter;
Setting up Matter Environment
The following steps guide you through creating Matter build environment.
- Matter Dependencies:
- Check for updates and install dos2unix (useful for WSL):
- $ sudo apt update
- $ sudo apt upgrade –y
- $ 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.
- Matter Building Setup instructions:
- Clone the Matter SDK using the public repo:
- $ git clone https://github.com/nxptest/connectedhomeip
- $ cd connectedhomeip
- $ git checkout tags/Ref_kit_v0.92
- Start build environment by running the activate script:$ source ./scripts/activate.sh
MW320 MATTER EXAMPLES
In the current Matter SDK for MW320 platform we are providing an
implementation for the all-clusters example that was intended to work in
different setups as either light node, light switch node or both.
Matter application building instruction
The following build example will be based on the all-clusters app example:
-
Change the directory to the all-clusters application base directory and run the following command in order to download the
- MW320 SDK as a submodule:
$ cd examples/all-clusters-app/nxp/mw320
$ git submodule update –init
- MW320 SDK as a submodule:
-
Generate the build files using GN and start building the application image with the Ninja tool
- The built application can be found in the
/out/debug/ folder
- The built application can be found in the
Matter application building instruction
- In order to flash the board the OpenOCD (Open On-Chip Debugger) package $ sudo apt-get install openocd
- After that the MW320 firmware download image must be prepared:
- $ ln -sf third_party/connectedhomeip/third_party/nxp/mw320_sdk/repo mw320_sdk
- $ mw320_sdk/tools/mw_img_conv/bin/mw_img_conv mcufw out/debug/chip-mw320-all-clusters-app.bin out/debug/all-cluster-mw320.mcufw.bin 0x1F010000
- $ cp out/debug/all-cluster-mw320.mcufw.bin mw320_sdk/mw320_matter_flash/Matter/.
- Flashing the firmware image to MW320:
- $ cd mw320_sdk/mw320_matter_flash
- $ sudo python2 flashprog.py -l Matter/layout-4m.txt –boot2 Matter/boot2.bin –wififw Matter/mw32x_uapsta_W14.88.36.p172.bin –mcufw Matter/all-cluster-mw320.mcufw.bin -r
- To catch the application logs a terminal connection needs to be opened to the board:
- $ sudo apt-get install minicom
- $ TERM=linux minicom -D /dev/ttyUSB1 -b 115200
MATTER NETWORK – TEST SETUP INSTRUCTIONS
The prerequisite step for this part is to have the i.MX8MM as Matter
controller. The steps for this setup can be found in “Getting started with
i.MX8MM in Matter”.
The following instructions will provide information on how to for a matter
test setup containing one controller an one end-nodes: light node
i. MX8 Mini Matter Controller Setup
-
Connect the I.mx8 mini to the Wi-Fi AP network
- $modprobe moal mod_para=nxp/wifi_mod_para.conf $wpa_passphrase ${SSID} ${PASSWORD} > imxrouter.conf
- $wpa_supplicant -d -B -i mlan0 -c ./imxrouter.conf
- $udhcpc -i mlan0
- $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
Commission the MW320 board over WiFi
-
Connect the MW320 board to the AP
wifi connect SSID PASSWORD -
Run the following command to commission the MW320 app over WiFi using the IPv6 global address:
-
$ chip-tool pairing ethernet {NODE_ID_TO_ASSIGN}{SETUP_PIN_CODE}{DISCRIMINATOR} {IPv6_ADDR}{PORT}
Where: -
${NODE_ID_TO_ASSIGN} – the matter node id;
-
${SETUP_PIN_CODE} – pin code, default value is 20202021;
-
${DISCRIMINATOR} – discriminator, default value is 3840;
-
${IPv6_ADDR} – The global IPv6 address assigned to the MW320 board by the AP’s DHCPv6 server
-
${PORT} – Web port where the all-clusters app server is opened, default value is 5540
-
The MW320 all-clusters application is intended to work as either a lighting device or a light-switch device. For this setup we will use it as a light end node
-
-
You can send On/Off cluster commands to control the GPIO41 LED by the following commands
-
To send OnOff cluster - >Toggle command on endpoint 1 :
$ ./chip-tool onoff toggle {NODE_ID} 1 -
To send OnOff cluster - >On command on endpoint 1 :
$ ./chip-tool onoff on {NODE_ID} 1 -
To send OnOff cluster - >Off command on endpoint 1 :
$ ./chip-tool onoff off {NODE_ID} 1 -
To Send Attribute reporting configuration for on-off attribute using min/max interval = 300 seconds, cluster is on the endpoint 1 :
$ ./chip-tool onoff report on-off 300 301 {NODE_ID} 1
-
References
- activate.sh
- GitHub - nxptest/connectedhomeip: Matter (formerly Project CHIP) is creating more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance (formerl
- Downloads – Oracle VM VirtualBox
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>