[K32W0] Add platform changes and features (#22896)

* [K32W0] Add platform changes and features

* Add SVE2 fixes and other changes and features

* Add support for custom certificate policy.
* Certificate declaration: set certificate_type to 1
* Add new demo certificates
* Add demo certificates allowing testing with two different DUTs

* Add custom lighting app ZAP file - e.g.: removed generic and not needed clusters
  like the ones required for Ethernet/WiFi; removed the optional clusters for an
  On/Off Device Type;

* Add ksdk_mbedlts.c such that we redirect all the AES calls through SecLib.c

* Add TestEventTrigger Support

* Add functionality for ResetWatermarks()

* Add callback for PDM logs

* Fix NotifyUpdateApplied - message that is sent when booting for the first time
  with an OTA image was not being send due to a bug in the PDM read function:
  ReadConfigValue(...);
* Add delay when rebooting after OTA finishes
* Improve OTA mechanism

* Remove third parameter of ReadConfigValue() and use a TValue& parameter which can
  be used for extracting the value length

* Consume faster the RX buffer
* RX buffer should be processed with high priority because:
  * 15.4 packets are consumed on Thread task;
  * Thread task has a higher priority than the Matter one (3 > 2)

* Fix Low Power
  * fix 15.4 warm-up time: before this commit calibration time also
    included the time required for attaching to the Thread network
    This led to a large warm-up value that blocked some 15.4 operations
    Fix this by including in the warm-up time only the 15.4 radio
    initialization time
  * fix the warm-up initial value to avoid any conflicts
  * fix possible overflow in reading timestamp values
  * Make sure that all the logs are disabled when an application is compiled with low-power
	support; logging can interference with LP timings and break functionality;

* Fix time support for Matter
  * using FreeRTOS timers (based on FreeRTOS tickets) is inaccurate and leads to time drifting
  * use OT Timers API  (Wtimer-based) for getting us/ms timestamps

* Fix ExtractPubkeyFromX509Cert in CHIPCryptoPALTinyCrypt.cpp

* Fix BLE advertising interval + issue warning if the peer doesn't support 2Mbps

* Fix Diagnostic Data Provider

* Fix OnOff attribute persistence over hw reset

* Fix compilation issue for lock-app

* Disable by default on lighting-app BLE Set Phy Req to 2M to be extra cautious during interops

* Update readme files

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
Signed-off-by: Marius Tache <marius.tache@nxp.com>
Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>

* Fix gn includes, spelling, wordlist

Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>

* Update ot-nxp submodule

Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>

* Fix gn includes, exclude certs from restyle, fix messaging readme

Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>

* Restyled by whitespace

* Restyled by clang-format

* Restyled by gn

* Restyled by prettier-markdown

* Restyled by shellharden

* Restyled by shfmt

* Restyled by autopep8

* Fix low-power build

Signed-off-by: Marius Tache <marius.tache@nxp.com>
Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>

* Restyled by clang-format

* Fix SecLib compile issue

Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>

* Restyled by clang-format

* Update worflows K32W0 examples yaml

Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>

* Update docker version, expected gn gen

Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>

* Hotfix nxp shell build

Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
Signed-off-by: Marius Tache <marius.tache@nxp.com>
Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>
Co-authored-by: Restyled.io <commits@restyled.io>
115 files changed
tree: d10e542a05c1ea9586f862078320ccc187dfff6c
  1. .devcontainer/
  2. .githooks/
  3. .github/
  4. .vscode/
  5. build/
  6. build_overrides/
  7. config/
  8. credentials/
  9. docs/
  10. examples/
  11. integrations/
  12. scripts/
  13. src/
  14. third_party/
  15. zzz_generated/
  16. .clang-format
  17. .clang-tidy
  18. .default-version.min
  19. .dir-locals.el
  20. .editorconfig
  21. .flake8
  22. .gitattributes
  23. .gitignore
  24. .gitmodules
  25. .gn
  26. .prettierrc.json
  27. .pullapprove.yml
  28. .restyled.yaml
  29. .shellcheck_tree
  30. .spellcheck.yml
  31. BUILD.gn
  32. CODE_OF_CONDUCT.md
  33. CONTRIBUTING.md
  34. gn_build.sh
  35. lgtm.yml
  36. LICENSE
  37. README.md
  38. REVIEWERS.md
README.md

Matter

Builds

Examples - EFR32 Examples - ESP32 Examples - i.MX Linux Examples - K32W with SE051 Examples - Linux Standalone Examples - nRF Connect SDK Examples - QPG Examples - TI CC26X2X7 Build example - Infineon

Android

Unit / Interation Tests Cirque QEMU

ZAP Templates

What is Matter?

Matter (formerly Project Connected Home over IP, or Project CHIP) is a new Working Group within the Connectivity Standards Alliance (CSA, formerly Zigbee Alliance). This Working Group plans to develop and promote the adoption of a new, royalty-free connectivity standard to increase compatibility among smart home products, with security as a fundamental design tenet.

The goal of the Matter project is to simplify development for manufacturers and increase compatibility for consumers. The project is built around a shared belief that smart home devices should be secure, reliable, and seamless to use. By building upon Internet Protocol (IP), the project aims to enable communication across smart home devices, mobile apps, and cloud services and to define a specific set of IP-based networking technologies for device certification.

The CSA officially opened the Matter Working Group on January 17, 2020 and is in the process of drafting the specification.

Visit buildwithmatter.com to learn more and read the latest news and updates about the project.

Project Overview

Development Goals

Matter is developed with the following goals and principles in mind:

Unifying: Matter will produce a new specification, building with and on top of market-tested, existing technologies.

Interoperable: The specification permits communication between any Matter-certified device, subject to users’ permission.

Secure: The specification leverages modern security practices and protocols.

User Control: The end user is in control of authorization for interaction with devices.

Federated: No single entity serves as a throttle or a single-point-of-failure for root of trust.

Robust: The set of protocols specify a complete lifecycle of a device — starting with the seamless out-of-box experience, through operational protocols, to device and system management specifications required for proper function in the presence of change.

Low Overhead: The protocols are practically implementable on low compute-resource devices, such as MCUs.

Pervasive: The protocols are broadly deployable and accessible, thanks to leveraging IP and being implementable on low-capability devices.

Ecosystem-Flexible: The protocol must be flexible enough to accommodate deployment in ecosystems with differing policies.

Easy to Use: The protocol should aim to provide smooth, cohesive, integrated provisioning and out-of-box experience.

Open: The Project’s design and technical processes should be open and transparent to the general public, including to non-members wherever possible.

Architecture Overview

Matter Architecture Overview

The Project, as illustrated above, defines the application layer that will be deployed on devices and controllers as well as the supported IPv6-based networks to help achieve our interoperability architectural goal. Matter will initially support Wi-Fi and Thread for core, operational communications and Bluetooth Low Energy (BLE) to simplify device commissioning and setup.

The Application Layer can be further broken down into seven main components:

Matter Stack Architecture

  1. Application: High order business logic of a device. For example, an application that is focused on lighting might contain logic to handle turning on/off the bulb as well as its color characteristics.

  2. Data Model: Data primitives that help describe the various functionalities of the devices. The Application operates on these data structures when there is intent to interact with the device.

  3. Interaction Model: Represents a set of actions that can be performed on the devices to interact with it. For example, reading or writing attributes on a device would correspond to interactions with the devices. These actions operate on the structures defined by the data model.

  4. Action Framing: Once an action is constructed using the Interaction Model, it is framed into a prescriptive packed binary format to enable being well represented on the “wire”.

  5. Security: An encoded action frame is then sent down to the Security Layer to encrypt and sign the payload to ensure that data is secured and authenticated by both sender and receiver of a packet.

  6. Message Framing & Routing: With an interaction encrypted and signed, the Message Layer constructs the payload format with required and optional header fields; which specify properties of the message as well as some routing information.

  7. IP Framing & Transport Management: After the final payload has been constructed, it is sent to the underlying transport protocol for IP management of the data.

Current Status of Matter

Matter’s design and technical processes are intended to be open and transparent to the general public, including to Work Group non-members wherever possible. The availability of this GitHub repository and its source code under an Apache v2 license is an important and demonstrable step to achieving this commitment.

Matter endeavors to bring together the best aspects of market-tested technologies and to redeploy them as a unified and cohesive whole-system solution. The overall goal of this approach is to bring the benefits of Matter to consumers and manufacturers as quickly as possible. As a result, what you observe in this repository is an implementation-first approach to the technical specification, vetting integrations in practice.

The Matter repository is growing and evolving to implement the overall architecture. The repository currently contains the security foundations, message framing and dispatch, an implementation of the interaction model and data model. The code examples show simple interactions, and are supported on multiple transports -- Wi-Fi and Thread -- starting with resource-constrained (i.e., memory, processing) silicon platforms to help ensure Matter’s scalability.

How to Contribute

We welcome your contributions to Matter. Read our contribution guidelines here.

Building and Developing in Matter

Instructions about how to build Matter can be found here.

Directory Structure

The Matter repository is structured as follows:

File / FolderContents
build/Build system support content and build output directories
BUILDING.mdMore detailed information on configuring and building Matter for different targets
CODE_OF_CONDUCT.mdCode of Conduct for Matter, and contributions to it
CONTRIBUTING.mdGuidelines for contributing to Matter
docs/Documentation, including guides
examples/Example firmware applications that demonstrate use of the Matter technology
integrations/Third party integrations related to this project
integrations/docker/Docker scripts and Dockerfiles
LICENSEMatter License file (Apache 2.0)
BUILD.gnTop level GN build file
README.mdThis file
src/Implementation of Matter
third_party/Third-party code used by Matter
scripts/Scripts needed to work with the Matter repository

License

Matter is released under the Apache 2.0 license.