Matter (Project CHIP) - Creating Matter device example will not build.

I am going through the Nordic tutorial Creating Matter device ( developer.nordicsemi.com/.../ug_matter_gs_adding_clusters.html ) but I am getting errors during the build that I cannot resolve. I am able to build and run the template sample in nRF Connect SDK v2.0.0, everything works as expected, I am using an older version of the SDK because when using newer versions I cannot commission the device via the Android CHIP tool. I've only successfully commissioned end devices with nRF Connect SDK v2.0.0 sample projects.

The tutorial has you use the Zap tool to add the Matter Temperature Sensor endpoint with the clusters specified in the link above. I start the zap tool and then generate files using the following commands:

node src-script/zap-start.js --logStdout --gen ~/connectedhomeip/src/app/zap-templates/app-templates.json --zcl ~/connectedhomeip/src/app/zap-templates/zcl/zcl.json -i ~/Downloads/templateModified.zap

node src-script/zap-generate.js --genResultFile -z ./zcl-builtin/matter/zcl.json -g ~/connectedhomeip/src/app/zap-templates/app-templates.json -i ~/Downloads/templateModified.zap -o ./tmp/

This produces the following files which I then put into the ./src/zap-generated/

I make all the modifications called out in the tutorial linked above to .c and .h files as well as add zcl-callbacks.c into the src folder, but the build fails. See attached build output.2313.b_Output1.txt

Two errors appear.

First error

This error (../src/zap-generated/endpoint_config.h:84:1: error: conversion from '<brace-enclosed initializer list>' to 'EmberAfDefaultOrMinMaxAttributeValue' is ambiguous) repeats several times and I am confused because the brace enclosed initializer list is just a modified version of the original endpoint_config.h

Snippet from endpoint_config.h showing the brace enclosed initializer list:

#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_ ## mask
// This is an array of EmberAfAttributeMetadata structures.
#define GENERATED_ATTRIBUTE_COUNT 18
#define GENERATED_ATTRIBUTES { \
\
  /* Endpoint: 1, Cluster: Identify (server) */ \
  { 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0) }, /* identify time */  \
  { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x0) }, /* identify type */  \
  { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */  \
  { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */  \
\
  /* Endpoint: 1, Cluster: On/Off (server) */ \
  { 0x00000000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* OnOff */  \
  { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_SIMPLE_DEFAULT(0) }, /* FeatureMap */  \
  { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */  \
...
...
...
The error appears to happen in C:\ncs\v2.0.0\modules\lib\matter\src\app\util\attribute-storage.cpp when the GENERATED_ATTRIBUTES is suppose to initialize the EmberAfDefaultOrMinMaxAttributeValue generatedAttributes[] variable in attribute-storage.cpp (see below):
constexpr const EmberAfAttributeMetadata generatedAttributes[]      = GENERATED_ATTRIBUTES;
Why does this updated version of endpoint_config.h cause this error but the unmodified file builds without errors?
Do the generated zap files also need to go into this directory -> C:\ncs\v2.0.0\modules\lib\matter\zzz_generated ?
Second error
C:/ncs/v2.0.0/modules/lib/matter/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp:827:5: error: 'Controller' has not been declared
827 | Controller::OtaSoftwareUpdateProviderCluster cluster;
Other General info:
Platform: Windows 10
End Device: nRF52840 DK
Border router: Raspberry Pi 4 B
RCP: nRF52840 Dongle
IDE: VSCode
Matter Controller: Android CHIP Tool
Parents Reply Children
No Data
Related