Working with Matter - nxp-mcuxpresso/vscode-for-mcux GitHub Wiki

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.

The purpose of this extension is to provide a full development flow experience, starting from installing tools, source repository, capability to create and manage projects, build and debug applications.

All functionalities described below have been tested using the NXP downstream Matter repository, version 1.4.0.2 or higher.

Matter is supported on Windows, Linux, and macOS.

Dependencies

In addition to the extension itself, some extra tools and software components are required for the full development flow within VS Code.

Some of these dependencies are managed by the MCUXpresso Installer tool, others by the Bootstrap script and others must be manually managed by the user.

Dependencies installed by the MCUXpresso Installer tool:

MatterInstaller

Import remote source repository

REMOTE tab option in the IMPORT REPOSITORY view will allow the user to specify the details about the remote repository.

ImportRemoteRepo

The default revision from the remote repository is selected. If another revision is needed, check the expanded list.

ImportRemoteRevision

After the repository is cloned, the extension will set up the environment by running the necessary scripts, first the checkout submodules script, then the update MCUX SDK script and finally the Bootstrap script.

SubmodulesTask

UpdateSdkTask

BootstrapTask

The imported Matter repository is displayed in the IMPORTED REPOSITORIES view.

ImportRepositories

Update repository

Update repository command can be used to run the setup scripts in order to update the environment.

UpdateRepository

Create project

Once a repository is imported, you can create your own application by importing an example from the repository.

Open Import Example from Repository view and fill the required fields:

  • Choose a repository - select a Matter repository. The listed repositories are the ones also available in IMPORTED REPOSITORIES view;
  • Choose a toolchain - the listed ones are automatically identified by the extension. Pick a suitable one or use Add toolchain path option from the combobox;
  • Choose a board - select a desired board. The listed ones are the ones available in the loaded Matter repository;
  • Choose a template - select a desired project template you want to start with;

ImportExample

Once the project is created, it is added in PROJECTS view.

Note: The created project is a "Repository" type application, the example is kept in the Matter repository. This is the only available application type so this is why the "App type" field is not visible as it is for other repositories having multiple options of project creation.

ProjectsView

Build project

Matter projects are built using CMake build system.

Build configuration

The PROJECTS view displays all available build configurations for each project. One is selected by default, any other can be selected using "Set as Default" option. Additionally, you can add, edit or delete a build configuration.

Build configurations options

Open Build Configuration view and fill the required fields:

  • Name - specify a desired build configuration name.
  • Build Directory - specify a desired build directory name, location relative to the project path.
  • CMake Extra Args - specify additional CMake args.

Build command

Use the Build Selected button to start building the project.

BuildProject

BuildTask

Flash

Flash selected target command

Quick access links to program the flash or to fully erase the flash are available on the project context menu.

FlashSelectedTarget

FlashSelectFile

For more detailed instructions see Flash NXP GitHub Documentation.

Debug

Debug project command

Use the Debug button to start debugging the project.

DebugButton

DebugSession

Image Info

Choose a project which already has a built configuration target and use the "Load Artifact" button and select the build artifact file to use.

For more detailed instructions see Image Info NXP GitHub Documentation.

ImageInfoSelectFile

ImageInfoView

ZAP Tool

To open Zap Tool go to the context menu of the project and select "Open with Zap Tool" under the "Configure" group.

Zap tool configure option

If multiple zap files are found, please select which zap file to be opened with Zap Tool.

Zap tool configure option

Zap tool

If the zap file will be modified, the corresponding matter file will be automatically regenerated at build time as a pre-build step.

Zap tool

Kernel Configuration (guiconfig)

To open Kernel Configuration Tool go to the context menu of the project and select "Open Kconfig GUI Configuration" under the "Configure" group.

Guiconfig command

Guiconfig tool

Project Integrated Terminal

Open MCUXpresso Terminal specific for the project using project menu -> Open in Integrated Terminal.

The opened MCUXpresso terminal will will have the environment completely configured for the project and the associated repository type, including system specific variables, virtual python environment (if available), utility tools access (i.e. west, available debug software probes). Example command to build the project appears in green. The command is constructed specific for the project and it can be used as is for a quick west build.

Build in terminal

Troubleshooting

For answers to common issues you may encounter when using Matter with the MCUXpresso for VS Code extension, please check Matter Troubleshooting Guide.

home