diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index eb943766522be0..591641c08e74eb 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -78,119 +78,119 @@ jobs: - name: Build example nRF Connect SDK Lock App on nRF52840 DK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh lock-app nrf52840dk_nrf52840 + scripts/examples/nrfconnect_example.sh lock-app nrf52840dk/nrf52840 .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf52840dk_nrf52840 lock-app \ - examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Lighting App on nRF52840 Dongle if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle_nrf52840 -DCONFIG_CHIP_ROTATING_DEVICE_ID=y + scripts/examples/nrfconnect_example.sh lighting-app nrf52840dongle/nrf52840 -DCONFIG_CHIP_ROTATING_DEVICE_ID=y .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf52840dongle_nrf52840 lighting-app \ - examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Lighting App on nRF52840 DK with RPC if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk_nrf52840 -DOVERLAY_CONFIG=rpc.overlay + scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk/nrf52840 -DOVERLAY_CONFIG=rpc.overlay .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf52840dk_nrf52840+rpc lighting-app \ - examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Light Switch App on nRF52840 DK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh light-switch-app nrf52840dk_nrf52840 + scripts/examples/nrfconnect_example.sh light-switch-app nrf52840dk/nrf52840 .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf52840dk_nrf52840 light-switch-app \ - examples/light-switch-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/light-switch-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Shell on nRF52840 DK if: github.event_name == 'push' || steps.changed_paths.outputs.shell == 'true' run: | - scripts/examples/nrfconnect_example.sh shell nrf52840dk_nrf52840 + scripts/examples/nrfconnect_example.sh shell nrf52840dk/nrf52840 .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf52840dk_nrf52840 shell \ - examples/shell/nrfconnect/build/zephyr/zephyr.elf \ + examples/shell/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Pump App on nRF52840 DK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh pump-app nrf52840dk_nrf52840 + scripts/examples/nrfconnect_example.sh pump-app nrf52840dk/nrf52840 .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf52840dk_nrf52840 pump-app \ - examples/pump-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/pump-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Pump Controller App on nRF52840 DK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh pump-controller-app nrf52840dk_nrf52840 + scripts/examples/nrfconnect_example.sh pump-controller-app nrf52840dk/nrf52840 .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf52840dk_nrf52840 pump-controller-app \ - examples/pump-controller-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/pump-controller-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK All Clusters App on nRF52840 DK run: | - scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk_nrf52840 + scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk/nrf52840 .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf52840dk_nrf52840 all-clusters-app \ - examples/all-clusters-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/all-clusters-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK All Clusters Minimal App on nRF52840 DK run: | - scripts/examples/nrfconnect_example.sh all-clusters-minimal-app nrf52840dk_nrf52840 -DCONF_FILE=prj_dfu.conf + scripts/examples/nrfconnect_example.sh all-clusters-minimal-app nrf52840dk/nrf52840 -DFILE_SUFFIX=dfu .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf52840dk_nrf52840 all-clusters-minimal-app \ - examples/all-clusters-minimal-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/all-clusters-minimal-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Lock App on nRF5340 DK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh lock-app nrf5340dk_nrf5340_cpuapp + scripts/examples/nrfconnect_example.sh lock-app nrf5340dk/nrf5340/cpuapp .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf5340dk_nrf5340_cpuapp lock-app \ - examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Lighting App on nRF5340 DK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh lighting-app nrf5340dk_nrf5340_cpuapp + scripts/examples/nrfconnect_example.sh lighting-app nrf5340dk/nrf5340/cpuapp .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf5340dk_nrf5340_cpuapp lighting-app \ - examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/lighting-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Lock App on nRF7002 PDK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh lock-app nrf7002dk_nrf5340_cpuapp + scripts/examples/nrfconnect_example.sh lock-app nrf7002dk/nrf5340/cpuapp .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf7002dk_nrf5340_cpuapp lock-app \ - examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/lock-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Light Switch App on nRF7002 PDK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh light-switch-app nrf7002dk_nrf5340_cpuapp + scripts/examples/nrfconnect_example.sh light-switch-app nrf7002dk/nrf5340/cpuapp .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf7002dk_nrf5340_cpuapp light-switch-app \ - examples/light-switch-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/light-switch-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK Lighting App on nRF7002 PDK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' run: | - scripts/examples/nrfconnect_example.sh lighting-app nrf7002dk_nrf5340_cpuapp + scripts/examples/nrfconnect_example.sh lighting-app nrf7002dk/nrf5340/cpuapp .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf7002dk_nrf5340_cpuapp lighting-app \ - examples/light-switch-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/light-switch-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Build example nRF Connect SDK All Clusters App on nRF7002 PDK run: | - scripts/examples/nrfconnect_example.sh all-clusters-app nrf7002dk_nrf5340_cpuapp -DCONF_FILE=prj_release.conf + scripts/examples/nrfconnect_example.sh all-clusters-app nrf7002dk/nrf5340/cpuapp -DFILE_SUFFIX=release .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf7002dk_nrf5340_cpuapp all-clusters-app \ - examples/all-clusters-app/nrfconnect/build/zephyr/zephyr.elf \ + examples/all-clusters-app/nrfconnect/build/nrfconnect/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: Run unit tests for Zephyr native_posix_64 platform if: github.event_name == 'push' || steps.changed_paths.outputs.tests == 'true' || steps.changed_paths.outputs.nrfconnect == 'true' diff --git a/examples/all-clusters-app/nrfconnect/sysbuild_dfu.conf b/examples/all-clusters-app/nrfconnect/sysbuild_dfu.conf new file mode 100644 index 00000000000000..edaaa8394e0155 --- /dev/null +++ b/examples/all-clusters-app/nrfconnect/sysbuild_dfu.conf @@ -0,0 +1,20 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +SB_CONFIG_MATTER=y +SB_CONFIG_MATTER_OTA=y +SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_MATTER_FACTORY_DATA_GENERATE=y diff --git a/examples/all-clusters-app/nrfconnect/sysbuild_release.conf b/examples/all-clusters-app/nrfconnect/sysbuild_release.conf new file mode 100644 index 00000000000000..edaaa8394e0155 --- /dev/null +++ b/examples/all-clusters-app/nrfconnect/sysbuild_release.conf @@ -0,0 +1,20 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +SB_CONFIG_MATTER=y +SB_CONFIG_MATTER_OTA=y +SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_MATTER_FACTORY_DATA_GENERATE=y diff --git a/examples/all-clusters-minimal-app/nrfconnect/sysbuild_dfu.conf b/examples/all-clusters-minimal-app/nrfconnect/sysbuild_dfu.conf new file mode 100644 index 00000000000000..7151539bc715fc --- /dev/null +++ b/examples/all-clusters-minimal-app/nrfconnect/sysbuild_dfu.conf @@ -0,0 +1,20 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +SB_CONFIG_MATTER=y +SB_CONFIG_MATTER_OTA=y +SB_CONFIG_BOOTLOADER_MCUBOOT=y + diff --git a/examples/all-clusters-minimal-app/nrfconnect/sysbuild_release.conf b/examples/all-clusters-minimal-app/nrfconnect/sysbuild_release.conf new file mode 100644 index 00000000000000..edaaa8394e0155 --- /dev/null +++ b/examples/all-clusters-minimal-app/nrfconnect/sysbuild_release.conf @@ -0,0 +1,20 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +SB_CONFIG_MATTER=y +SB_CONFIG_MATTER_OTA=y +SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_MATTER_FACTORY_DATA_GENERATE=y diff --git a/examples/chef/chef.py b/examples/chef/chef.py index c9a34a3a172ffe..cecbf646ffeedf 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -199,6 +199,7 @@ def bundle_nrfconnect(device_name: str) -> None: nrf_root = os.path.join(_CHEF_SCRIPT_PATH, "nrfconnect", "build", + "nrfconnect", "zephyr") scripts_root = os.path.join(_REPO_BASE_PATH, "scripts", @@ -723,9 +724,10 @@ def main() -> int: f"cp build/$(git rev-parse HEAD)-{options.sample_device_type_name}.tar.xz {_CHEF_SCRIPT_PATH}") elif options.build_target == "nrfconnect": shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/nrfconnect") - nrf_build_cmds = ["west build -b nrf52840dk_nrf52840"] + nrf_build_cmds = ["west build -b nrf52840dk/nrf52840"] if options.do_clean: nrf_build_cmds.append("-p always") + nrf_build_cmds.append("--sysbuild") nrf_build_cmds.append("--") if options.do_rpc: nrf_build_cmds.append("-DOVERLAY_CONFIG=rpc.overlay") @@ -736,11 +738,9 @@ def main() -> int: nrf_build_cmds.append( f"-DCONFIG_CHIP_DEVICE_PRODUCT_NAME='\"{options.pname}\"'") nrf_build_cmds.append( - f"-DSAMPLE_NAME={options.sample_device_type_name}") + f"-DCONFIG_CHEF_DEVICE_TYPE='\"{options.sample_device_type_name}\"'") nrf_build_cmds.append( f"-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING='\"{sw_ver_string}\"'") - nrf_build_cmds.append( - f"--sysbuild") shell.run_cmd(" ".join(nrf_build_cmds)) diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index c6dfd1f5139311..081c510435c1e6 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -21,8 +21,6 @@ get_filename_component(CHEF ${CMAKE_CURRENT_SOURCE_DIR}/../ REALPATH) include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) -get_filename_component(GEN_DIR ${CHEF}/out/${SAMPLE_NAME}/zap-generated REALPATH) - set(CONF_FILE prj.conf) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -39,6 +37,8 @@ endif() find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) +get_filename_component(GEN_DIR ${CHEF}/out/${CONFIG_CHEF_DEVICE_TYPE}/zap-generated REALPATH) + project(chip-nrfconnect-chef-example) include(${CHIP_ROOT}/config/nrfconnect/app/check-sysbuild-use.cmake) @@ -104,10 +104,10 @@ target_sources(app PRIVATE ${CHEF}/nrfconnect/main.cpp ) -message(STATUS ${CHEF}/devices/${SAMPLE_NAME}.zap) +message(STATUS ${CHEF}/devices/${CONFIG_CHEF_DEVICE_TYPE}.zap) chip_configure_data_model(app INCLUDE_SERVER - ZAP_FILE ${CHEF}/devices/${SAMPLE_NAME}.zap + ZAP_FILE ${CHEF}/devices/${CONFIG_CHEF_DEVICE_TYPE}.zap ) include(${CHIP_ROOT}/config/nrfconnect/app/flashing.cmake) diff --git a/examples/chef/nrfconnect/Kconfig b/examples/chef/nrfconnect/Kconfig index 2b1125e68bbef6..f5ef9cd1aa1e2c 100644 --- a/examples/chef/nrfconnect/Kconfig +++ b/examples/chef/nrfconnect/Kconfig @@ -15,6 +15,12 @@ # mainmenu "Matter nRF Connect Chef Example Application" +config CHEF_DEVICE_TYPE + string "Chef app device type" + default "" + help + Specifies the device type used to generate data model for the chef app. It should be the string literal matching one of the file names located in the chef's devices directory. + rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" rsource "../../../config/nrfconnect/chip-module/Kconfig.features" source "Kconfig.zephyr" diff --git a/scripts/build/builders/nrf.py b/scripts/build/builders/nrf.py index 981ea0ae2e897c..567033e5fec200 100644 --- a/scripts/build/builders/nrf.py +++ b/scripts/build/builders/nrf.py @@ -197,7 +197,7 @@ def generate(self): export ZEPHYR_SDK_INSTALL_DIR={zephyr_sdk_dir};''' cmd += ''' -west build --cmake-only -d {outdir} -b {board} {sourcedir}{build_flags} --sysbuild +west build --cmake-only -d {outdir} -b {board} --sysbuild {sourcedir}{build_flags} '''.format( outdir=shlex.quote(self.output_dir), board=self.board.GnArgName(), diff --git a/scripts/build/testdata/dry_run_nrf-nrf52840dk-pump.txt b/scripts/build/testdata/dry_run_nrf-nrf52840dk-pump.txt index 500826f734eee9..91865370312d97 100644 --- a/scripts/build/testdata/dry_run_nrf-nrf52840dk-pump.txt +++ b/scripts/build/testdata/dry_run_nrf-nrf52840dk-pump.txt @@ -4,7 +4,7 @@ cd "{root}" # Generating nrf-nrf52840dk-pump bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh"; export ZEPHYR_TOOLCHAIN_VARIANT=zephyr; -west build --cmake-only -d {out}/nrf-nrf52840dk-pump -b nrf52840dk_nrf52840 {root}/examples/pump-app/nrfconnect' +west build --cmake-only -d {out}/nrf-nrf52840dk-pump -b nrf52840dk_nrf52840 --sysbuild {root}/examples/pump-app/nrfconnect' # Building nrf-nrf52840dk-pump ninja -C {out}/nrf-nrf52840dk-pump