Matter Custom cluster Build error ValueError: Unhandled server cluster:

I am trying to Build a modified version of the Matter weather station with additional endpoints

I have created a custom Cluster and Custom Device type via Matter Cluster editor
I cant find specific guidance on this process

I have tried adding these using both  

west zap-gui --clusters ./src/default_zap/scene_sequence.xml


and (am using -o so doesn't overwrite external/modules/lib/matter/src/app/zap-templates/zcl/zcl.json)
west zap-append -o ./src/default_zap/zcl-ammended.json ./src/default_zap/scene_sequence.xml
west zap-gui -j ./src/default_zap/zcl-ammended.json

Both seem to work (no errors)

then run 

west zap-generate


have also tried
west zap-generate -j



but when i try to build i get 

CMake Error at /home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/chip_data_model.cmake:56 (message):
  Failed to execute zap_cluster_list.py: Traceback (most recent call last):

    File "/home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/zap_cluster_list.py", line 113, in <module>
      main()
    File "/home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/zap_cluster_list.py", line 107, in main
      dump_zapfile_clusters(args.zap_file, args.cluster_implementation_data, args.external_clusters)
    File "/home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/zap_cluster_list.py", line 77, in dump_zapfile_clusters
      get_cluster_sources(server_clusters, SERVER_CLUSTERS, 'server'))
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/zap_cluster_list.py", line 25, in get_cluster_sources
      raise ValueError("Unhandled %s cluster: %s"

  ValueError: Unhandled server cluster: scene_sequence (hint: add to
  src/app/zap_cluster_list.json)

Call Stack (most recent call first):
  /home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/chip_data_model.cmake:106 (chip_configure_zap_file)
  /home/fireblade/test2/matter_weather_station/external/nrf/samples/matter/common/cmake/data_model.cmake:20 (chip_configure_data_model)
  CMakeLists.txt:48 (ncs_configure_data_model)


I think im missing something but not sure what,

I could manually alter  "src/app/zap_cluster_list.json" but that's in the external matter repo (external/modules/lib/matter/) so i'd rather avoid that if possible

could anyone point me to the correct sequence to do this or tell me the missing step(s)

thanks 






Parents
  • Hi,

    Do you get an error if you generate the files using --full?

    west zap-generate --full

    We have a guide for creating and adding a custom cluster to your application: Creating manufacturer-specific clusters in Matter application.

    Best regards,
    Marte

  • hello

    ive tried with 

    west zap-generate --full


    and get 

    Files generated in: /home/fireblade/test2/matter_weather_station/application/src/default_zap/zap-generated
    Error: /home/fireblade/test2/matter_weather_station/external/modules/lib/matter/True does not exists or is not a file.
    FATAL ERROR: command exited with status 1: ./scripts/tools/zap/generate.py -z True -t src/app/common/templates/templates.json -o /home/fireblade/test2/matter_weather_station/application/src/default_zap/zap-generated/app-common/zap-generated



  •    
    I also getting, same error "multiple definition" error, for ncs sdk v3.1.1

    do you find any solution! 

  • no, so far i haven't got a solution to this
    i think i can see whats it doing but not sure how to prevent it

  • OK, after looking at this again

    A work around might be to be to comment out 

    all the "#include <clusters/" lines in cluster-objects.cpp

    but if what it says is true this will lead to inefficient compiling

    // Includes below are because the compiler seems to be able to optimize better
    // if all structures are visible in one compilation unit (saves aroud 500 bytes
    // of flash on a lighting app when compared to individual cpp compilation)

    so is not a actual fix

    however i then get a different, i think unrelated, error


    /home/fireblade/ncs/toolchains/b2ecd2435d/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/connectedhomeip/libmatter-data-model.a(IMClusterCommandHandler.cpp.obj): in function `chip::app::Clusters::SceneSequence::DispatchServerCommand(chip::app::CommandHandler*, chip::app::ConcreteCommandPath const&, chip::TLV::TLVReader&)':
    /home/fireblade/race-start-signals/application/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:704: undefined reference to `chip::app::Clusters::SceneSequence::Commands::AddSequence::DecodableType::Decode(chip::TLV::TLVReader&, unsigned char)'
    /home/fireblade/ncs/toolchains/b2ecd2435d/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/fireblade/race-start-signals/application/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:714: undefined reference to `chip::app::Clusters::SceneSequence::Commands::PlaySequence::DecodableType::Decode(chip::TLV::TLVReader&, unsigned char)'
    /home/fireblade/ncs/toolchains/b2ecd2435d/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/fireblade/race-start-signals/application/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:724: undefined reference to `chip::app::Clusters::SceneSequence::Commands::RemoveSequence::DecodableType::Decode(chip::TLV::TLVReader&, unsigned char)'
    /home/fireblade/ncs/toolchains/b2ecd2435d/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/fireblade/race-start-signals/application/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:734: undefined reference to `chip::app::Clusters::SceneSequence::Commands::StopSequence::DecodableType::Decode(chip::TLV::TLVReader&, unsigned char)'
    /home/fireblade/ncs/toolchains/b2ecd2435d/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/fireblade/race-start-signals/application/src/default_zap/zap-generated/IMClusterCommandHandler.cpp:744: undefined reference to `chip::app::Clusters::SceneSequence::Commands::ViewSequence::DecodableType::Decode(chip::TLV::TLVReader&, unsigned char)'

    ive checked

    application/src/default_zap/zap-generated/clusters/SceneSequence/Commands.ipp

    and 

    application/src/default_zap/zap-generated/IMClusterCommandHandler.cpp

    and the function call is

          TLVError =
              commandData.Decode(aDataTlv, apCommandObj->GetAccessingFabricIndex());


    and declaration

    CHIP_ERROR DecodableType::Decode(TLV::TLVReader &reader,
                                     FabricIndex aAccessingFabricIndex) {




    since this is generated automatically and they appear to match I'm not sure why I'm getting these errors

    also aAccessingFabricIndex appears to be an unsignend char (line 44 DataModelTypes.h)

    typedef uint8_t FabricIndex;

    which is confusing

  • Hi,

    Thank you for sharing the possible workaround.

    I can reproduce the "multiple definitions" error, and I am currently investigating it. I will ask the developers about this and get back to you.

    Best regards,
    Marte

  • Hi,

    The developers could reproduce the issue. They are working on a workaround, but I cannot comment on the schedule since this needs to be prioritized against other tasks.
    However, several fixes to the zap commands have been implemented recently, and this should work on the latest main and also in v3.2.0 once it is fully released.

    Best regards,
    Marte

Reply Children
No Data
Related