Error when run west zap-generate with parameters

Hello,

I am using matter SDK v2.7.0, when I run command below:

west zap-generate -z ~/Work/matter/light_switch/src/light_switch.zap -m /opt/nordic/ncs/v2.7.0

I get error:

FileNotFoundError: [Errno 2] No such file or directory: '/opt/nordic/ncs/v2.7.0/scripts/tools/zap/zap_execution.py'

The path "/opt/nordic/ncs/v2.7.0/scripts/tools/zap/zap_execution.py" is incorrect. It should be "/opt/nordic/ncs/v2.7.0/modules/lib/matter/scripts/tools/zap/zap_execution.py"?

Parents
  • Hello,

    The path "/opt/nordic/ncs/v2.7.0/scripts/tools/zap/zap_execution.py" is incorrect. It should be "/opt/nordic/ncs/v2.7.0/modules/lib/matter/scripts/tools/zap/zap_execution.py"?

    The path is wrong because you are missing the /modules/lib/matter part of the -m parameter value. The -m parameter should be the path to the Matter SDK installation which is in ncs/v2.7.0/modules/lib/matter. See the documentation for the zap-generate command here.

    Best regards,

    Maria

  • Hi,

    Thank for your support!

    I used command with /modules/lib/matter, but below error occurs:

    west zap-generate -z ~/Work/matter/light_switch/src/light_switch.zap -m /opt/nordic/ncs/v2.7.0/modules/lib/matter

    ZAP installation directory: /opt/nordic/ncs/v2.7.0/modules/lib/matter/.zap-install

    Found ZAP 2024.3.14 (up to date)

    Searching for zcl file from /Users/hien/Work/matter/light_switch/src/light_switch.zap

    Error: /Users/modules/lib/matter/src/app/zap-templates/zcl/zcl.json does not exists or is not a file.

    FATAL ERROR: command exited with status 1: /Library/Developer/CommandLineTools/usr/bin/python3 /opt/nordic/ncs/v2.7.0/modules/lib/matter/scripts/tools/zap/generate.py /Users/hien/Work/matter/light_switch/src/light_switch.zap -t /opt/nordic/ncs/v2.7.0/modules/lib/matter/src/app/zap-templates/app-templates.json -o /Users/hien/Work/matter/light_switch/src/zap-generated

  • Hello,

    Hien said:
    Thank for your support!

    Happy to help!

    Hien said:

    I used command with /modules/lib/matter, but below error occurs:

    west zap-generate -z ~/Work/matter/light_switch/src/light_switch.zap -m /opt/nordic/ncs/v2.7.0/modules/lib/matter

    ZAP installation directory: /opt/nordic/ncs/v2.7.0/modules/lib/matter/.zap-install

    Found ZAP 2024.3.14 (up to date)

    Searching for zcl file from /Users/hien/Work/matter/light_switch/src/light_switch.zap

    Error: /Users/modules/lib/matter/src/app/zap-templates/zcl/zcl.json does not exists or is not a file.

    Now it looks like the first path is the wrong one. Please check that the value sent to the -z parameter reflects the location on your machine.

    If you still get build errors, make sure that you have installed the ZAP took like described in the documentation.

    Best regards,

    Maria

  • Hi Maria,


    I have installed ZAP tool like described in the documentation by run command west zap-gui in directory /opt/nordic/ncs/v2.7.0/modules/lib/matter.

    The ZAP tool can be open ok, but when I run west zap-generate so the above error occurs.

    Maybe we need update environment variable?

    I am running on macOS.

    Best regards,

    Hien

Reply Children
Related