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



  • from Nrf Connect terminal

    SDK:               3rd Party (nRF Connect SDK v3.1.1)*
    Toolchain:         nRF Connect SDK Toolchain v3.1.1


    and, in case helps, from west list
    west list
    manifest     application                  HEAD                                     N/A
    sdk-nrf      external/nrf                 v3.1.1                                   https://github.com/nrfconnect/sdk-nrf
    zephyr       external/zephyr              ncs-v3.1.1                               https://github.com/nrfconnect/sdk-zephyr
    hostap       external/modules/lib/hostap  2b5c82cd4e833c065075bc239a7bd138d4662e34 https://github.com/nrfconnect/sdk-hostap
    wfa-qt-control-app external/modules/lib/wfa-qt-control-app d4bc010be69aa89290c5af6767702ff46c1829e5 https://github.com/nrfconnect/sdk-wi-fiquicktrack-controlappc
    mcuboot      external/bootloader/mcuboot  ncs-v3.1.1                               https://github.com/nrfconnect/sdk-mcuboot
    qcbor        external/modules/tee/tf-m/qcbor 751d36583a9ce1a640900c57e13c9b6b8f3a2ba2 https://github.com/laurencelundblade/QCBOR
    mbedtls      external/modules/crypto/mbedtls ncs-v3.1.1                               https://github.com/nrfconnect/sdk-mbedtls
    oberon-psa-crypto external/modules/crypto/oberon-psa-crypto ncs-v3.1.1                               https://github.com/nrfconnect/sdk-oberon-psa-crypto
    nrfxlib      external/nrfxlib             v3.1.1                                   https://github.com/nrfconnect/sdk-nrfxlib
    trusted-firmware-m external/modules/tee/tf-m/trusted-firmware-m ncs-v3.1.1                               https://github.com/nrfconnect/sdk-trusted-firmware-m
    psa-arch-tests external/modules/tee/tf-m/psa-arch-tests 3da9313e64806d352c519e3205e81cf959067588 https://github.com/nrfconnect/sdk-psa-arch-tests
    matter       external/modules/lib/matter  v3.1.1                                   https://github.com/nrfconnect/sdk-connectedhomeip
    cjson        external/modules/lib/cjson   c6af068b7f05207b28d68880740e4b9ec1e4b50a https://github.com/nrfconnect/sdk-cjson
    azure-sdk-for-c external/modules/lib/azure-sdk-for-c 308c171cb4b5eed266649012a68406487ec81fb2 https://github.com/nrfconnect/azure-sdk-for-c
    cirrus       external/modules/hal/cirrus-logic 3873a08377d93a479105a75ac390d3bbcd31d690 https://github.com/nrfconnect/sdk-mcu-drivers
    openthread   external/modules/lib/openthread ncs-thread-reference-20250402            https://github.com/nrfconnect/sdk-openthread
    cmock        external/test/cmock          f65066f15d8248e6dcb778efb8739904a4512087 https://github.com/ThrowTheSwitch/cmock
    memfault-firmware-sdk external/modules/lib/memfault-firmware-sdk 1.26.0                                   https://github.com/memfault/memfault-firmware-sdk
    bsim         external/tools/bsim          a88d3353451387ca490a6a7f7c478a90c4ee05b7 https://github.com/BabbleSim/bsim_west
    coremark     external/modules/benchmark/coremark d5fad6bd094899101a4e5fd53af7298160ced6ab https://github.com/eembc/coremark
    canopennode  external/modules/lib/canopennode dec12fa3f0d790cafa8414a4c2930ea71ab72ffd https://github.com/zephyrproject-rtos/canopennode
    chre         external/modules/lib/chre    3b32c76efee705af146124fb4190f71be5a4e36e https://github.com/zephyrproject-rtos/chre
    lz4          external/modules/lib/lz4     11b8a1e22fa651b524494e55d22b69d3d9cebcfd https://github.com/zephyrproject-rtos/lz4
    nanopb       external/modules/lib/nanopb  7307ce399b81ddcb3c3a5dc862c52d4754328d38 https://github.com/zephyrproject-rtos/nanopb
    tf-m-tests   external/modules/tee/tf-m/tf-m-tests c712761dd5391bf3f38033643d28a736cae89a19 https://github.com/zephyrproject-rtos/tf-m-tests
    zscilib      external/modules/lib/zscilib ee3c0c405087e331aad16d167b6e4ec1c3452ba9 https://github.com/zephyrproject-rtos/zscilib
    cmsis        external/modules/hal/cmsis   d1b8b20b6278615b00e136374540eb1c00dcabe7 https://github.com/zephyrproject-rtos/cmsis
    cmsis-dsp    external/modules/lib/cmsis-dsp d80a49b2bb186317dc1db4ac88da49c0ab77e6e7 https://github.com/zephyrproject-rtos/cmsis-dsp
    cmsis-nn     external/modules/lib/cmsis-nn e9328d612ea3ea7d0d210d3ac16ea8667c01abdd https://github.com/zephyrproject-rtos/cmsis-nn
    cmsis_6      external/modules/hal/cmsis_6 6dd50439a9b83398ff2ae1376eef0a2a0b95913b https://github.com/zephyrproject-rtos/CMSIS_6
    edtt         external/tools/edtt          b9ca3c7030518f07b7937dacf970d37a47865a76 https://github.com/zephyrproject-rtos/edtt
    fatfs        external/modules/fs/fatfs    16245c7c41d2b79e74984f49b5202551786b8a9b https://github.com/zephyrproject-rtos/fatfs
    hal_nordic   external/modules/hal/nordic  a6579483deb33112cc763d05a4a3f8085883c1ac https://github.com/zephyrproject-rtos/hal_nordic
    hal_st       external/modules/hal/st      9f81b4427e955885398805b7bca0da3a8cd9109c https://github.com/zephyrproject-rtos/hal_st
    hal_tdk      external/modules/hal/tdk     6727477af1e46fa43878102489b9672a9d24e39f https://github.com/zephyrproject-rtos/hal_tdk
    hal_wurthelektronik external/modules/hal/wurthelektronik e3e2797b224fc48fdef1bc3e5a12a7c73108bba2 https://github.com/zephyrproject-rtos/hal_wurthelektronik
    liblc3       external/modules/lib/liblc3  48bbd3eacd36e99a57317a0a4867002e0b09e183 https://github.com/zephyrproject-rtos/liblc3
    libmetal     external/modules/hal/libmetal 14f519529a1e4a46aaea6826f5a41d99a3347276 https://github.com/zephyrproject-rtos/libmetal
    littlefs     external/modules/fs/littlefs 8f5ca347843363882619d8f96c00d8dbd88a8e79 https://github.com/zephyrproject-rtos/littlefs
    loramac-node external/modules/lib/loramac-node fb00b383072518c918e2258b0916c996f2d4eebe https://github.com/zephyrproject-rtos/loramac-node
    lvgl         external/modules/lib/gui/lvgl 1ed1ddd881c3784049a92bb9fe37c38c6c74d998 https://github.com/zephyrproject-rtos/lvgl
    mipi-sys-t   external/modules/debug/mipi-sys-t 33e5c23cbedda5ba12dbe50c4baefb362a791001 https://github.com/zephyrproject-rtos/mipi-sys-t
    net-tools    external/tools/net-tools     986bfeb040df3d9029366de8aea4ce1f84e93780 https://github.com/zephyrproject-rtos/net-tools
    nrf_hw_models external/modules/bsim_hw_models/nrf_hw_models 968d55ff22579080466bf2f482596dd6e35361c6 https://github.com/zephyrproject-rtos/nrf_hw_models
    nrf_wifi     external/modules/lib/nrf_wifi 787eea1a3c8dd13c86214e204a919e6f9bcebf91 https://github.com/zephyrproject-rtos/nrf_wifi
    open-amp     external/modules/lib/open-amp f7f4d083c7909a39d86e217376c69b416ec4faf3 https://github.com/zephyrproject-rtos/open-amp
    percepio     external/modules/debug/percepio 49e6dc202aa38c2a3edbafcc2dab85dec6aee973 https://github.com/zephyrproject-rtos/percepio
    picolibc     external/modules/lib/picolibc 560946f26db075c296beea5b39d99e6de43c9010 https://github.com/zephyrproject-rtos/picolibc
    segger       external/modules/debug/segger cf56b1d9c80f81a26e2ac5727c9cf177116a4692 https://github.com/zephyrproject-rtos/segger
    tinycrypt    external/modules/crypto/tinycrypt 1012a3ebee18c15ede5efc8332ee2fc37817670f https://github.com/zephyrproject-rtos/tinycrypt
    uoscore-uedhoc external/modules/lib/uoscore-uedhoc 54abc109c9c0adfd53c70077744c14e454f04f4a https://github.com/zephyrproject-rtos/uoscore-uedhoc
    zcbor        external/modules/lib/zcbor   9b07780aca6fb21f82a241ba386ad9b379809337 https://github.com/zephyrproject-rtos/zcbor




  •    
    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

Reply Children
Related