Lighting

Lessons learned from implementing the Matter protocol in a smart lighting product design

20th March 2024
Sheryl Miles
0

In the consumer device world, the Matter protocol is exciting huge interest because it holds out the promise – finally – that all smart devices in the home can respond to commands from a single controller or app.

The vision of the Connectivity Standards Alliance (CSA), the 550-strong consortium of consumer device manufacturers and chip companies that has defined the Matter standard, is that controlling smart home devices will become simple, reliable, and secure: the user’s preferred app, such as Amazon’s Alexa, Google Home, or Apple’s Siri, will be able to control any Matter-certified device in the home, no matter which brand manufactured it.

The Matter protocol will support a variety of common smart home products, including lighting and electrical devices, HVAC controls, window coverings and shades, safety and security sensors, door locks, media devices including TVs, controllers as both devices and applications, and bridges (see Figure 1). And commissioning a new device into a Matter network will, according to the CSA, be as simple as capturing a QR code on the user’s network-connected smartphone or tapping the phone to make an NFC connection.

As the CSA’s website says: “Matter is the seal of approval that says smart devices work reliably together – taking the guesswork out of the purchasing process. That trust allows you to choose from a wider range of the brands you love and brings you the comfort of a secure and seamless connected home.”

Fig. 1: Devices carrying the Matter logo can be relied on to communicate with each other. (Image credit: CSA)

The CSA’s Matter initiative is backed by the giants of the consumer electronics industry, including Apple, Samsung, Google, Amazon, Signify, LG, Huawei, and Oppo: it seems unlikely that any rival technology will emerge to compete with it. So, designers of home automation products are soon – if they are not already – likely to be tasked with implementing Matter technology into new product designs. They might also need to bolt Matter support on to existing products.

Before embarking on a Matter design project, engineers can learn from the early experience of Future Electronics. Its Centre of Excellence (CoE) in embedded engineering, based in Gdansk, Poland, has worked hand-in-hand with chip companies STMicroelectronics and NXP Semiconductors to develop Matter-compliant prototypes and production-ready designs for customers in the lighting industry. The CoE’s experience shows that, while the Matter protocol largely lives up to its promise of being a plug-and-play technology for developers, there are some important hardware and software considerations to take into account.

Essential features of the Matter protocol

According to the CSA, the Matter protocol is “a unified, open-source application-layer connectivity standard” (see Figure 2). This means that it is dependent on, and separate from, physical transport networks that carry data. By design, the Matter protocol is compatible with Thread, Wi-Fi, and Ethernet transport networks. A Bluetooth Low Energy connection may be used for pairing an end device with a Thread or Wi-Fi network, but may not be used for transporting Matter data.

The standard uses the Internet Protocol version 6 (IPv6) as the common language of Matter devices.

Fig. 2: the architecture of Matter technology, showing that it operates as an application layer separate from the physical transport network. (Image credit: CSA)

The Matter specification details everything necessary to implement a Matter application and transport layer stack. Source code for the Matter project is available for download from the CSA’s GitHub page at github.com/project-chip.
The goal of the Matter development project was to create a protocol that would be widely deployed across a broad range of smart home devices, not only those with substantial computing capability, such as Wi-Fi routers or smart TVs, but also products such as smart light bulbs, doorbells, and light switches that are typically based on a microcontroller.

As the Matter GitHub page says: “The protocols are broadly deployable and accessible, by leveraging IP and being implementable on low-capability devices.” The Matter specification also supports the Linux operating system, for devices with higher compute capability, and the FreeRTOS operating system for resource-constrained devices.

Current extent of Matter support from SoC manufacturers

Many implementations of Matter technology will be made in a microcontroller environment. In theory, an OEM can choose to port the Matter software to any system-on-chip (SoC) of its choice – the protocol is meant to be hardware-agnostic, although the specification requires over-the-air update capability, which itself calls for external Flash memory.

But as of the start of 2024, some MCU manufacturers provide extensive support for Matter technology; others, none at all.

Why does this matter? In theory, after all, a designer is able to download the complete Matter source code from github.com/project-chip to their target hardware.

In practice, this is very hard for any engineer who is not already a Matter expert to do. Far better is to use the Matter software development kit (SDK) compiled for any given MCU by that MCU’s manufacturer. But then designers will run into the problem of the scarcity of Matter-compatible MCUs. One manufacturer that has moved quickly to build Matter compatibility into its MCU products is STMicroelectronics.

The ST SDK provides an optimised and streamlined implementation of the Matter protocol for a 32-bit MCU environment. ST is also progressing fast with work to build out the support for Matter across its entire STM32 ecosystem. For instance, design implementation requires a detailed description of the device. This may be done with the ZAP tool (ZAP stands for ‘Zigbee Cluster Library (ZCL) Advanced Platform’. The CSA is the publisher of the Zigbee standard as well as the Matter protocol.)

