[Matter] Changing or adding Endpoints/Clusters to Matter-Template example with the zap tool leads to compiling errors

Hi Nordic Guys,

hope you can help following issue (I think the issue is still mentioned in Ticket https://devzone.nordicsemi.com/f/nordic-q-a/87410/corrupt-matter-zcl-file-generation-matter-template-project, Case ID: 288305).

I try to extend the matter-template example from the nRF SDK. Out off the box the example compiles, build and links The application can be copied to the nRF5340DK board and works.

If I add a new endpoint, like it is described in https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_matter_gs_adding_clusters.html#ug-matter-creating-accessory and let the generator.py script do its work, the result is an unbuild-able application.

See the following build-output:

/Users/bennynestler/workspaces/matter/nRFConnect/matter-template/src/zap-generated/endpoint_config.h:570:3: error: conversion from '<brace-enclosed initializer list>' to 'EmberAfDefaultOrMinMaxAttributeValue' is ambiguous
  570 |   }
      |   ^
/opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/attribute-storage.cpp:102:71: note: in expansion of macro 'GENERATED_ATTRIBUTES'
  102 | constexpr const EmberAfAttributeMetadata generatedAttributes[]      = GENERATED_ATTRIBUTES;
      |                                                                       ^~~~~~~~~~~~~~~~~~~~
In file included from /opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/af-types.h:58,
                 from /opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/af.h:69,
                 from /opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/common.h:45,
                 from /opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/attribute-storage.cpp:42:
/opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/attribute-metadata.h:104:15: note: candidate: 'constexpr EmberAfDefaultOrMinMaxAttributeValue::EmberAfDefaultOrMinMaxAttributeValue(const EmberAfAttributeMinMaxValue*)'
  104 |     constexpr EmberAfDefaultOrMinMaxAttributeValue(const EmberAfAttributeMinMaxValue * ptr) : ptrToMinMaxValue(ptr) {}
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/attribute-metadata.h:103:15: note: candidate: 'constexpr EmberAfDefaultOrMinMaxAttributeValue::EmberAfDefaultOrMinMaxAttributeValue(uint16_t)'
  103 |     constexpr EmberAfDefaultOrMinMaxAttributeValue(uint16_t val) : defaultValue(val) {}
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/attribute-metadata.h:102:15: note: candidate: 'constexpr EmberAfDefaultOrMinMaxAttributeValue::EmberAfDefaultOrMinMaxAttributeValue(const uint8_t*)'
  102 |     constexpr EmberAfDefaultOrMinMaxAttributeValue(const uint8_t * ptr) : ptrToDefaultValue(ptr) {}
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/attribute-metadata.h:100:7: note: candidate: 'constexpr EmberAfDefaultOrMinMaxAttributeValue::EmberAfDefaultOrMinMaxAttributeValue(const EmberAfDefaultOrMinMaxAttributeValue&)'
  100 | union EmberAfDefaultOrMinMaxAttributeValue
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/attribute-metadata.h:100:7: note: candidate: 'constexpr EmberAfDefaultOrMinMaxAttributeValue::EmberAfDefaultOrMinMaxAttributeValue(EmberAfDefaultOrMinMaxAttributeValue&&)'
In file included from /opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/config.h:83,
                 from /opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/af.h:56,
                 from /opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/common.h:45,
                 from /opt/nordic/ncs/v2.0.2/modules/lib/matter/src/app/util/attribute-storage.cpp:42:

The error repeats several times as result of the inclusion of header files.

Parents
  • Hi  

    thanks for your hint. But that's only a fault/issue of the zap tool.

    If you click on Endpoint 1, the left overview frame of Endpoint 0 changes as well and vice versa. But I thinks that's only a view issue.

    But there was a valuable aspect in your picture, that's not described in the SDK documentation. The Endpoint 0 is not configured as "Matter root node" if I load the template.zap file from the template example.

    I try to change the Endpoint 0 to the "Matter Root Node" and see what is the result.

  • Hi  

    yesterday I experiment a little bit with the zap tool and the matter template with following weird results:

    1.) Create a new example matter-template from nRF SDK with VS Code integration plugin

    2.) Open the src/template.zap file with zap-tool. Looks like this

    3.) Edit Endpoint 0 and choose "Matter Root Node" from device list. Looks like this

    --> Looks similar but not equal to yours  ; but the right panel doesn't show 26 enabled Clusters. There are only  12! (And yes, I tried to scroll down, to the supposedly rest of 14 enabled Clusters)

    4.) Save the file and quit the zap-tool.

    5.) Reopen the src/template.zap file with zap-Tool. Looks like this

    The numbers are changed ... !? I think that is the correct view!

    6.) Add the missing Cluster in the CHIP category

    - OTA Software Update Provider (0x0029) --> Choose Client

    - OTA Software Update Requestor (0x002A) --> Choose Server

    7.) Configure Cluster OTA Software Update Requestor

    - enable all required Attributes, Attributes Reporting, Commands and Events

    8.) Save the file (if possible --> I've issues with saving of files; very often my changes couldn't be saved and the zap tool don't offers the save menu entry; the only thing which helps is to restart the tool and retry in a slitly different change order )

    9.) Try to configure the OTA Software Update Provider

    --> This action always leads to freeze the zap -Tool

    The only exit from this state, is to exit the zap tool (Menu --> Electron --> Quit Electron or Control + C in Terminal)

     can you verify my steps/issues with the zap tool?

    My zap-tool About window looks like following

     

Reply
  • Hi  

    yesterday I experiment a little bit with the zap tool and the matter template with following weird results:

    1.) Create a new example matter-template from nRF SDK with VS Code integration plugin

    2.) Open the src/template.zap file with zap-tool. Looks like this

    3.) Edit Endpoint 0 and choose "Matter Root Node" from device list. Looks like this

    --> Looks similar but not equal to yours  ; but the right panel doesn't show 26 enabled Clusters. There are only  12! (And yes, I tried to scroll down, to the supposedly rest of 14 enabled Clusters)

    4.) Save the file and quit the zap-tool.

    5.) Reopen the src/template.zap file with zap-Tool. Looks like this

    The numbers are changed ... !? I think that is the correct view!

    6.) Add the missing Cluster in the CHIP category

    - OTA Software Update Provider (0x0029) --> Choose Client

    - OTA Software Update Requestor (0x002A) --> Choose Server

    7.) Configure Cluster OTA Software Update Requestor

    - enable all required Attributes, Attributes Reporting, Commands and Events

    8.) Save the file (if possible --> I've issues with saving of files; very often my changes couldn't be saved and the zap tool don't offers the save menu entry; the only thing which helps is to restart the tool and retry in a slitly different change order )

    9.) Try to configure the OTA Software Update Provider

    --> This action always leads to freeze the zap -Tool

    The only exit from this state, is to exit the zap tool (Menu --> Electron --> Quit Electron or Control + C in Terminal)

     can you verify my steps/issues with the zap tool?

    My zap-tool About window looks like following

     

Children
  • Hi,

    When I run the zap tool endpoint 0 is automatically configured as Matter Root Node with all the same clusters as in my previous picture:

    The picture above is from when I created a new application in VS Code just as you did. I did not do anything else with the application before running the zap tool, so this is what my device looks like in your step 2. I asked a colleague of mine to test as well, and they got the same as me.

    I am looking into what the reason might be for why the Matter Root Node is not automatically configured for you, but I need some more time to investigate. Have you made any changes to the template sample previously? Did you install nRF Connect SDK using Toolchain Manager or manually? Can you also upload the output in the terminal from when you run the zap tool?

    Best regards,

    Marte

Related