SiliconLabs / matter

Matter is creating more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://www.silabs.com/wireless/matter
Apache License 2.0
151 stars 45 forks source link

build failed when enable scenes cluster on lighting app #38

Closed ihidchaos closed 1 year ago

ihidchaos commented 1 year ago

Problem

I'm working on the Lighting app in the Release_0.3.0 branch. When I did not enable Scenes cluster in the ZAP tool, it would compile normally; However, if you enable Scenes Cluster, it won't compile. The compile command I used is as follows:

./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32/ ./out/lighting-app BRD4187C \
    chip_enable_ota_requestor=true \
    chip_build_libshell=false \
    enable_openthread_cli=false \
    chip_openthread_ftd=true \
    show_qr_code=false \
    disable_lcd=true \
    chip_detail_logging=false \
    chip_automation_logging=false \
    chip_progress_logging=false \
    is_debug=false \
    setupDiscriminator=3860

expected behavior

When we enable Scenes Cluster, it should compile successfully.

actual behavior

It displays an "undefined reference" error.

logs

Using default path for Matter root

  WELCOME TO...

         █
         █
     ▄   █   ▄                                █     █
     ▀▀█████▀▀      ▄▀▀▀▄ ▄▀▀▀▄    ▄▀▀▀▀▄█  ▀▀█▀▀▀▀▀█▀▀   ▄▀▀▀▀▄    ▄▀▀
   ▀█▄       ▄█▀   █     █     █  █      █    █     █    █▄▄▄▄▄▄█  █   
     ▀█▄   ▄█▀     █     █     █  █      █    █     █    █         █   
  ▄██▀▀█   █▀▀██▄  █     █     █   ▀▄▄▄▄▀█    ▀▄▄   ▀▄▄   ▀▄▄▄▄▀   █   
 ▀▀    █   █    ▀▀

  ACTIVATOR! This sets your shell environment variables.

Activating environment (setting environment variables):

  Setting environment variables for CIPD package manager...done
  Setting environment variables for Python environment.....done
  Setting environment variables for pw packages............skipped
  Setting environment variables for Host tools.............done

Checking the environment:

20220919 15:37:34 INF Environment passes all checks!

Environment looks good, you are ready to go!