The ZAP tool enables the developer to:

  • Perform SDK-specific customised generation of all global artefacts (constants, types, IDs, and more) based on the ZCL specification
  • Provide a user interface for the user to select specific application configurations (clusters, attributes, commands)

As of January 2024, the ZAP tool has to be deployed separately from the ST Matter SDK. But in future, ST plans to integrate the ZAP tool into its STM32CubeMX middleware, providing a highly integrated development environment for Matter implementation.

Common challenges encountered in Matter design projects

The Future Electronics CoE in Gdansk has gained considerable experience in embedding Matter capability into smart lighting products, using the STMicroelectronics STM32WB5MMG 2.4GHz wireless MCU module as the hardware basis (see Figure 3). This ST module supports both Thread and Bluetooth Low Energy networking. The CoE’s experience has revealed that, while the Matter specification is designed for ease of use both by the developer and the end user, there are some pitfalls for engineers to be aware of.

Fig. 3: The STM32WB5MMG module is supplied in a compact 7.3 x 11 x 1.4mm 86-pin LGA package. (Image credit: STMicroelectronics)

Memory usage – the Matter protocol has a tendency to be a RAM hog. This drawback of version 1.0 was improved in v1.1 of the Matter specification, and future releases can be expected to be better still. But it is important for designers to carefully specify the RAM capacity in their chosen hardware target.

An effective way to reduce dependence on the MCU’s RAM resource is to implement the Matter protocol’s cryptography and other security functions in an external secure element such as the NXP EdgeLock SE051H (see Figure 4).

The SE051H offers extended Matter support, including:

  • Provisioning of device attestation certificate and certificate-based authentication
  • Common Criteria EAL 6+ certified
  • Device commissioning and easy Wi-Fi pairing via NFC
  • Matter credential generation using NXP’s Matter Product Attestation Authority. Credential pre-injection at NXP or in the customer’s factory using NXP EdgeLock 2GO services
  • Full support for cryptography in Matter commissioning, including SPAKE2+
  • Security-certified protection and a future-proof solution with secure key storage in a tamper-resistant IC and updateable applet

Fig. 4: The NXP OM-SE051ARD-H is an Arduino board-compatible development kit for the EdgeLock SE051H secure element, which integrates NFC functionality to simplify the secure onboarding of Matter devices in the smart home. (Image credit: NXP Semiconductors)

Certification – always the bane of embedded development teams’ lives, and not made easier by the need to validate Matter compatibility separately from the Thread or Wi-Fi certification process (see Figure 4).

Fig. 4: the Matter certification workflow for a Thread- or Wi-Fi-compliant device. (Image credit: Future Electronics)

Use of an STMicroelectronics device such as a wireless MCU from the STM32WB5 family is helpful in this regard: ST publishes a manual on Matter certification, and provides access to third-party support for certification. In addition, some ST devices, including the STM32WB5MMG module, are supplied pre-certified for RF and Bluetooth standards compliance, and its certificates can be passed through to the end product without additional validation.

Nevertheless, every manufacturer of a Matter-certified end product must be registered with the CSA: registration requires payment of a substantial fee. In addition, the CSA supplies certain ID credentials, the Device Attestation Certificate and the Certificate Declaration, via a proxy known as a Product Attestation Authority (PAA). A device ID enables a production unit to be recognised by the Matter firmware.

Procuring these device attestation credentials could prove to be a bottleneck in the development process.

Connectivity – in version 1.0 of the Matter protocol, the CoE encountered problems with intermittent loss of Thread connectivity. There were various causes, including the RAM issue highlighted above. Also, when a Thread device lost power and then re-started, it was required to re-register its security credentials with the host network.

These problems were fixed in the v1.1 release of the Matter firmware. This means that developers should make sure that they are working with the latest release of the Matter specification. The potential for bugs to emerge is not surprising given the short period of time that has elapsed since the release of the first Matter specification. Developers should expect multiple updates to appear over the coming months and years.

Getting started with Matter design implementation

For MCU-based designs, Matter support is already provided in products from STMicroelectronics and NXP. Other MCU manufacturers are already working on building Matter support into their product ranges, and further announcements on this are expected in 2024.

Designers who want to get started now with a Matter-certified product design would benefit from working with an ST dev kit such as the STM32WB5MM-DK Discovery kit for the STM32WB5MMG module (see Figure 5). The Future Electronics CoE for embedded engineering can provide detailed guidance based on its experience in implementing the Matter protocol on the STM32WB5MMG.

Fig. 5: The STM32WB5MM-DK Discovery kit from STMicroelectronics provides a rich environment for developing Matter-certified devices. (Image credit: STMicroelectronics)

Product Spotlight

Upcoming Events

View all events
Newsletter
Latest global electronics news
© Copyright 2024 Electronic Specifier