Matter template sample - fails to build after touching with ZAP tool

Hi - I am using NRF SDK v.2.3.0 on an Apple M1 Max - OS: 13.3.1 (22E261) in VS Code. I've installed the SDK and toolchain using the NRF Connect desktop app.

I can successfully build as a standalone app the Matter template sample.

However, if i try to simply open the template.zap file using the ZAP tool, NOT MAKE ANY CHANGES TO IT, save it, and generate the zap-generated files as described here (but without adding any new endpoints or clusters), then the build fails as seen below.

I experience similar problems when I try to add a new endpoint and cluster, but clearly the problem exists before doing so.

I welcome your advice and guidance on how to resolve.

Thanks! Dan.

 *  Executing task: nRF Connect: Build [pristine]: wb-template/build (active) 

Building wb-template
/bin/sh -c west build --build-dir /Users/ydr/dev/nordic/wb-template/build /Users/ydr/dev/nordic/wb-template --pristine --board nrf5340dk_nrf5340_cpuapp -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="/Users/ydr/dev/nordic/wb-template" -DDTC_OVERLAY_FILE:STRING="/Users/ydr/dev/nordic/wb-template/boards/nrf5340dk_nrf5340_cpuapp.overlay" -DCONFIG_DEBUG_OPTIMIZATIONS:STRING="y" -DCONFIG_DEBUG_THREAD_INFO:STRING="y" -DCONF_FILE:STRING="/Users/ydr/dev/nordic/wb-template/prj.conf"

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /Users/ydr/dev/nordic/wb-template
-- Found Python3: /opt/nordic/ncs/toolchains/v2.3.0/bin/python3.9 (found suitable exact version "3.9.6") found components: Interpreter 
-- Cache files will be written to: /Users/ydr/Library/Caches/zephyr
-- Zephyr version: 3.2.99 (/opt/nordic/ncs/v2.3.0/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: nrf5340dk_nrf5340_cpuapp
-- Found host-tools: zephyr 0.15.2 (/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.15.2 (/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
-- Found Dtc: /opt/nordic/ncs/toolchains/v2.3.0/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
-- Found BOARD.dts: /opt/nordic/ncs/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
-- Found devicetree overlay: /Users/ydr/dev/nordic/wb-template/boards/nrf5340dk_nrf5340_cpuapp.overlay
-- Generated zephyr.dts: /Users/ydr/dev/nordic/wb-template/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /Users/ydr/dev/nordic/wb-template/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /Users/ydr/dev/nordic/wb-template/build/zephyr/dts.cmake
Parsing /Users/ydr/dev/nordic/wb-template/Kconfig
Loaded configuration '/opt/nordic/ncs/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
Merged configuration '/Users/ydr/dev/nordic/wb-template/prj.conf'
Merged configuration '/Users/ydr/dev/nordic/wb-template/build/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/Users/ydr/dev/nordic/wb-template/build/zephyr/.config'
Kconfig header saved to '/Users/ydr/dev/nordic/wb-template/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc

=== child image multiprotocol_rpmsg - CPUNET begin ===
loading initial cache file /Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/child_image_preload.cmake
Loading Zephyr default modules (Zephyr base).
-- Application: /opt/nordic/ncs/v2.3.0/nrf/samples/nrf5340/multiprotocol_rpmsg
-- Found Python3: /opt/nordic/ncs/toolchains/v2.3.0/bin/python3.9 (found suitable exact version "3.9.6") found components: Interpreter 
-- Cache files will be written to: /Users/ydr/Library/Caches/zephyr
-- Zephyr version: 3.2.99 (/opt/nordic/ncs/v2.3.0/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: nrf5340dk_nrf5340_cpunet
-- Found host-tools: zephyr 0.15.2 (/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.15.2 (/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
-- Found Dtc: /opt/nordic/ncs/toolchains/v2.3.0/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
-- Found BOARD.dts: /opt/nordic/ncs/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
-- Generated zephyr.dts: /Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/zephyr/dts.cmake
Parsing /opt/nordic/ncs/v2.3.0/modules/lib/matter/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root
Loaded configuration '/opt/nordic/ncs/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet_defconfig'
Merged configuration '/Users/ydr/dev/nordic/wb-template/child_image/multiprotocol_rpmsg/prj.conf'
Merged configuration '/opt/nordic/ncs/v2.3.0/nrf/subsys/bootloader/image/secure_boot.conf'
Merged configuration '/opt/nordic/ncs/v2.3.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Merged configuration '/Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/zephyr/.config'
Kconfig header saved to '/Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc

=== child image b0n - CPUNET (inherited) begin ===
loading initial cache file /Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/b0n/child_image_preload.cmake
Loading Zephyr default modules (Zephyr base).
-- Application: /opt/nordic/ncs/v2.3.0/nrf/samples/nrf5340/netboot
-- Found Python3: /opt/nordic/ncs/toolchains/v2.3.0/bin/python3.9 (found suitable exact version "3.9.6") found components: Interpreter 
-- Cache files will be written to: /Users/ydr/Library/Caches/zephyr
-- Zephyr version: 3.2.99 (/opt/nordic/ncs/v2.3.0/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: nrf5340dk_nrf5340_cpunet
-- Found host-tools: zephyr 0.15.2 (/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.15.2 (/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
-- Found Dtc: /opt/nordic/ncs/toolchains/v2.3.0/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
-- Found BOARD.dts: /opt/nordic/ncs/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
-- Generated zephyr.dts: /Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/b0n/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/b0n/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/b0n/zephyr/dts.cmake
Parsing /opt/nordic/ncs/v2.3.0/nrf/samples/nrf5340/netboot/Kconfig
Loaded configuration '/opt/nordic/ncs/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet_defconfig'
Merged configuration '/opt/nordic/ncs/v2.3.0/nrf/samples/nrf5340/netboot/prj.conf'
Merged configuration '/opt/nordic/ncs/v2.3.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Configuration saved to '/Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/b0n/zephyr/.config'
Kconfig header saved to '/Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/b0n/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
CMake Warning at /opt/nordic/ncs/v2.3.0/zephyr/CMakeLists.txt:1838 (message):
  __ASSERT() statements are globally ENABLED


-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg/b0n
=== child image b0n - CPUNET (inherited) end ===

CMake Warning at ../../../subsys/bootloader/cmake/debug_keys.cmake:36 (message):
  

      --------------------------------------------------------------
      --- WARNING: Using generated NSIB public/private key-pair. ---
      --- It should not be used for production.                  ---
      --- See CONFIG_SB_SIGNING_KEY_FILE                         ---
      --------------------------------------------------------------
      

Call Stack (most recent call first):
  ../../../subsys/bootloader/cmake/provision_hex.cmake:23 (include)
  ../../../subsys/bootloader/image/CMakeLists.txt:42 (include)


-- libmetal version: 1.3.0 (/opt/nordic/ncs/v2.3.0/nrf/samples/nrf5340/multiprotocol_rpmsg)
-- Build type:  
-- Host:    Darwin/arm64
-- Target:  Generic/arm
-- Machine: arm
-- Looking for include file stdatomic.h
-- Looking for include file stdatomic.h - found
-- open-amp version: 1.3.0 (/opt/nordic/ncs/v2.3.0/modules/lib/open-amp/open-amp)
-- Looking for include file fcntl.h
-- Host:    Darwin/arm64
-- Target:  Generic/arm
-- Machine: arm
-- C_FLAGS :  -Wall -Wextra
-- Looking for include file fcntl.h - found
CMake Warning at /opt/nordic/ncs/v2.3.0/zephyr/CMakeLists.txt:824 (message):
  No SOURCES given to Zephyr library: drivers__console

  Excluding target from build.


CMake Warning at /opt/nordic/ncs/v2.3.0/zephyr/CMakeLists.txt:1838 (message):
  __ASSERT() statements are globally ENABLED


-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ydr/dev/nordic/wb-template/build/multiprotocol_rpmsg
=== child image multiprotocol_rpmsg - CPUNET end ===

-- Found Python3: /opt/nordic/ncs/toolchains/v2.3.0/bin/python3.9 (found version "3.9.6") found components: Interpreter 

=== child image mcuboot -  begin ===
loading initial cache file /Users/ydr/dev/nordic/wb-template/build/mcuboot/child_image_preload.cmake
Loading Zephyr default modules (Zephyr base).
-- Application: /opt/nordic/ncs/v2.3.0/bootloader/mcuboot/boot/zephyr
-- Found Python3: /opt/nordic/ncs/toolchains/v2.3.0/bin/python3.9 (found suitable exact version "3.9.6") found components: Interpreter 
-- Cache files will be written to: /Users/ydr/Library/Caches/zephyr
-- Zephyr version: 3.2.99 (/opt/nordic/ncs/v2.3.0/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: nrf5340dk_nrf5340_cpuapp
-- Found host-tools: zephyr 0.15.2 (/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.15.2 (/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
-- Found Dtc: /opt/nordic/ncs/toolchains/v2.3.0/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
-- Found BOARD.dts: /opt/nordic/ncs/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
-- Found devicetree overlay: /opt/nordic/ncs/v2.3.0/nrf/modules/mcuboot/flash_sim.overlay
-- Found devicetree overlay: /Users/ydr/dev/nordic/wb-template/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay
-- Found devicetree overlay: /opt/nordic/ncs/v2.3.0/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Generated zephyr.dts: /Users/ydr/dev/nordic/wb-template/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /Users/ydr/dev/nordic/wb-template/build/mcuboot/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /Users/ydr/dev/nordic/wb-template/build/mcuboot/zephyr/dts.cmake
Parsing /opt/nordic/ncs/v2.3.0/modules/lib/matter/config/nrfconnect/chip-module/Kconfig.mcuboot.root
Loaded configuration '/opt/nordic/ncs/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
Merged configuration '/Users/ydr/dev/nordic/wb-template/child_image/mcuboot/prj.conf'
Merged configuration '/opt/nordic/ncs/v2.3.0/nrf/subsys/pcd/pcd.conf'
Merged configuration '/opt/nordic/ncs/v2.3.0/nrf/subsys/partition_manager/ext_flash_mcuboot_secondary.conf'
Merged configuration '/opt/nordic/ncs/v2.3.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Merged configuration '/Users/ydr/dev/nordic/wb-template/build/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to '/Users/ydr/dev/nordic/wb-template/build/mcuboot/zephyr/.config'
Kconfig header saved to '/Users/ydr/dev/nordic/wb-template/build/mcuboot/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
MCUBoot bootloader key file: /opt/nordic/ncs/v2.3.0/bootloader/mcuboot/root-rsa-2048.pem
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ydr/dev/nordic/wb-template/build/mcuboot
=== child image mcuboot -  end ===

CMake Warning at /opt/nordic/ncs/v2.3.0/nrf/modules/mcuboot/CMakeLists.txt:286 (message):
  

          ---------------------------------------------------------
          --- WARNING: Using default MCUBoot key, it should not ---
          --- be used for production.                           ---
          ---------------------------------------------------------
          



-- libmetal version: 1.3.0 (/Users/ydr/dev/nordic/wb-template)
-- Looking for include file stdatomic.h
-- Build type:  
-- Host:    Darwin/arm64
-- Target:  Generic/arm
-- Machine: arm
-- Looking for include file stdatomic.h - found
-- open-amp version: 1.3.0 (/opt/nordic/ncs/v2.3.0/modules/lib/open-amp/open-amp)
-- Looking for include file fcntl.h
-- Host:    Darwin/arm64
-- Target:  Generic/arm
-- Machine: arm
-- C_FLAGS :  -Wall -Wextra
-- Looking for include file fcntl.h - found
CMake Warning at /opt/nordic/ncs/v2.3.0/nrfxlib/openthread/cmake/extensions.cmake:113 (message):
   
   Current nrf_security configuration does not provide all MBEDTLS options which are required by precompiled OpenThread libraries.
   The minimum of MBEDTLS configuration is stored at: /opt/nordic/ncs/v2.3.0/nrfxlib/openthread/lib/cortex-m33/hard-float/v1.3/mtd/oberon/nrf_security_mbedtls_configuration.h

Call Stack (most recent call first):
  /opt/nordic/ncs/v2.3.0/nrfxlib/openthread/CMakeLists.txt:82 (check_openthread_dependencies)


CMake Warning at /opt/nordic/ncs/v2.3.0/zephyr/CMakeLists.txt:1838 (message):
  __ASSERT() statements are globally ENABLED


-- Found partition manager static configuration: /Users/ydr/dev/nordic/wb-template/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml
Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_pad' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined.
Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary_1' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_secondary_1' is not included in the dynamic resolving since it is statically defined.
Partition 'pcd_sram' is not included in the dynamic resolving since it is statically defined.
CMake Error at /opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/chip_data_model.cmake:45 (message):
  Failed to execute zap_cluster_list.py: Traceback (most recent call last):

    File "/opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap_cluster_list.py", line 258, in <module>
      main()
    File "/opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap_cluster_list.py", line 252, in main
      dump_zapfile_clusters(args.zap_file)
    File "/opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap_cluster_list.py", line 234, in dump_zapfile_clusters
      get_cluster_sources(server_clusters, SERVER_CLUSTERS, 'server'))
    File "/opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap_cluster_list.py", line 197, in get_cluster_sources
      raise ValueError("Unhandled %s cluster: %s"

  ValueError: Unhandled server cluster: OTA_REQUESTOR_CLUSTER (hint: add to
  src/app/zap_cluster_list.py)

Call Stack (most recent call first):
  /opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/chip_data_model.cmake:82 (chip_configure_zap_file)
  CMakeLists.txt:54 (chip_configure_data_model)


-- Configuring incomplete, errors occurred!
See also "/Users/ydr/dev/nordic/wb-template/build/CMakeFiles/CMakeOutput.log".
See also "/Users/ydr/dev/nordic/wb-template/build/CMakeFiles/CMakeError.log".
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/v2.3.0/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/toolchains/v2.3.0/bin/python3 -B/Users/ydr/dev/nordic/wb-template/build -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DBOARD_ROOT:STRING=/Users/ydr/dev/nordic/wb-template -DDTC_OVERLAY_FILE:STRING=/Users/ydr/dev/nordic/wb-template/boards/nrf5340dk_nrf5340_cpuapp.overlay -DCONFIG_DEBUG_OPTIMIZATIONS:STRING=y -DCONFIG_DEBUG_THREAD_INFO:STRING=y -DCONF_FILE:STRING=/Users/ydr/dev/nordic/wb-template/prj.conf -S/Users/ydr/dev/nordic/wb-template

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Parents
  • Hi,

    Which endpoint do you see on the device when you open the template.zap file, and which clusters are enabled?

    Do you get any warnings or errors when opening the .zap file or when running the Python script to generate the files?

    Best regards,
    Marte

  • Hi Marte - thanks for getting back to me so quickly - much appreciated!

    I attach a screenshot from the ZAP tool which shows that endpoint-0 is enabled with 14 clusters.

    I also include the shell output of what happens when I run the zap script and the generate script.

    If it would help, I can also provide you with the source code files in the src/zap-generated subdirectory before and after I run the generate script. There are some differences from the "out of the box" template sample files and the ones that get generated by my running generate.py.

    Also my node and npm versions are as follows:

    ydr@MacBook-Pro matter % node --version

    v20.1.0

    ydr@MacBook-Pro matter % npm --version

    9.6.4

    Thanks for your help! Dan.

    ydr@MacBook-Pro matter % zap ~/dev/nordic/wb-template/src/template.zap 
    🔧 Using state directory: /Users/ydr/.zap
    ydr@MacBook-Pro matter % python3 ./scripts/tools/zap/generate.py ~/dev/nordic/wb-template/src/template.zap -t src/app/zap-templates/app-templates.json -o ~/dev/nordic/wb-template/src/zap-generated
    Searching for zcl file from /Users/ydr/dev/nordic/wb-template/src/template.zap
    🔧 Using temporary state directory: /var/folders/lh/86j7kz7x3kl3xqd_zsw8vhzh0000gn/T/zap.IZcB7f
    🤖 ZAP generation started: 
        🔍 input files: /Users/ydr/dev/nordic/wb-template/src/template.zap
        🔍 output pattern: /Users/ydr/dev/nordic/wb-template/src/zap-generated
        🔍 using templates: /opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap-templates/app-templates.json
        🔍 using zcl data: /opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap-templates/zcl/zcl.json
        🔍 zap version: ver. 2022.12.20, featureLevel 89, commit: 77fd67f73a927468033f58710333ba33823beb04 from 2022-12-20T22:46:49.000Z, mode: binary, exe: zap-cli
    🕐 Setup time: 1s 60ms 
    👉 using input file: /Users/ydr/dev/nordic/wb-template/src/template.zap
    👉 using output destination: /Users/ydr/dev/nordic/wb-template/src/zap-generated
    🕐 File loading time: 53ms
    🤖 Generating files:
        ✍  /Users/ydr/dev/nordic/wb-template/src/zap-generated/callback-stub.cpp
        ✍  /Users/ydr/dev/nordic/wb-template/src/zap-generated/gen_config.h
        ✍  /Users/ydr/dev/nordic/wb-template/src/zap-generated/IMClusterCommandHandler.cpp
        ✍  /Users/ydr/dev/nordic/wb-template/src/zap-generated/PluginApplicationCallbacks.h
        ✍  /Users/ydr/dev/nordic/wb-template/src/zap-generated/CHIPClusters.h
        ✍  /Users/ydr/dev/nordic/wb-template/src/zap-generated/CHIPClientCallbacks.h
        ✍  /Users/ydr/dev/nordic/wb-template/src/zap-generated/endpoint_config.h
        ✍  /Users/ydr/dev/nordic/wb-template/src/zap-generated/access.h
        ✍  /Users/ydr/dev/nordic/wb-template/src/zap-generated/Clusters.matter
    🕐 Generation time: 729ms 
    clang-format error: [Errno 2] No such file or directory: 'clang-format'
    ydr@MacBook-Pro matter % 

  • Hi,

    It seems like your template.zap or something else has some outdated configurations. Can you upload your template.zap and modules/lib/matter/src/app/zap_cluster_list.py?

    If you look at template.zap#L1586 from v2.2.0, you can see the cluster called OTA_REQUESTOR_CLUSTER. This cluster was renamed in v2.3.0 to OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER, as you can see in template.zap#L1586 from v2.3.0.

    If you have the old name in your template.zap or in zap_cluster_list.py that might explain the issue.

    Best regards,
    Marte

  • Hi Marte - I went back carefully to redo everything and was unable to reproduce the problem I had originally. So overall we are good. Thanks for your help.

    One minor issue did come up when I tried to run the generate script and it had trouble finding the zcl files whose path was incorrect in the termplate.zap file. I share with you in case it is something that can be addressed either in the documentation or in code.

    ⇒ I am modifying lines 21 and 29 in template.zap to so it can find the zcl files. [not sure why the default isn’t working - might be something that Nordic should look into?]
    
          "path": "../../../../../modules/lib/matter/src/app/zap-templates/zcl/zcl.json",
    ⇒      "path": "../../../../../../opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap-templates/zcl/zcl.json",
    
          "path": "../../../../../modules/lib/matter/src/app/zap-templates/app-templates.json",
    ⇒      "path": "../../../../../../opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap-templates/app-templates.json",
    

    I also include a detailed step by step log of everything I did in case it is helpful to someone else who comes across this ticket.

    Starting with v.2.3.0 of the SDK and toolchain as installed by the NRF Connect desktop app. I am on an M1 Max Mac.
    
    Create new standalone app in VS Code based on Matter template sample.
    confirmed that line 1586 of template.zap had the new value OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER 
    opened a shell window from NRF Connect-Toolchain Manager.
    cd /opt/nordic/ncs/v2.3.0/modules/lib/matter
    source ~/.bash_profile  [to get the path to the zap tools]
    ydr@MacBook-Pro matter % which zap
    /opt/nordic/ncs/v2.3.0/modules/lib/matter/location_path/zap-mac/zap.app/Contents/MacOS//zap
    zap ~/dev/nordic/template_test/src/template.zap
    Mysteriously, although the left pane says “Enabled Clusters: 14”, none show up in the filtered view.
    trying to build in VS Code… it built successfully. No changes to template.zap file, and reopening it with zap tools looks exactly the same as before.
    OK - let’s try to run the generate.py script
    Aside: if i try to run python I get an error. Not so when I run python3.
    
    ydr@MacBook-Pro matter % python 
    zsh: exec format error: python
    
    
    ydr@MacBook-Pro matter % which python
    /opt/nordic/ncs/toolchains/v2.3.0/opt/nanopb/generator-bin/python
    
    
    ydr@MacBook-Pro matter % which python3
    /opt/homebrew/bin/python3
    
    ydr@MacBook-Pro matter % python3 ./scripts/tools/zap/generate.py ~/dev/nordic/template_test/src/template.zap -t src/app/zap-templates/app-templates.json -o ~/dev/nordic/template_test/src/zap-generated
    
    Searching for zcl file from /Users/ydr/dev/nordic/template_test/src/template.zap
    Error: /Users/modules/lib/matter/src/app/zap-templates/zcl/zcl.json does not exists or is not a file.
    
    ⇒ I am modifying lines 21 and 29 in template.zap to so it can find the zcl files. [not sure why the default isn’t working - might be something that Nordic should look into?]
    
          "path": "../../../../../modules/lib/matter/src/app/zap-templates/zcl/zcl.json",
    ⇒      "path": "../../../../../../opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap-templates/zcl/zcl.json",
    
          "path": "../../../../../modules/lib/matter/src/app/zap-templates/app-templates.json",
    ⇒      "path": "../../../../../../opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap-templates/app-templates.json",
    
    Now at least generate.py seems to work:
    ydr@MacBook-Pro matter % ./scripts/tools/zap/generate.py /Users/ydr/dev/nordic/template_test/src/template.zap
    Searching for zcl file from /Users/ydr/dev/nordic/template_test/src/template.zap
    🔧 Using temporary state directory: /var/folders/lh/86j7kz7x3kl3xqd_zsw8vhzh0000gn/T/zap.V2ZjID
    🤖 ZAP generation started: 
        🔍 input files: /Users/ydr/dev/nordic/template_test/src/template.zap
        🔍 output pattern: /Users/ydr/dev/nordic/template_test/src/zap-generated/
        🔍 using templates: /opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap-templates/app-templates.json
        🔍 using zcl data: /opt/nordic/ncs/v2.3.0/modules/lib/matter/src/app/zap-templates/zcl/zcl.json
        🔍 zap version: ver. 2022.12.20, featureLevel 89, commit: 77fd67f73a927468033f58710333ba33823beb04 from 2022-12-20T22:46:49.000Z, mode: binary, exe: zap-cli
    🕐 Setup time: 1s 58ms 
    👉 using input file: /Users/ydr/dev/nordic/template_test/src/template.zap
    👉 using output destination: /Users/ydr/dev/nordic/template_test/src/zap-generated/
    🕐 File loading time: 51ms
    🤖 Generating files:
        ✍  /Users/ydr/dev/nordic/template_test/src/zap-generated/callback-stub.cpp
        ✍  /Users/ydr/dev/nordic/template_test/src/zap-generated/gen_config.h
        ✍  /Users/ydr/dev/nordic/template_test/src/zap-generated/IMClusterCommandHandler.cpp
        ✍  /Users/ydr/dev/nordic/template_test/src/zap-generated/PluginApplicationCallbacks.h
        ✍  /Users/ydr/dev/nordic/template_test/src/zap-generated/CHIPClusters.h
        ✍  /Users/ydr/dev/nordic/template_test/src/zap-generated/CHIPClientCallbacks.h
        ✍  /Users/ydr/dev/nordic/template_test/src/zap-generated/endpoint_config.h
        ✍  /Users/ydr/dev/nordic/template_test/src/zap-generated/access.h
        ✍  /Users/ydr/dev/nordic/template_test/src/zap-generated/Clusters.matter
    🕐 Generation time: 716ms 
    clang-format error: [Errno 2] No such file or directory: 'clang-format'
    
    And now iit builds successfully. I can’t reproduce my previous error. So let’s close out this ticket and I will continue with trying to add my custom clusters.

  • Hi,

    I am glad to hear that you figured it out, and thank you for sharing detailed steps for others to find!

    Best regards,
    Marte

Reply Children
No Data
Related