+ env
SHELL=/bin/bash
NVM_RC_VERSION=
LANGUAGE=en_US:
LC_ADDRESS=zh_CN.UTF-8
LC_NAME=zh_CN.UTF-8
PW_PROJECT_ROOT=/home/hoorii/dev/silabs/release_0.3.0
LC_MONETARY=zh_CN.UTF-8
PWD=/home/hoorii/dev/silabs/release_0.3.0
LOGNAME=hoorii
XDG_SESSION_TYPE=tty
PNPM_HOME=/home/hoorii/.local/share/pnpm
MOTD_SHOWN=pam
PW_ROOT=/home/hoorii/dev/silabs/release_0.3.0/third_party/pigweed/repo
HOME=/home/hoorii
LC_PAPER=zh_CN.UTF-8
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
VIRTUAL_ENV=/home/hoorii/dev/silabs/release_0.3.0/.environment/pigweed-venv
SSH_CONNECTION=192.168.86.28 58682 192.168.86.235 22
PW_PYTHON_CIPD_INSTALL_DIR=/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/python
_PW_ROSETTA=0
NVM_DIR=/home/hoorii/.nvm
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
LC_IDENTIFICATION=zh_CN.UTF-8
TERM=xterm-color
LESSOPEN=| /usr/bin/lesspipe %s
USER=hoorii
DISPLAY=localhost:10.0
SHLVL=2
NVM_CD_FLAGS=
LC_TELEPHONE=zh_CN.UTF-8
PW_PACKAGE_ROOT=/home/hoorii/dev/silabs/release_0.3.0/.environment/packages
LC_MEASUREMENT=zh_CN.UTF-8
XDG_SESSION_ID=12
_PW_ENVIRONMENT_CONFIG_FILE=/home/hoorii/dev/silabs/release_0.3.0/scripts/environment.json
XDG_RUNTIME_DIR=/run/user/1000
_PW_ACTUAL_ENVIRONMENT_ROOT=/home/hoorii/dev/silabs/release_0.3.0/.environment
PW_BRANDING_BANNER=/home/hoorii/dev/silabs/release_0.3.0/scripts/matter_banner.txt
SSH_CLIENT=192.168.86.28 58682 22
PW_ARM_CIPD_INSTALL_DIR=/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/arm
LC_TIME=zh_CN.UTF-8
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop
PATH=/home/hoorii/dev/silabs/release_0.3.0/third_party/pigweed/repo/out/host/host_tools:/home/hoorii/dev/silabs/release_0.3.0/.environment/pigweed-venv/bin:/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/python/bin:/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/python:/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/pigweed/bin:/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/pigweed:/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/arm/bin:/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/arm:/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd:/home/hoorii/.local/bin:/home/hoorii/.local/share/pnpm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/hoorii/dev/SimplicityStudio_v5/developer/adapter_packs/commander/
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
SSH_TTY=/dev/pts/0
PW_PIGWEED_CIPD_INSTALL_DIR=/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/pigweed
LC_NUMERIC=zh_CN.UTF-8
OLDPWD=/home/hoorii/dev/silabs
_=/usr/bin/env
+ USE_WIFI=false
+ SILABS_THREAD_TARGET='"../silabs:ot-efr32-cert"'
+ USAGE='./scripts/examples/gn_efr32_example.sh <AppRootFolder> <outputFolder> <efr32_board_name> [<Build options>]'
+ '[' 14 == 0 ']'
+ '[' 14 -lt 2 ']'
+ ROOT=./examples/lighting-app/efr32/
+ OUTDIR=./out/lighting-app
+ '[' 14 -gt 2 ']'
+ EFR32_BOARD=BRD4187C
+ shift
+ shift
+ shift
+ '[' 11 -gt 0 ']'
+ case $1 in
+ '[' chip_enable_ota_requestor=true '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' chip_enable_ota_requestor=true '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='chip_enable_ota_requestor=true '
+ shift
+ '[' 10 -gt 0 ']'
+ case $1 in
+ '[' chip_build_libshell=false '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' chip_build_libshell=false '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='chip_build_libshell=false '
+ shift
+ '[' 9 -gt 0 ']'
+ case $1 in
+ '[' enable_openthread_cli=false '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' enable_openthread_cli=false '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='enable_openthread_cli=false '
+ shift
+ '[' 8 -gt 0 ']'
+ case $1 in
+ '[' chip_openthread_ftd=true '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' chip_openthread_ftd=true '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='chip_openthread_ftd=true '
+ shift
+ '[' 7 -gt 0 ']'
+ case $1 in
+ '[' show_qr_code=false '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' show_qr_code=false '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='show_qr_code=false '
+ shift
+ '[' 6 -gt 0 ']'
+ case $1 in
+ '[' disable_lcd=true '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' disable_lcd=true '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='disable_lcd=true '
+ shift
+ '[' 5 -gt 0 ']'
+ case $1 in
+ '[' chip_detail_logging=false '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' chip_detail_logging=false '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='chip_detail_logging=false '
+ shift
+ '[' 4 -gt 0 ']'
+ case $1 in
+ '[' chip_automation_logging=false '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' chip_automation_logging=false '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='chip_automation_logging=false '
+ shift
+ '[' 3 -gt 0 ']'
+ case $1 in
+ '[' chip_progress_logging=false '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' chip_progress_logging=false '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='chip_progress_logging=false '
+ shift
+ '[' 2 -gt 0 ']'
+ case $1 in
+ '[' is_debug=false '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' is_debug=false '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='is_debug=false '
+ shift
+ '[' 1 -gt 0 ']'
+ case $1 in
+ '[' setupDiscriminator=3860 '=~' '*use_rs911x=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ '[' setupDiscriminator=3860 '=~' '*use_wf200=true*' ']'
./scripts/examples/gn_efr32_example.sh: line 164: [: =~: binary operator expected
+ optArgs+='setupDiscriminator=3860 '
+ shift
+ '[' 0 -gt 0 ']'
+ '[' -z BRD4187C ']'
+ BUILD_DIR=./out/lighting-app/BRD4187C
+ echo BUILD_DIR=./out/lighting-app/BRD4187C
BUILD_DIR=./out/lighting-app/BRD4187C
+ '[' false == true ']'
+ '[' -z 'chip_enable_ota_requestor=true chip_build_libshell=false enable_openthread_cli=false chip_openthread_ftd=true show_qr_code=false disable_lcd=true chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false is_debug=false setupDiscriminator=3860 ' ']'
+ gn gen --check --fail-on-unused-args --export-compile-commands --root=./examples/lighting-app/efr32/ '--args=efr32_board="BRD4187C" chip_enable_ota_requestor=true chip_build_libshell=false enable_openthread_cli=false chip_openthread_ftd=true show_qr_code=false disable_lcd=true chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false is_debug=false setupDiscriminator=3860 ' ./out/lighting-app/BRD4187C
Generating compile_commands took 199ms
Done. Made 2590 targets from 204 files in 531ms
+ ninja -v -C ./out/lighting-app/BRD4187C/
ninja: Entering directory `./out/lighting-app/BRD4187C/'
[1/8] arm-none-eabi-g++ -T../../../examples/lighting-app/efr32/third_party/connectedhomeip/examples/platform/efr32/ldscripts/efr32mg24.ld -march=armv8-m.main+dsp -mcpu=cortex-m33 -mabi=aapcs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -Wl,-O2 -Wl,--gc-sections -Os --specs=nosys.specs --specs=nano.specs -Werror -Wl,--fatal-warnings -fdiagnostics-color -Wl,--gc-sections -Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=realloc -Wl,--wrap=calloc -Wl,--wrap=MemoryAlloc -Wl,--wrap=_malloc_r -Wl,--wrap=_realloc_r -Wl,--wrap=_free_r -Wl,--wrap=_calloc_r -Wl,-Map,./chip-efr32-lighting-example.out.map @./chip-efr32-lighting-example.out.rsp -o ./chip-efr32-lighting-example.out
FAILED: chip-efr32-lighting-example.out chip-efr32-lighting-example.out.map 
arm-none-eabi-g++ -T../../../examples/lighting-app/efr32/third_party/connectedhomeip/examples/platform/efr32/ldscripts/efr32mg24.ld -march=armv8-m.main+dsp -mcpu=cortex-m33 -mabi=aapcs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -Wl,-O2 -Wl,--gc-sections -Os --specs=nosys.specs --specs=nano.specs -Werror -Wl,--fatal-warnings -fdiagnostics-color -Wl,--gc-sections -Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=realloc -Wl,--wrap=calloc -Wl,--wrap=MemoryAlloc -Wl,--wrap=_malloc_r -Wl,--wrap=_realloc_r -Wl,--wrap=_free_r -Wl,--wrap=_calloc_r -Wl,-Map,./chip-efr32-lighting-example.out.map @./chip-efr32-lighting-example.out.rsp -o ./chip-efr32-lighting-example.out
/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/arm/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: obj/third_party/connectedhomeip/zzz_generated/lighting-app/zap-generated/lighting-common.IMClusterCommandHandler.cpp.o: in function `chip::app::Clusters::Scenes::DispatchServerCommand(chip::app::CommandHandler*, chip::app::ConcreteCommandPath const&, chip::TLV::TLVReader&)':
/home/hoorii/dev/silabs/release_0.3.0/out/lighting-app/BRD4187C/../../../examples/lighting-app/efr32/third_party/connectedhomeip/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp:1108: undefined reference to `emberAfScenesClusterEnhancedAddSceneCallback(chip::app::CommandHandler*, chip::app::ConcreteCommandPath const&, chip::app::Clusters::Scenes::Commands::EnhancedAddScene::DecodableType const&)'
/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/arm/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: /home/hoorii/dev/silabs/release_0.3.0/out/lighting-app/BRD4187C/../../../examples/lighting-app/efr32/third_party/connectedhomeip/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp:1117: undefined reference to `emberAfScenesClusterEnhancedViewSceneCallback(chip::app::CommandHandler*, chip::app::ConcreteCommandPath const&, chip::app::Clusters::Scenes::Commands::EnhancedViewScene::DecodableType const&)'
/home/hoorii/dev/silabs/release_0.3.0/.environment/cipd/packages/arm/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: /home/hoorii/dev/silabs/release_0.3.0/out/lighting-app/BRD4187C/../../../examples/lighting-app/efr32/third_party/connectedhomeip/zzz_generated/lighting-app/zap-generated/IMClusterCommandHandler.cpp:1126: undefined reference to `emberAfScenesClusterCopySceneCallback(chip::app::CommandHandler*, chip::app::ConcreteCommandPath const&, chip::app::Clusters::Scenes::Commands::CopyScene::DecodableType const&)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Any help is appreciated.

silabs-Simran commented 1 year ago

The scene is a provisional cluster for matter 1.0 and it is not currently implemented. This will be available post 1.0