Build an ACK-enabled Matter Device
Step 1: Build the Sample App
In this step, you build the Matter sample app and download it to an Espressif development kit. This smart-light sample app enables the mandatory Matter clusters for a smart light that supports color, including the On/Off, Level Control, and Color Control clusters.
The tutorial uses Vendor IDs assigned by the CSA for testing: 0xFFF1, 0xFFF2, 0xFFF3, 0xFFF4. The example commands use 0xFFF1. To build production products, you need a Vendor ID assigned by the Connectivity Standards Alliance (CSA).
Prerequisites
Before you start the tutorial, set up your development environment. Make sure that you download the Espressif package in Step 1: Download required packages.
Steps to build the sample app
Complete the following steps to build the sample app.
Step 1.1: Set up your app environment
After you set up your development environment, configure and activate your app environment to build with Matter. The smart-light sample app installs to the Cyprus-SDK/smartlight-mtr-app directory.
To set up the app environment
- In an Ubuntu VM terminal window, navigate to the top-level
Cyprus-SDKdirectory. - To install packages required for the sample app, at the command prompt, enter the following commands.
source ./setup.sh
- Repeat steps 1–2 each time you open a new terminal instance.
Step 1.2: Build the smart-light app
Next, you build the smart-light app. The full build uses the test values for the build parameters. For more details, see Define build parameters.
source ./setup.sh before you run any other commands.To build the smart-light app
- In a new terminal window, at the command prompt, enter the following command.
source ./setup.sh
- Navigate to the
Cyprus-SDK/smartlight-mtr-appdirectory. - To start the build, at the command prompt, enter the following command.
idf.py build
- To verify successful command completion, confirm that you see the following output.
Note: You flash the image in Step 1.3: Flash the image to the development kit.
Project build complete. To flash, run this command: /home/user/.espressif/python_env/idf4.3_py3.10_env/bin/python ../esp-dpk/external/esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after no_reset --chip esp32c3 --no-stub write_flash --flash_mode dio --flash_size keep --flash_freq 80m 0xc000 build/partition_table/partition-table.bin 0xd000 build/ota_data_initial.bin 0xf000 ../esp-dpk/external/esp-idf/components/esp_wifi/esp32c3/phy_multiple_init_data.bin 0x10000 build/smartlight-mtr-app.bin or run 'idf.py -p (PORT) flash' - Note the location of the binary files produced by the build. You flash these files to the development kit.
The build places the following binary files in thebuilddirectory:Cyprus-SDK/smartlight-mtr-app/build/partition_table/partition-table.binCyprus-SDK/smartlight-mtr-app/build/ota_data_initial.binCyprus-SDK/smartlight-mtr-app/build/smartlight-mtr-app.binCyprus-SDK/smartlight-mtr-app/build/bootloader/bootloader.bin
- In a convenient place, such as Notepad on Windows or TextEdit on Mac, paste the binary files directory paths.
Step 1.3: Flash the image to the development kit
In this step, you write the app binary data to flash memory on the Espressif development kit. You can use one of the following Espressif tools to write to flash memory:
esptool.py– Read, write, and erase binary files to and from flash memory on the Espressif development kit. If your source and binary files are on separate platforms, use this tool. For more details, see Basic Commands: Write Binary Data to Flash.idf.py– Build the software and copy the resulting binary files to flash. If your source and binary files are on the same system, use this option to debug and test the app.
The following steps use the idf.py tool.
To write the smart light image to the development kit
- In a new terminal window, at the command prompt, enter the following command.
source ./setup.sh
- Connect your Ubuntu VM or host machine to the development kit.
For details, see Connect your host machine to the development kit. - Navigate to the
Cyprus-SDK/smartlight-mtr-appdirectory. - To erase data from flash memory, at the command prompt, enter the following command.
Set<port>to the serial port, such as/dev/ttyUSB0on Ubuntu,/dev/tty.usbserial-USB0on Mac orCOM9on Windows.Tip: If there is only one development kit connected to the host machine, the-p <port>option isn't required.
idf.py -p <port> erase_flash
- To flash the binary images to the development kit, at the command prompt, enter the following command.
You can specify the parameters inCyprus-SDK/customer_profiles/smartlight-mtr-app /ack_build_config/build_config.cmakeinstead of the command line.
Set<port>to the serial port.
idf.py \
-p <port> \
-DAPPLICATION_VERSION_STRING='1.0.0' \
-DBUILD_VERSION=0 \
-DPACKAGE_NAME='com.amazon.ack.cyprus.esp32_c3f.0x010C.os' \
-DPRODUCT_NAME='ACK' \
-DVENDOR_NAME='ACK' \
-DHARDWARE_VERSION=0 \
-DHARDWARE_VERSION_STRING='hardware-version-0' \
flash
Last updated: frontmatter-missing