Matter ZAP related build error

SDK: 3.0, nRF54L15

I have modified the clusters using ZAP tool (west zap-gui).  When I tried to built,  I  get the below error:

1. I used Matter door lock sample and the build is for "mrf54l15dk/nrf54l15/cpuapp".  Built the matter sample successfully before change.

2. Nothing else was modified except running ZAP tool to add "Power clustet" and "Time sync" clusters. Tried built and got the below error.


generated/IMClusterCommandHandler.cpp.obj -MF CMakeFiles/app.dir/src/default_zap/zap-generated/IMClusterCommandHandler.cpp.obj.d -o CMakeFiles/app.dir/src/default_zap/zap-generated/IMClusterCommandHandler.cpp.obj -c /Users/subumuthu/Nordic/lock_2/src/default_zap/zap-generated/IMClusterCommandHandler.cpp
/Users/subumuthu/Nordic/lock_2/src/default_zap/zap-generated/IMClusterCommandHandler.cpp: In function 'void chip::app::Clusters::GeneralCommissioning::DispatchServerCommand(chip::app::CommandHandler*, const chip::app::ConcreteCommandPath&, chip::TLV::TLVReader&)':
/Users/subumuthu/Nordic/lock_2/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:252:30: error: 'emberAfGeneralCommissioningClusterArmFailSafeCallback' was not declared in this scope; did you mean 'emberAfGeneralCommissioningClusterInitCallback'?
  252 |                 wasHandled = emberAfGeneralCommissioningClusterArmFailSafeCallback(apCommandObj, aCommandPath, commandData);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                              emberAfGeneralCommissioningClusterInitCallback
/Users/subumuthu/Nordic/lock_2/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:252:30: note: maximum limit of 1000 namespaces searched for 'emberAfGeneralCommissioningClusterArmFailSafeCallback'
/Users/subumuthu/Nordic/lock_2/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:261:30: error: 'emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback' was not declared in this scope; did you mean 'emberAfGeneralCommissioningClusterServerInitCallback'?
  261 |                 wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(apCommandObj, aCommandPath, commandData);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                              emberAfGeneralCommissioningClusterServerInitCallback
/Users/subumuthu/Nordic/lock_2/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:261:30: note: maximum limit of 1000 namespaces searched for 'emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback'
/Users/subumuthu/Nordic/lock_2/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:270:30: error: 'emberAfGeneralCommissioningClusterCommissioningCompleteCallback' was not declared in this scope; did you mean 'emberAfGeneralCommissioningClusterClientInitCallback'?
  270 |                 wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj, aCommandPath, commandData);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                              emberAfGeneralCommissioningClusterClientInitCallback
/Users/subumuthu/Nordic/lock_2/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:270:30: note: maximum limit of 1000 namespaces searched for 'emberAfGeneralCommissioningClusterCommissioningCompleteCallback'
ninja: build stopped: subcommand failed.
[4/12] cd /Users/subumuthu/Nordic/lock_2/build/_sysbuild && /opt/nordic/ncs/toolchains/ef4fc6722e/Cellar/cmake/3.21.0/bin/cmake -E true
FAILED: _sysbuild/sysbuild/images/lock_2-prefix/src/lock_2-stamp/lock_2-build /Users/subumuthu/Nordic/lock_2/build/_sysbuild/sysbuild/images/lock_2-prefix/src/lock_2-stamp/lock_2-build 
cd /Users/subumuthu/Nordic/lock_2/build/lock_2 && /opt/nordic/ncs/toolchains/ef4fc6722e/Cellar/cmake/3.21.0/bin/cmake --build .
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/ef4fc6722e/bin/cmake --build /Users/subumuthu/Nordic/lock_2/build

 *  The terminal process terminated with exit code: 1. 

Looking at the output of the in "zap-generated/IMClusterCommandHandler.cpp", and comparing with  the same, "namespace GeneralCommissioning" is added.

Commenting out the  code section for "GeneralCommisioning" allows the build to proceed. The original matter door lock sample does not have this section.

The

#1. Please  assist with the above error.

#2. When west zap-gui is run, it presents two options. Do we have documentation for this?

Thanks.

Subu

  • Hello Subu,

    You have to implement the missing callback functions for enabling new cluster commands in ZAP.

    bool emberAfGeneralCommissioningClusterArmFailSafeCallback(
        chip::app::CommandHandler * commandObj,
        const chip::app::ConcreteCommandPath & commandPath,
        const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::DecodableType & commandData)
    {
        // TODO: Implement command handling
        return true;
    }
    
    bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(
        chip::app::CommandHandler * commandObj,
        const chip::app::ConcreteCommandPath & commandPath,
        const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::DecodableType & commandData)
    {
        // TODO: Implement command handling
        return true;
    }
    
    bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback(
        chip::app::CommandHandler * commandObj,
        const chip::app::ConcreteCommandPath & commandPath,
        const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::DecodableType & commandData)
    {
        // TODO: Implement command handling
        return true;
    }
    source: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/matter/getting_started/custom_clusters.html#create_a_new_cluster_description_file_in_xml_format 

  • Hi Kazi, Thanks for the reply. The previous ZAP version did not add this. I took the sample code and regenerated the ZAP files without modifying the clusters or anything else. It will be helpful if Nordic put out a documentation.  

    we can close this tickets. Thanks again.

  • Hello Subu,

    Glad that your problem is solved. Yes, we will work on this.

    Thanks.

    BR

    kazi

  • Your recommendation is to implement the missing callback. After looking at this more closely,  it is general commissioning. Do you  have guidelines for what should be implemented in the call backs? 

    Just curious, this was not there before why is the SDK 3.0 introducing it? I have commented out these lines and I found that  the lock still works, so  please bring clarity for  the purpose of  these call backs? Obviously it could be used for something, but it is not clear to me,

    Thanks.

    Subu

  • Hi Subu, 

    Kazi is out of the office, so I take this case.

    The callback functions for the General Commissioning cluster (such as emberAfGeneralCommissioningClusterArmFailSafeCallbackemberAfGeneralCommissioningClusterSetRegulatoryConfigCallback, and emberAfGeneralCommissioningClusterCommissioningCompleteCallback) are required by the Matter Data Model when you enable the corresponding commands in your ZAP configuration. These callbacks are invoked when a Matter controller sends the related commands to your device. The callbacks should implement the logic you want your device to perform when it receives the respective commissioning commands. For example, you might want to update internal state, trigger events, or perform safety checks. If your application does not require custom handling for these commands, you can provide empty implementations that simply return true to indicate the command was handled. 

    The need for these callbacks is not new to SDK 3.0, but enabling new clusters or commands in ZAP (such as General Commissioning) causes the code generator to expect these callbacks to be present in your application code.

    -Amanda H.

Related