diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index f8d0a2dc434631..d20959a6a01560 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -323,6 +323,7 @@ dcc DCHIP DCL DCMAKE +DCONF DCONFIG debianutils debugText diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 715d858646040a..ffaf1c95c1918d 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -113,7 +113,7 @@ jobs: if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' timeout-minutes: 20 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 \ @@ -175,7 +175,7 @@ jobs: - name: Build example nRF Connect SDK All Clusters App on nRF52840 DK timeout-minutes: 10 run: | - scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk_nrf52840 -DBUILD_WITH_DFU=1 + scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk_nrf52840 -DCONF_FILE=prj_dfu.conf .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 \ diff --git a/config/nrfconnect/app/overlay-mcuboot_qspi_nor_support.conf b/config/nrfconnect/app/overlay-mcuboot_qspi_nor_support.conf deleted file mode 100644 index 51901e0f573240..00000000000000 --- a/config/nrfconnect/app/overlay-mcuboot_qspi_nor_support.conf +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (c) 2022 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. -# - -CONFIG_BOOTLOADER_MCUBOOT=y - -# QSPI configuration -CONFIG_NORDIC_QSPI_NOR=y -CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 -CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 diff --git a/config/nrfconnect/app/overlay-multi_image_smp_dfu_support.conf b/config/nrfconnect/app/overlay-multi_image_smp_dfu_support.conf deleted file mode 100644 index 8292a2ba13f5d1..00000000000000 --- a/config/nrfconnect/app/overlay-multi_image_smp_dfu_support.conf +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright (c) 2022 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. -# - -CONFIG_UPDATEABLE_IMAGE_NUMBER=2 - -# MCU Manager and SMP configuration -CONFIG_MCUMGR=y -CONFIG_MCUMGR_CMD_IMG_MGMT=y -CONFIG_MCUMGR_CMD_OS_MGMT=y -CONFIG_MCUMGR_SMP_BT=y -CONFIG_MCUMGR_SMP_BT_AUTHEN=n -CONFIG_MCUMGR_BUF_COUNT=6 - -# Increase BT MTU and RX buffer for big size DFU messages -CONFIG_BT_L2CAP_TX_MTU=498 -CONFIG_BT_BUF_ACL_RX_SIZE=502 - -# Increase system workqueue size, as SMP is processed within it -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2800 - -# FLASH nop device is enabled to prevent bus faults when mcumgr tries to access -# simulated partition with network core image data. -CONFIG_FLASH_NOP_DEVICE=y - -# Enable custom SMP request to erase settings partition. -CONFIG_MCUMGR_GRP_ZEPHYR_BASIC=y -CONFIG_MCUMGR_GRP_BASIC_CMD_STORAGE_ERASE=y diff --git a/config/nrfconnect/app/overlay-ota_requestor.conf b/config/nrfconnect/app/overlay-ota_requestor.conf deleted file mode 100644 index 51f0acd210a330..00000000000000 --- a/config/nrfconnect/app/overlay-ota_requestor.conf +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -CONFIG_CHIP_OTA_REQUESTOR=y diff --git a/config/nrfconnect/app/overlay-single_image_smp_dfu_support.conf b/config/nrfconnect/app/overlay-single_image_smp_dfu_support.conf deleted file mode 100644 index d03b7dead22b4f..00000000000000 --- a/config/nrfconnect/app/overlay-single_image_smp_dfu_support.conf +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright (c) 2022 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. -# - -CONFIG_BOOTLOADER_MCUBOOT=y - -# QSPI configuration -CONFIG_NORDIC_QSPI_NOR=y -CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 -CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 - -# MCU Manager and SMP configuration -CONFIG_MCUMGR=y -CONFIG_MCUMGR_CMD_IMG_MGMT=y -CONFIG_MCUMGR_CMD_OS_MGMT=y -CONFIG_MCUMGR_SMP_BT=y -CONFIG_MCUMGR_SMP_BT_AUTHEN=n -CONFIG_MCUMGR_BUF_COUNT=6 - -# Increase BT MTU and RX buffer for big size DFU messages -CONFIG_BT_L2CAP_TX_MTU=498 -CONFIG_BT_BUF_ACL_RX_SIZE=502 - -# Increase MCUMGR_BUF_SIZE, as it must be big enough to fit MAX MTU + overhead and for single-image DFU default is 384 B -CONFIG_MCUMGR_BUF_SIZE=1024 - -# Increase system workqueue size, as SMP is processed within it -CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2800 diff --git a/config/nrfconnect/app/overlay-usb_support.conf b/config/nrfconnect/app/overlay-usb_support.conf index 0983dd29efc76e..1b4a2d56fe8490 100644 --- a/config/nrfconnect/app/overlay-usb_support.conf +++ b/config/nrfconnect/app/overlay-usb_support.conf @@ -22,4 +22,3 @@ CONFIG_USB_UART_CONSOLE=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y -CONFIG_UART_CONSOLE_ON_DEV_NAME="CDC_ACM_0" diff --git a/config/nrfconnect/app/release.conf b/config/nrfconnect/app/release.conf deleted file mode 100644 index 22f3704b63b416..00000000000000 --- a/config/nrfconnect/app/release.conf +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright (c) 2020 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. -# - -# This file contains settings which are not suitable for development phase of -# a project (in which debugging facilities should be enabled by default), but -# are perfectly valid for release builds which aim to generate binaries with -# minimal memory footprint. - -# Disable assertions -CONFIG_ASSERT=n - -# Disable shell/console -CONFIG_SHELL=n -CONFIG_OPENTHREAD_SHELL=n -CONFIG_CONSOLE=n -CONFIG_UART_CONSOLE=n -CONFIG_SERIAL=n - -# Disable logs -CONFIG_LOG=n -CONFIG_LOG_MODE_MINIMAL=n - -# Disable other debugging features -CONFIG_THREAD_NAME=n diff --git a/config/nrfconnect/app/sample-defaults.conf b/config/nrfconnect/app/sample-defaults.conf deleted file mode 100644 index 22625d175148f1..00000000000000 --- a/config/nrfconnect/app/sample-defaults.conf +++ /dev/null @@ -1,122 +0,0 @@ -# -# Copyright (c) 2020 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. -# - -CONFIG_CHIP=y -CONFIG_CHIP_DEVICE_VENDOR_ID=65521 - -CONFIG_STD_CPP14=y - -CONFIG_LOG=y -CONFIG_LOG_MODE_MINIMAL=y -CONFIG_MATTER_LOG_LEVEL_DBG=y -CONFIG_LOG_DEFAULT_LEVEL=2 -CONFIG_PRINTK_SYNC=y -CONFIG_ASSERT=y -CONFIG_HW_STACK_PROTECTION=y -CONFIG_FPU=y -CONFIG_SHELL=y - -# Enable getting reboot reasons information -CONFIG_HWINFO=y - -# Generic networking options -CONFIG_NETWORKING=y -CONFIG_NET_SOCKETS=y -CONFIG_NET_SOCKETS_POSIX_NAMES=n - -# Application stack size -CONFIG_MAIN_STACK_SIZE=8192 -CONFIG_INIT_STACKS=y - -# Enable Zephyr IPv6 multicast -CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=14 -CONFIG_NET_IPV6_MLD=y - -# Disable certain parts of Zephyr IPv6 stack -CONFIG_NET_IPV6_NBR_CACHE=n - -# Network buffers -CONFIG_NET_PKT_RX_COUNT=16 -CONFIG_NET_PKT_TX_COUNT=16 -CONFIG_NET_BUF_RX_COUNT=80 -CONFIG_NET_BUF_TX_COUNT=80 - -# Bluetooth Low Energy configs -CONFIG_BT=y -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_PERIPHERAL_PREF_MIN_INT=36 -CONFIG_BT_PERIPHERAL_PREF_MAX_INT=36 -CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y -CONFIG_BT_GATT_DYNAMIC_DB=y -CONFIG_BT_DEVICE_APPEARANCE=0 -CONFIG_BT_DEVICE_NAME_DYNAMIC=y -CONFIG_BT_DEVICE_NAME_MAX=15 -CONFIG_BT_MAX_CONN=1 -CONFIG_BT_L2CAP_TX_MTU=247 -CONFIG_BT_BUF_ACL_RX_SIZE=251 -CONFIG_BT_BUF_ACL_TX_SIZE=251 -CONFIG_BT_RX_STACK_SIZE=1120 - -# Enable NFC support -CONFIG_CHIP_NFC_COMMISSIONING=y - -# L2 OpenThread enabling -CONFIG_NET_L2_OPENTHREAD=y - -# Enable Thread 1.2 features -CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y - -# Use mbedTLS from nrf_security library -CONFIG_OPENTHREAD_NRF_SECURITY_CHOICE=y - -CONFIG_CC3XX_BACKEND=n -CONFIG_OBERON_BACKEND=y - -CONFIG_MBEDTLS_ENABLE_HEAP=y -CONFIG_MBEDTLS_HEAP_SIZE=15360 -CONFIG_MBEDTLS_TLS_LIBRARY=y -CONFIG_NRF_SECURITY_ADVANCED=y - -CONFIG_MBEDTLS_AES_C=y -CONFIG_MBEDTLS_ECP_C=y -CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y -CONFIG_MBEDTLS_CTR_DRBG_C=y -CONFIG_MBEDTLS_CIPHER_MODE_CTR=y -CONFIG_MBEDTLS_ECJPAKE_C=y -CONFIG_MBEDTLS_SHA256_C=y -CONFIG_MBEDTLS_PK_C=y -CONFIG_MBEDTLS_PK_WRITE_C=y -CONFIG_MBEDTLS_X509_CREATE_C=y -CONFIG_MBEDTLS_X509_CSR_WRITE_C=y - -# Disable unneeded crypto operations -CONFIG_MBEDTLS_SHA384_C=n -CONFIG_MBEDTLS_SHA512_C=n -CONFIG_MBEDTLS_CIPHER_MODE_XTS=n -CONFIG_MBEDTLS_CHACHA20_C=n -CONFIG_MBEDTLS_POLY1305_C=n -CONFIG_MBEDTLS_CHACHAPOLY_C=n -CONFIG_MBEDTLS_GCM_C=n -CONFIG_MBEDTLS_RSA_C=n - -# Disable not used shell modules -CONFIG_SENSOR_SHELL=n -CONFIG_DEVICE_SHELL=n -CONFIG_DATE_SHELL=n -CONFIG_DEVMEM_SHELL=n -CONFIG_MCUBOOT_SHELL=n -CONFIG_CLOCK_CONTROL_NRF_SHELL=n -CONFIG_FLASH_SHELL=n diff --git a/config/nrfconnect/chip-module/Kconfig b/config/nrfconnect/chip-module/Kconfig index 6a191a381ec7eb..9321d5f795840a 100644 --- a/config/nrfconnect/chip-module/Kconfig +++ b/config/nrfconnect/chip-module/Kconfig @@ -32,6 +32,7 @@ config CHIP_NFC_COMMISSIONING config CHIP_OTA_REQUESTOR bool imply DFU_TARGET + imply BOOTLOADER_MCUBOOT imply IMG_MANAGER imply STREAM_FLASH imply STREAM_FLASH_ERASE diff --git a/config/nrfconnect/chip-module/Kconfig.defaults b/config/nrfconnect/chip-module/Kconfig.defaults new file mode 100644 index 00000000000000..bd11d37a07cc6e --- /dev/null +++ b/config/nrfconnect/chip-module/Kconfig.defaults @@ -0,0 +1,332 @@ +# +# Copyright (c) 2022 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. +# + +# The purpose of this file is to define new default values of settings used when building Matter samples. +# This file only changes defaults and thus all symbols here must be promptless +# and safeguarded so that they only are applied when building Matter. + +if CHIP + +config LOG + bool + default y + +if LOG + +choice LOG_MODE + default LOG_MODE_MINIMAL +endchoice + +choice MATTER_LOG_LEVEL_CHOICE + default MATTER_LOG_LEVEL_DBG +endchoice + +config LOG_DEFAULT_LEVEL + int + default 2 + +endif + +config PRINTK_SYNC + bool + default y + +config ASSERT + bool + default y + +config HW_STACK_PROTECTION + bool + default y + +config FPU + bool + default y + +config SHELL + bool + default y + +# Enable getting reboot reasons information +config HWINFO + bool + default y + +# Generic networking options +config NET_SOCKETS_POSIX_NAMES + bool + default n + +# Application stack size +config MAIN_STACK_SIZE + int + default 8192 + +config INIT_STACKS + bool + default y + +config CHIP_DEVICE_VENDOR_ID + int + default 65521 + +config CHIP_DEVICE_PRODUCT_ID + int + default 32768 + +# Disable certain parts of Zephyr IPv6 stack +config NET_IPV6_NBR_CACHE + bool + default n + +config NET_IPV6_MLD + bool + default y + +config NET_IF_MCAST_IPV6_ADDR_COUNT + int + default 14 + +# Network buffers +config NET_PKT_RX_COUNT + int + default 16 + +config NET_PKT_TX_COUNT + int + default 16 + +config NET_BUF_RX_COUNT + int + default 80 + +config NET_BUF_TX_COUNT + int + default 80 + +# Bluetooth Low Energy configs + +config BT + bool + default y + +config BT_PERIPHERAL + bool + default y + +config BT_PERIPHERAL_PREF_MIN_INT + int + default 36 + +config BT_PERIPHERAL_PREF_MAX_INT + int + default 36 + +config BT_GAP_AUTO_UPDATE_CONN_PARAMS + bool + default y + +config BT_GATT_DYNAMIC_DB + bool + default y + +config BT_DEVICE_NAME_DYNAMIC + bool + default y + +config BT_DEVICE_NAME_MAX + int + default 15 + +config BT_MAX_CONN + int + default 1 + +config BT_L2CAP_TX_MTU + int + default 247 + +config BT_BUF_ACL_RX_SIZE + int + default 251 + +config BT_BUF_ACL_TX_SIZE + int + default 251 + +config BT_RX_STACK_SIZE + int + default 1120 + +# Enable NFC support + +config CHIP_NFC_COMMISSIONING + bool + default y + +config CHIP_OTA_REQUESTOR + bool + default y + +config CHIP_QSPI_NOR + bool + default y + +# Enable OpenThread + +config NET_L2_OPENTHREAD + bool + default y + +# Enable mbedTLS from nrf_security library + +choice OPENTHREAD_SECURITY + default OPENTHREAD_NRF_SECURITY_CHOICE +endchoice + +config CC3XX_BACKEND + bool + default n + +config OBERON_BACKEND + bool + default y + +config MBEDTLS_ENABLE_HEAP + bool + default y + +config MBEDTLS_HEAP_SIZE + int + default 15360 + +config MBEDTLS_TLS_LIBRARY + bool + default y + +config NRF_SECURITY_ADVANCED + bool + default y + +config MBEDTLS_AES_C + bool + default y + +config MBEDTLS_ECP_C + bool + default y + +config MBEDTLS_ECP_DP_SECP256R1_ENABLED + bool + default y + +config MBEDTLS_CTR_DRBG_C + bool + default y + +config MBEDTLS_CIPHER_MODE_CTR + bool + default y + +config MBEDTLS_ECJPAKE_C + bool + default y + +config MBEDTLS_SHA256_C + bool + default y + +config MBEDTLS_PK_C + bool + default y + +config MBEDTLS_PK_WRITE_C + bool + default y + +config MBEDTLS_X509_CREATE_C + bool + default y + +config MBEDTLS_X509_CSR_WRITE_C + bool + default y + +# Disable unneeded crypto operations + +config MBEDTLS_SHA384_C + bool + default n + +config MBEDTLS_SHA512_C + bool + default n + +config MBEDTLS_CIPHER_MODE_XTS + bool + default n + +config MBEDTLS_CHACHA20_C + bool + default n + +config MBEDTLS_POLY1305_C + bool + default n + +config MBEDTLS_CHACHAPOLY_C + bool + default n + +config MBEDTLS_GCM_C + bool + default n + +config MBEDTLS_RSA_C + bool + default n + +# Disable not used shell modules + +config SENSOR_SHELL + bool + default n + +config DEVICE_SHELL + bool + default n + +config DATE_SHELL + bool + default n + +config DEVMEM_SHELL + bool + default n + +config MCUBOOT_SHELL + bool + default n + +config CLOCK_CONTROL_NRF_SHELL + bool + default n + +config FLASH_SHELL + bool + default n + +endif diff --git a/config/nrfconnect/chip-module/Kconfig.features b/config/nrfconnect/chip-module/Kconfig.features new file mode 100644 index 00000000000000..07c0cc5c4759aa --- /dev/null +++ b/config/nrfconnect/chip-module/Kconfig.features @@ -0,0 +1,119 @@ +# +# Copyright (c) 2022 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. +# + +# The purpose of this file is to define Kconfig options enabling specific features. +# Feature options will define defaults for settings that are related to the specific feature. + +if CHIP + +config CHIP_QSPI_NOR + bool "Enable QSPI NOR feature set" + help + Enables QSPI NOR with the set of options + configuring pages and buffer sizes. + +if CHIP_QSPI_NOR + +config NORDIC_QSPI_NOR + bool + default y + +config NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE + int + default 16 + +endif # CHIP_QSPI_NOR + +config CHIP_DFU_OVER_BT_SMP + bool "Enable DFU over Bluetooth LE SMP feature set" + imply CHIP_QSPI_NOR + imply BOOTLOADER_MCUBOOT + help + Enables Device Firmware Upgrade over Bluetoot LE with SMP + and configures set of options related to that feature. + +if CHIP_DFU_OVER_BT_SMP + +# MCU Manager and SMP configuration +config MCUMGR + bool + default y + +config MCUMGR_CMD_IMG_MGMT + bool + default y + +config MCUMGR_CMD_OS_MGMT + bool + default y + +config MCUMGR_SMP_BT + bool + default y + +config MCUMGR_SMP_BT_AUTHEN + bool + default n + +config MCUMGR_BUF_COUNT + int + default 6 + +# Increase BT MTU and RX buffer for big size DFU messages +config BT_L2CAP_TX_MTU + int + default 498 + +config BT_BUF_ACL_RX_SIZE + int + default 502 + +# Increase MCUMGR_BUF_SIZE, as it must be big enough to fit MAX MTU + overhead and for single-image DFU default is 384 B +config MCUMGR_BUF_SIZE + int + default 1024 + +# Increase system workqueue size, as SMP is processed within it +config SYSTEM_WORKQUEUE_STACK_SIZE + int + default 2800 + +if SOC_SERIES_NRF53X + +config UPDATEABLE_IMAGE_NUMBER + int + default 2 + +# FLASH nop device is enabled to prevent bus faults when mcumgr tries to access +# simulated partition with network core image data. +config FLASH_NOP_DEVICE + bool + default y + +# Enable custom SMP request to erase settings partition. +config MCUMGR_GRP_ZEPHYR_BASIC + bool + default y + +config MCUMGR_GRP_BASIC_CMD_STORAGE_ERASE + bool + default y + +endif # SOC_SERIES_NRF53X + +endif # CHIP_DFU_OVER_BT_SMP + +endif # CHIP diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index 8152bd446cd7f7..9e32d1be87cabb 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -29,6 +29,7 @@ menuconfig CHIP imply NET_IPV6 imply NET_CONFIG_NEED_IPV6 imply NET_SOCKETS + imply NETWORKING help This option enables Connected Home over IP libraries. diff --git a/examples/all-clusters-app/nrfconnect/CMakeLists.txt b/examples/all-clusters-app/nrfconnect/CMakeLists.txt index ea6962845cdf1a..c510ede980d1a6 100644 --- a/examples/all-clusters-app/nrfconnect/CMakeLists.txt +++ b/examples/all-clusters-app/nrfconnect/CMakeLists.txt @@ -22,24 +22,10 @@ get_filename_component(ALL_CLUSTERS_COMMON_DIR ${CHIP_ROOT}/examples/all-cluster include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) -# Load NCS/Zephyr build system -set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf) +set(APPLICATION_CONFIG_DIR "configuration/\${BOARD}") -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf) - list(APPEND CONF_FILE boards/${BOARD}.conf) -endif() - -option(BUILD_WITH_DFU "Build target with Device Firmware Upgrade support" OFF) -if(BUILD_WITH_DFU) - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-mcuboot_qspi_nor_support.conf) - # Enable Matter OTA Requestor - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-ota_requestor.conf) - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_multi_image_dfu.conf CACHE INTERNAL "") - else() - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_single_image_dfu.conf CACHE INTERNAL "") - endif() - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static.yml) +if(NOT CONF_FILE STREQUAL "prj.conf") + set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) endif() list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module) diff --git a/examples/all-clusters-app/nrfconnect/Kconfig b/examples/all-clusters-app/nrfconnect/Kconfig index 4d6115b4b87e7c..176fd68f573c21 100644 --- a/examples/all-clusters-app/nrfconnect/Kconfig +++ b/examples/all-clusters-app/nrfconnect/Kconfig @@ -22,4 +22,6 @@ config STATE_LEDS Use LEDs to render the current state of the device such as the progress of commissioning of the device into a network or the factory reset initiation. +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" +rsource "../../../config/nrfconnect/chip-module/Kconfig.features" source "Kconfig.zephyr" diff --git a/examples/all-clusters-app/nrfconnect/README.md b/examples/all-clusters-app/nrfconnect/README.md index 2f994822b9966f..17373a70b04a7e 100644 --- a/examples/all-clusters-app/nrfconnect/README.md +++ b/examples/all-clusters-app/nrfconnect/README.md @@ -35,6 +35,7 @@ into an existing Matter network and can be controlled by this network. - [Building with low-power configuration](#building-with-low-power-configuration) - [Building with Device Firmware Upgrade support](#building-with-device-firmware-upgrade-support) - [Configuring the example](#configuring-the-example) + - [Example build types](#example-build-types) - [Flashing and debugging](#flashing-and-debugging) - [Testing the example](#testing-the-example) - [Testing using CHIPTool](#testing-using-chiptool) @@ -278,7 +279,7 @@ following command: To build the example with release configuration that disables the diagnostic features like logs and command-line interface, run the following command: - $ west build -b build-target -- -DOVERLAY_CONFIG=third_party/connectedhomeip/config/nrfconnect/app/release.conf + $ west build -b build-target -- -DCONF_FILE=prj_release.conf Remember to replace _build-target_ with the build target name of the Nordic Semiconductor's kit you own. @@ -293,11 +294,11 @@ To build for the low-power configuration, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor's kit you own (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DOVERLAY_CONFIG=overlay-low_power.conf + $ west build -b build-target -- -DOVERLAY_CONFIG=../../overlay-low_power.conf For example, use the following command for `nrf52840dk_nrf52840`: - $ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=overlay-low_power.conf + $ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=../../overlay-low_power.conf ### Building with Device Firmware Upgrade support @@ -307,7 +308,7 @@ To build the example with configuration that supports DFU, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=1 + $ west build -b build-target -- -DCONF_FILE=prj_dfu.conf > **Note**: > @@ -320,25 +321,13 @@ Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): > > Currently the multi-image mode is not available for the Matter OTA DFU. -#### Changing Device Firmware Upgrade configuration - -To change the default DFU configuration, edit the following overlay files -corresponding to the selected configuration: - -- `overlay-mcuboot_qspi_nor_support.conf` - general file enabling MCUboot and - QSPI NOR support, used by all DFU configurations -- `overlay-ota_requestor.conf` - file enabling Matter OTA Requestor support. - -The files are located in the `config/nrfconnect/app` directory. You can also -define the desired options in your example's `prj.conf` file. - #### Changing bootloader configuration -To change the default MCUboot configuration, edit the -`mcuboot_single_image_dfu.conf` or `mcuboot_multi_image_dfu.conf` overlay files -depending on whether the build target device supports multi-image DFU (nRF5340 -DK) or single-image DFU (nRF52840 DK). The files are located in the -`configuration` directory. +To change the default MCUboot configuration, edit the `mcuboot.conf` or +`mcuboot_release.conf` overlay files depending on whether you build the target +with debug or release configuration. The files are located in the +`configuration/build-target/child_image` directory (_build-target_ is your board +name, for example `nrf52840dk_nrf52840`). #### Changing flash memory settings @@ -350,7 +339,7 @@ purposes. You can change these settings by defining This example uses this option to define using an external flash. To modify the flash settings of your board (that is, your _build-target_, for -example `nrf52840dk_nrf52840`), edit the `pm_static.yml` file located in the +example `nrf52840dk_nrf52840`), edit the `pm_static_dfu.yml` file located in the `configuration/build-target/` directory.
@@ -372,6 +361,33 @@ Semiconductor's kit you own. Changes done with menuconfig will be lost if the `build` directory is deleted. To make them persistent, save the configuration options in the `prj.conf` file. + +### Example build types + +The example uses different configuration files depending on the supported +features. Configuration files are provided for different build types and they +are located in the `configuration/build-target` directory. + +The `prj.conf` file represents a debug build type. Other build types are covered +by dedicated files with the build type added as a suffix to the prj part, as per +the following list. For example, the release build type file name is +`prj_release.conf`. If a board has other configuration files, for example +associated with partition layout or child image configuration, these follow the +same pattern. + +Before you start testing the application, you can select one of the build types +supported by the sample. This sample supports the following build types, +depending on the selected board: + +- debug -- Debug version of the application - can be used to enable additional + features for verifying the application behavior, such as logs or + command-line shell. +- release -- Release version of the application - can be used to enable only + the necessary application functionalities to optimize its performance. It + has Device Firmware Upgrade feature enabled. +- dfu -- Debug version of the application with Device Firmware Upgrade feature + support. + For more information, see the [Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) page. diff --git a/examples/light-switch-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_dfu.conf similarity index 100% rename from examples/light-switch-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf rename to examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_dfu.conf diff --git a/examples/lock-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf similarity index 96% rename from examples/lock-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf rename to examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf index 4bd385555cf1b4..56e61619aef7d4 100644 --- a/examples/lock-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. @@ -23,7 +23,6 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256 # bootloader size optimization CONFIG_LOG=n -CONFIG_GPIO=n CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n @@ -35,4 +34,5 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/all-clusters-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay similarity index 100% rename from examples/all-clusters-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay rename to examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay diff --git a/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml similarity index 100% rename from examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml rename to examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml diff --git a/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf new file mode 100644 index 00000000000000..72f6e361408329 --- /dev/null +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf @@ -0,0 +1,54 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread settings +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="AllClusters" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# Disable OTA requestor +CONFIG_CHIP_OTA_REQUESTOR=n + +# Disable QSPI NOR +CONFIG_CHIP_QSPI_NOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" + +# CHIP PID: 32769 == 0x8001 (all-clusters-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32769 diff --git a/examples/all-clusters-app/nrfconnect/prj.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_dfu.conf similarity index 74% rename from examples/all-clusters-app/nrfconnect/prj.conf rename to examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_dfu.conf index d3ba4fab874572..20307204e67a09 100644 --- a/examples/all-clusters-app/nrfconnect/prj.conf +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_dfu.conf @@ -14,25 +14,32 @@ # limitations under the License. # -# This sample uses sample-defaults.conf to set options common for all +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all # samples. This file should contain only options specific for this sample # or overrides of default values. # Add support for LEDs and buttons on Nordic development kits CONFIG_DK_LIBRARY=y -# Default OpenThread network settings -CONFIG_OPENTHREAD_PANID=4660 -CONFIG_OPENTHREAD_CHANNEL=15 -CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" -CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" +# OpenThread settings +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n # Bluetooth overrides CONFIG_BT_DEVICE_NAME="AllClusters" +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + # Additional configs for debbugging experience. CONFIG_THREAD_NAME=y CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n # CHIP configuration CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" diff --git a/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf new file mode 100644 index 00000000000000..c0213673d3351f --- /dev/null +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf @@ -0,0 +1,58 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread settings +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="AllClusters" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" + +# CHIP PID: 32769 == 0x8001 (all-clusters-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32769 + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/lock-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_dfu.conf similarity index 97% rename from examples/lock-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf rename to examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_dfu.conf index 4daff546711a62..bdfc87a648561b 100644 --- a/examples/lock-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_dfu.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. @@ -37,7 +37,6 @@ CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y # bootloader size optimization CONFIG_LOG=n -CONFIG_GPIO=n CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n @@ -49,4 +48,5 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf similarity index 97% rename from examples/pump-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf rename to examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf index 4daff546711a62..bdfc87a648561b 100644 --- a/examples/pump-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. @@ -37,7 +37,6 @@ CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y # bootloader size optimization CONFIG_LOG=n -CONFIG_GPIO=n CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n @@ -49,4 +48,5 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/all-clusters-app/nrfconnect/child_image/multiprotocol_rpmsg.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf similarity index 100% rename from examples/all-clusters-app/nrfconnect/child_image/multiprotocol_rpmsg.conf rename to examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf diff --git a/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_dfu.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_dfu.conf new file mode 100644 index 00000000000000..b22013c122cf4d --- /dev/null +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_dfu.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=n +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf new file mode 100644 index 00000000000000..b22013c122cf4d --- /dev/null +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=n +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/all-clusters-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay similarity index 100% rename from examples/all-clusters-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay rename to examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml similarity index 100% rename from examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml rename to examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml diff --git a/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf new file mode 100644 index 00000000000000..bdda00f7666098 --- /dev/null +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf @@ -0,0 +1,55 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread settings +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="AllClusters" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# Disable OTA requestor +CONFIG_CHIP_OTA_REQUESTOR=n + +# Disable QSPI NOR +CONFIG_CHIP_QSPI_NOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" + +# CHIP PID: 32769 == 0x8001 (all-clusters-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32769 diff --git a/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_dfu.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_dfu.conf new file mode 100644 index 00000000000000..963970ac3628d8 --- /dev/null +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_dfu.conf @@ -0,0 +1,49 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread settings +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="AllClusters" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" + +# CHIP PID: 32769 == 0x8001 (all-clusters-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32769 diff --git a/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf new file mode 100644 index 00000000000000..f7c960e45346eb --- /dev/null +++ b/examples/all-clusters-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf @@ -0,0 +1,59 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread settings +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="AllClusters" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" + +# CHIP PID: 32769 == 0x8001 (all-clusters-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32769 + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/light-switch-app/nrfconnect/CMakeLists.txt b/examples/light-switch-app/nrfconnect/CMakeLists.txt index 3610cbfc72b526..34a11d0db8e0f2 100644 --- a/examples/light-switch-app/nrfconnect/CMakeLists.txt +++ b/examples/light-switch-app/nrfconnect/CMakeLists.txt @@ -22,37 +22,10 @@ get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) -# Load NCS/Zephyr build system -set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf) +set(APPLICATION_CONFIG_DIR "configuration/\${BOARD}") -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf) - list(APPEND CONF_FILE boards/${BOARD}.conf) -endif() - -set(BUILD_WITH_DFU "MATTER" CACHE STRING "Build target with Device Firmware Upgrade support") - -if(NOT BUILD_WITH_DFU STREQUAL "OFF") - if(BUILD_WITH_DFU STREQUAL "BLE") - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-multi_image_smp_dfu_support.conf) - else() - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-single_image_smp_dfu_support.conf) - endif() - elseif(NOT BUILD_WITH_DFU STREQUAL "MATTER") - message(FATAL_ERROR "Selected invalid BUILD_WITH_DFU value: ${BUILD_WITH_DFU}") - endif() - - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-mcuboot_qspi_nor_support.conf) - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-ota_requestor.conf) - - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - # DFU over Matter doesn't support multi-image update yet, but using this configs should not harm it anyway. - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_multi_image_dfu.conf CACHE INTERNAL "") - else() - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_single_image_dfu.conf CACHE INTERNAL "") - endif() - - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static.yml) +if(NOT CONF_FILE STREQUAL "prj_no_dfu.conf") + set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) endif() list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module) @@ -93,7 +66,7 @@ if(CONFIG_CHIP_OTA_REQUESTOR) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/OTAUtil.cpp) endif() -if(BUILD_WITH_DFU STREQUAL "BLE") +if(CONFIG_MCUMGR_SMP_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/light-switch-app/nrfconnect/Kconfig b/examples/light-switch-app/nrfconnect/Kconfig index 9bee833c7681de..59e94a75c47b31 100644 --- a/examples/light-switch-app/nrfconnect/Kconfig +++ b/examples/light-switch-app/nrfconnect/Kconfig @@ -23,4 +23,6 @@ config STATE_LEDS the device into a network or the factory reset initiation. Note that setting this option to 'n' does not disable the LED indicating the state of the simulated bolt. +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" +rsource "../../../config/nrfconnect/chip-module/Kconfig.features" source "Kconfig.zephyr" diff --git a/examples/light-switch-app/nrfconnect/README.md b/examples/light-switch-app/nrfconnect/README.md index a11642be5d72a6..6d518a95c7bb4d 100644 --- a/examples/light-switch-app/nrfconnect/README.md +++ b/examples/light-switch-app/nrfconnect/README.md @@ -42,6 +42,7 @@ into an existing Matter network and can be controlled by this network. - [Building with low-power configuration](#building-with-low-power-configuration) - [Building with Device Firmware Upgrade support](#building-with-device-firmware-upgrade-support) - [Configuring the example](#configuring-the-example) + - [Example build types](#example-build-types) - [Flashing and debugging](#flashing-and-debugging) - [Testing the example](#testing-the-example) - [Binding process](#binding-process) @@ -446,7 +447,7 @@ following command: To build the example with release configuration that disables the diagnostic features like logs and command-line interface, run the following command: - $ west build -b build-target -- -DOVERLAY_CONFIG=third_party/connectedhomeip/config/nrfconnect/app/release.conf + $ west build -b build-target -- -DCONF_FILE=prj_release.conf Remember to replace _build-target_ with the build target name of the Nordic Semiconductor's kit you own. @@ -461,11 +462,11 @@ To build for the low-power configuration, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor's kit you own (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DOVERLAY_CONFIG=overlay-low_power.conf + $ west build -b build-target -- -DOVERLAY_CONFIG=../../overlay-low_power.conf For example, use the following command for `nrf52840dk_nrf52840`: - $ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=overlay-low_power.conf + $ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=../../overlay-low_power.conf ### Building with Device Firmware Upgrade support @@ -475,13 +476,13 @@ To enable DFU over Bluetooth LE, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=BLE + $ west build -b build-target -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y To completely disable support for both DFU methods, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=OFF + $ west build -b build-target -- -DCONF_FILE=prj_no_dfu.conf > **Note**: > @@ -492,29 +493,13 @@ Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): > upgrading the application core and network core firmware in two-core nRF5340 > DK devices. -#### Changing Device Firmware Upgrade configuration - -To change the default DFU configuration, edit the following overlay files -corresponding to the selected configuration: - -- `overlay-mcuboot_qspi_nor_support.conf` - general file enabling MCUboot and - QSPI NOR support, used by all DFU configurations -- `overlay-single_image_smp_dfu_support.conf` - file enabling single-image DFU - over Bluetooth LE using SMP -- `overlay-multi_image_smp_dfu_support.conf` - file enabling multi-image DFU - over Bluetooth LE using SMP -- `overlay-ota_requestor.conf` - file enabling Matter OTA Requestor support. - -The files are located in the `config/nrfconnect/app` directory. You can also -define the desired options in your example's `prj.conf` file. - #### Changing bootloader configuration -To change the default MCUboot configuration, edit the -`mcuboot_single_image_dfu.conf` or `mcuboot_multi_image_dfu.conf` overlay files -depending on whether the build target device supports multi-image DFU (nRF5340 -DK) or single-image DFU (nRF52840 DK). The files are located in the -`configuration` directory. +To change the default MCUboot configuration, edit the `mcuboot.conf` or +`mcuboot_release.conf` overlay files depending on whether you build the target +with debug or release configuration. The files are located in the +`configuration/build-target/child_image` directory (_build-target_ is your board +name, for example `nrf52840dk_nrf52840`). Make sure to keep the configuration consistent with changes made to the application configuration. This is necessary for the configuration to work, as @@ -531,7 +516,7 @@ purposes. You can change these settings by defining This example uses this option to define using an external flash. To modify the flash settings of your board (that is, your _build-target_, for -example `nrf52840dk_nrf52840`), edit the `pm_static.yml` file located in the +example `nrf52840dk_nrf52840`), edit the `pm_static_dfu.yml` file located in the `configuration/build-target/` directory.
@@ -553,6 +538,33 @@ Semiconductor's kit you own. Changes done with menuconfig will be lost if the `build` directory is deleted. To make them persistent, save the configuration options in the `prj.conf` file. + +### Example build types + +The example uses different configuration files depending on the supported +features. Configuration files are provided for different build types and they +are located in the `configuration/build-target` directory. + +The `prj.conf` file represents a debug build type. Other build types are covered +by dedicated files with the build type added as a suffix to the prj part, as per +the following list. For example, the release build type file name is +`prj_release.conf`. If a board has other configuration files, for example +associated with partition layout or child image configuration, these follow the +same pattern. + +Before you start testing the application, you can select one of the build types +supported by the sample. This sample supports the following build types, +depending on the selected board: + +- debug -- Debug version of the application - can be used to enable additional + features for verifying the application behavior, such as logs or + command-line shell. +- release -- Release version of the application - can be used to enable only + the necessary application functionalities to optimize its performance. +- no_dfu -- Debug version of the application without Device Firmware Upgrade + feature support - can be used only for the nRF52840 DK and nRF5340 DK, as + those platforms have DFU enabled by default. + For more information, see the [Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) page. diff --git a/examples/light-switch-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf b/examples/light-switch-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf deleted file mode 100644 index 2c4579fd928b52..00000000000000 --- a/examples/light-switch-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright (c) 2022 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. -# - -# QSPI configuration -CONFIG_NORDIC_QSPI_NOR=y -CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 -CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 - -CONFIG_BOOT_MAX_IMG_SECTORS=256 - -# The following configurations are required to support simultaneous multi image update -CONFIG_PCD_APP=y -CONFIG_UPDATEABLE_IMAGE_NUMBER=2 -CONFIG_BOOT_UPGRADE_ONLY=y -# The network core cannot access external flash directly. The flash simulator must be used to -# provide a memory region that is used to forward the new firmware to the network core. -CONFIG_FLASH_SIMULATOR=y -CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y -CONFIG_FLASH_SIMULATOR_STATS=n - -# bootloader size optimization -CONFIG_LOG=n -CONFIG_CONSOLE=n -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_CONSOLE_HANDLER=n -CONFIG_BOOT_BANNER=n -CONFIG_TIMESLICING=n -CONFIG_RESET_ON_FATAL_ERROR=n -CONFIG_MULTITHREADING=n -CONFIG_TICKLESS_KERNEL=n -CONFIG_TIMEOUT_64BIT=n -CONFIG_USE_SEGGER_RTT=n -CONFIG_GPIO=n -CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/all-clusters-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf similarity index 96% rename from examples/all-clusters-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf rename to examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf index 807ba68b805796..d20c6c4440ed23 100644 --- a/examples/all-clusters-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf +++ b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. @@ -23,6 +23,7 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256 # bootloader size optimization CONFIG_LOG=n +CONFIG_GPIO=n CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n @@ -34,5 +35,4 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_USE_SEGGER_RTT=n -CONFIG_GPIO=n CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/lighting-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf similarity index 96% rename from examples/lighting-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf rename to examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf index 807ba68b805796..d20c6c4440ed23 100644 --- a/examples/lighting-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf +++ b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. @@ -23,6 +23,7 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256 # bootloader size optimization CONFIG_LOG=n +CONFIG_GPIO=n CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n @@ -34,5 +35,4 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_USE_SEGGER_RTT=n -CONFIG_GPIO=n CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/light-switch-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay similarity index 100% rename from examples/light-switch-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay rename to examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay diff --git a/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml similarity index 100% rename from examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml rename to examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml diff --git a/examples/light-switch-app/nrfconnect/prj.conf b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf similarity index 82% rename from examples/light-switch-app/nrfconnect/prj.conf rename to examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf index e40660a99c276f..d23877fbb435e0 100644 --- a/examples/light-switch-app/nrfconnect/prj.conf +++ b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf @@ -14,7 +14,10 @@ # limitations under the License. # -# This sample uses sample-defaults.conf to set options common for all +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all # samples. This file should contain only options specific for this sample # or overrides of default values. @@ -22,6 +25,7 @@ CONFIG_DK_LIBRARY=y # OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n @@ -29,9 +33,13 @@ CONFIG_OPENTHREAD_FTD=n # Bluetooth overrides CONFIG_BT_DEVICE_NAME="MatterSwitch" +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + # Additional configs for debbugging experience. CONFIG_THREAD_NAME=y CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n # CHIP configuration CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" diff --git a/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf new file mode 100644 index 00000000000000..1fd43276105c75 --- /dev/null +++ b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf @@ -0,0 +1,50 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterSwitch" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32772 == 0x8004 (example light-switch-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32772 diff --git a/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf new file mode 100644 index 00000000000000..fcdadb8bcf8a2a --- /dev/null +++ b/examples/light-switch-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf @@ -0,0 +1,57 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterSwitch" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32772 == 0x8004 (example light-switch-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32772 + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/all-clusters-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf similarity index 97% rename from examples/all-clusters-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf rename to examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf index ccc69439f449f0..df25649250f4cb 100644 --- a/examples/all-clusters-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf +++ b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. @@ -37,6 +37,7 @@ CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y # bootloader size optimization CONFIG_LOG=n +CONFIG_GPIO=n CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n @@ -48,5 +49,4 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_USE_SEGGER_RTT=n -CONFIG_GPIO=n CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/lighting-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf similarity index 97% rename from examples/lighting-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf rename to examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf index ccc69439f449f0..df25649250f4cb 100644 --- a/examples/lighting-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf +++ b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. @@ -37,6 +37,7 @@ CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y # bootloader size optimization CONFIG_LOG=n +CONFIG_GPIO=n CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n @@ -48,5 +49,4 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_USE_SEGGER_RTT=n -CONFIG_GPIO=n CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-app/nrfconnect/child_image/multiprotocol_rpmsg.conf b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf similarity index 94% rename from examples/pump-app/nrfconnect/child_image/multiprotocol_rpmsg.conf rename to examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf index 329d787b50feab..b22013c122cf4d 100644 --- a/examples/pump-app/nrfconnect/child_image/multiprotocol_rpmsg.conf +++ b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. diff --git a/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf new file mode 100644 index 00000000000000..b22013c122cf4d --- /dev/null +++ b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=n +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/light-switch-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay similarity index 100% rename from examples/light-switch-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay rename to examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml similarity index 100% rename from examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml rename to examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml diff --git a/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf new file mode 100644 index 00000000000000..2ee2d8135124ef --- /dev/null +++ b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf @@ -0,0 +1,48 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterSwitch" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32772 == 0x8004 (example light-switch-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32772 diff --git a/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf new file mode 100644 index 00000000000000..e274c61d96854c --- /dev/null +++ b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf @@ -0,0 +1,51 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterSwitch" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32772 == 0x8004 (example light-switch-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32772 diff --git a/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf new file mode 100644 index 00000000000000..44fdcf67f39bb1 --- /dev/null +++ b/examples/light-switch-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf @@ -0,0 +1,58 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterSwitch" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32772 == 0x8004 (example light-switch-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32772 + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index c3a87f4b99ced2..fd6140dc915a60 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -22,42 +22,10 @@ get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) -# Load NCS/Zephyr build system -set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf) +set(APPLICATION_CONFIG_DIR "configuration/\${BOARD}") -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf) - list(APPEND CONF_FILE boards/${BOARD}.conf) -endif() - -if(NOT BOARD STREQUAL "nrf52840dongle_nrf52840") - set(BUILD_WITH_DFU "MATTER" CACHE STRING "Build target with Device Firmware Upgrade support") -else() - set(BUILD_WITH_DFU "OFF" CACHE STRING "Build target with Device Firmware Upgrade support") -endif() - -if(NOT BUILD_WITH_DFU STREQUAL "OFF") - if(BUILD_WITH_DFU STREQUAL "BLE") - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-multi_image_smp_dfu_support.conf) - else() - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-single_image_smp_dfu_support.conf) - endif() - elseif(NOT BUILD_WITH_DFU STREQUAL "MATTER") - message(FATAL_ERROR "Selected invalid BUILD_WITH_DFU value: ${BUILD_WITH_DFU}") - endif() - - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-mcuboot_qspi_nor_support.conf) - # Enable Matter OTA Requestor - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-ota_requestor.conf) - - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - # DFU over Matter doesn't support multi-image update yet, but using this configs should not harm it anyway. - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_multi_image_dfu.conf CACHE INTERNAL "") - else() - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_single_image_dfu.conf CACHE INTERNAL "") - endif() - - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static.yml) +if(NOT CONF_FILE STREQUAL "prj_no_dfu.conf") + set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) endif() list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module) @@ -104,7 +72,7 @@ if(CONFIG_CHIP_OTA_REQUESTOR) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/OTAUtil.cpp) endif() -if(BUILD_WITH_DFU STREQUAL "BLE") +if(CONFIG_MCUMGR_SMP_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/light-switch-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf b/examples/lighting-app/nrfconnect/Kconfig similarity index 74% rename from examples/light-switch-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf rename to examples/lighting-app/nrfconnect/Kconfig index ce2e61edce82ca..d862fc1d2ace52 100644 --- a/examples/light-switch-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/examples/lighting-app/nrfconnect/Kconfig @@ -13,5 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +mainmenu "Matter nRF Connect Lighting Example Application" -CONFIG_XOROSHIRO_RANDOM_GENERATOR=y +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" +rsource "../../../config/nrfconnect/chip-module/Kconfig.features" +source "Kconfig.zephyr" diff --git a/examples/lighting-app/nrfconnect/README.md b/examples/lighting-app/nrfconnect/README.md index ac041d994de9c5..d0867c5785c369 100644 --- a/examples/lighting-app/nrfconnect/README.md +++ b/examples/lighting-app/nrfconnect/README.md @@ -36,6 +36,7 @@ into an existing Matter network and can be controlled by this network. - [Building with Pigweed RPCs](#building-with-pigweed-rpcs) - [Building with Device Firmware Upgrade support](#building-with-device-firmware-upgrade-support) - [Configuring the example](#configuring-the-example) + - [Example build types](#example-build-types) - [Flashing and debugging](#flashing-and-debugging) - [Flashing on the development kits](#nrfdks_flashing) - [Flashing on the nRF52840 Dongle](#nrf52840dongle_flashing) @@ -391,7 +392,7 @@ following command: To build the example with release configuration that disables the diagnostic features like logs and command-line interface, run the following command: - $ west build -b build-target -- -DOVERLAY_CONFIG=third_party/connectedhomeip/config/nrfconnect/app/release.conf + $ west build -b build-target -- -DCONF_FILE=prj_release.conf Remember to replace _build-target_ with the build target name of the Nordic Semiconductor's kit you own. @@ -404,7 +405,7 @@ host computer. To build the example with the RPC server, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor's kit you own: - $ west build -b build-target -- -DOVERLAY_CONFIG=rpc.overlay + $ west build -b build-target -- -DOVERLAY_CONFIG=../../rpc.overlay ### Building with Device Firmware Upgrade support @@ -414,13 +415,13 @@ To enable DFU over Bluetooth LE, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=BLE + $ west build -b build-target -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y To completely disable support for both DFU methods, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=OFF + $ west build -b build-target -- -DCONF_FILE=prj_no_dfu.conf > **Note**: > @@ -434,29 +435,13 @@ Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): > Currently the multi-image mode is only available for the DFU over Bluetooth LE > method. -#### Changing Device Firmware Upgrade configuration - -To change the default DFU configuration, edit the following overlay files -corresponding to the selected configuration: - -- `overlay-mcuboot_qspi_nor_support.conf` - general file enabling MCUboot and - QSPI NOR support, used by all DFU configurations -- `overlay-single_image_smp_dfu_support.conf` - file enabling single-image DFU - over Bluetooth LE using SMP -- `overlay-multi_image_smp_dfu_support.conf` - file enabling multi-image DFU - over Bluetooth LE using SMP -- `overlay-ota_requestor.conf` - file enabling Matter OTA Requestor support. - -The files are located in the `config/nrfconnect/app` directory. You can also -define the desired options in your example's `prj.conf` file. - #### Changing bootloader configuration -To change the default MCUboot configuration, edit the -`mcuboot_single_image_dfu.conf` or `mcuboot_multi_image_dfu.conf` overlay files -depending on whether the build target device supports multi-image DFU (nRF5340 -DK) or single-image DFU (nRF52840 DK). The files are located in the -`configuration` directory. +To change the default MCUboot configuration, edit the `mcuboot.conf` or +`mcuboot_release.conf` overlay files depending on whether you build the target +with debug or release configuration. The files are located in the +`configuration/build-target/child_image` directory (_build-target_ is your board +name, for example `nrf52840dk_nrf52840`). Make sure to keep the configuration consistent with changes made to the application configuration. This is necessary for the configuration to work, as @@ -473,7 +458,7 @@ purposes. You can change these settings by defining This example uses this option to define using an external flash. To modify the flash settings of your board (that is, your _build-target_, for -example `nrf52840dk_nrf52840`), edit the `pm_static.yml` file located in the +example `nrf52840dk_nrf52840`), edit the `pm_static_dfu.yml` file located in the `configuration/build-target/` directory.
@@ -495,6 +480,33 @@ Semiconductor's kit you own. Changes done with menuconfig will be lost if the `build` directory is deleted. To make them persistent, save the configuration options in the `prj.conf` file. + +### Example build types + +The example uses different configuration files depending on the supported +features. Configuration files are provided for different build types and they +are located in the `configuration/build-target` directory. + +The `prj.conf` file represents a debug build type. Other build types are covered +by dedicated files with the build type added as a suffix to the prj part, as per +the following list. For example, the release build type file name is +`prj_release.conf`. If a board has other configuration files, for example +associated with partition layout or child image configuration, these follow the +same pattern. + +Before you start testing the application, you can select one of the build types +supported by the sample. This sample supports the following build types, +depending on the selected board: + +- debug -- Debug version of the application - can be used to enable additional + features for verifying the application behavior, such as logs or + command-line shell. +- release -- Release version of the application - can be used to enable only + the necessary application functionalities to optimize its performance. +- no_dfu -- Debug version of the application without Device Firmware Upgrade + feature support - can be used only for the nRF52840 DK and nRF5340 DK, as + those platforms have DFU enabled by default. + For more information, see the [Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) page. diff --git a/examples/lighting-app/nrfconnect/boards/nrf52840dk_nrf52840.conf b/examples/lighting-app/nrfconnect/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index 0b169c5894fab9..00000000000000 --- a/examples/lighting-app/nrfconnect/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf b/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index 5816e439e81409..00000000000000 --- a/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -CONFIG_XOROSHIRO_RANDOM_GENERATOR=y - diff --git a/examples/pump-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf similarity index 96% rename from examples/pump-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf rename to examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf index 4bd385555cf1b4..56e61619aef7d4 100644 --- a/examples/pump-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf +++ b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. @@ -23,7 +23,6 @@ CONFIG_BOOT_MAX_IMG_SECTORS=256 # bootloader size optimization CONFIG_LOG=n -CONFIG_GPIO=n CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n @@ -35,4 +34,5 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf new file mode 100644 index 00000000000000..56e61619aef7d4 --- /dev/null +++ b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf @@ -0,0 +1,38 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/lighting-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay similarity index 100% rename from examples/lighting-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay rename to examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay diff --git a/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml similarity index 100% rename from examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml rename to examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml diff --git a/examples/lighting-app/nrfconnect/prj.conf b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf similarity index 83% rename from examples/lighting-app/nrfconnect/prj.conf rename to examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf index 9851733db5f347..91b2bd5a9d6d73 100644 --- a/examples/lighting-app/nrfconnect/prj.conf +++ b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2022 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. @@ -14,7 +14,10 @@ # limitations under the License. # -# This sample uses sample-defaults.conf to set options common for all +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all # samples. This file should contain only options specific for this sample # or overrides of default values. @@ -23,6 +26,7 @@ CONFIG_DK_LIBRARY=y CONFIG_PWM=y # OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y # Default OpenThread network settings @@ -34,6 +38,9 @@ CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" # Bluetooth overrides CONFIG_BT_DEVICE_NAME="MatterLight" +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + # Additional configs for debbugging experience. CONFIG_THREAD_NAME=y CONFIG_MPU_STACK_GUARD=y diff --git a/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf new file mode 100644 index 00000000000000..1cfe7c418f7e99 --- /dev/null +++ b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf @@ -0,0 +1,58 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y +CONFIG_PWM=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLight" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32773 == 0x8005 (example lighting-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32773 + +# Enable CHIP pairing automatically on application start. +CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y diff --git a/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf new file mode 100644 index 00000000000000..d6bb5a6b295291 --- /dev/null +++ b/examples/lighting-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf @@ -0,0 +1,65 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y +CONFIG_PWM=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLight" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32773 == 0x8005 (example lighting-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32773 + +# Enable CHIP pairing automatically on application start. +CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/lighting-app/nrfconnect/boards/nrf52840dongle_nrf52840.overlay b/examples/lighting-app/nrfconnect/configuration/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.overlay similarity index 100% rename from examples/lighting-app/nrfconnect/boards/nrf52840dongle_nrf52840.overlay rename to examples/lighting-app/nrfconnect/configuration/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.overlay diff --git a/examples/lighting-app/nrfconnect/boards/nrf52840dongle_nrf52840.conf b/examples/lighting-app/nrfconnect/configuration/nrf52840dongle_nrf52840/prj.conf similarity index 52% rename from examples/lighting-app/nrfconnect/boards/nrf52840dongle_nrf52840.conf rename to examples/lighting-app/nrfconnect/configuration/nrf52840dongle_nrf52840/prj.conf index eedaf10f20db02..eef3ed8514e864 100644 --- a/examples/lighting-app/nrfconnect/boards/nrf52840dongle_nrf52840.conf +++ b/examples/lighting-app/nrfconnect/configuration/nrf52840dongle_nrf52840/prj.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. @@ -14,6 +14,40 @@ # limitations under the License. # +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y +CONFIG_PWM=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLight" + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32773 == 0x8005 (example lighting-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32773 + # Make sure the pairing window starts automatically upon startup as the nRF52840 Dongle # has only one button and it is reserved for the factory reset CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y @@ -31,3 +65,9 @@ CONFIG_LOG_STRDUP_MAX_STRING=128 CONFIG_LOG_STRDUP_BUF_COUNT=24 CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Disable OTA requestor +CONFIG_CHIP_OTA_REQUESTOR=n + +# Disable QSPI NOR +CONFIG_CHIP_QSPI_NOR=n diff --git a/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf new file mode 100644 index 00000000000000..bdfc87a648561b --- /dev/null +++ b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf @@ -0,0 +1,52 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# The following configurations are required to support simultaneous multi image update +CONFIG_PCD_APP=y +CONFIG_UPDATEABLE_IMAGE_NUMBER=2 +CONFIG_BOOT_UPGRADE_ONLY=y +# The network core cannot access external flash directly. The flash simulator must be used to +# provide a memory region that is used to forward the new firmware to the network core. +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y +CONFIG_FLASH_SIMULATOR_STATS=n + +# Enable custom command to erase settings partition. +CONFIG_ENABLE_MGMT_PERUSER=y +CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf new file mode 100644 index 00000000000000..bdfc87a648561b --- /dev/null +++ b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf @@ -0,0 +1,52 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# The following configurations are required to support simultaneous multi image update +CONFIG_PCD_APP=y +CONFIG_UPDATEABLE_IMAGE_NUMBER=2 +CONFIG_BOOT_UPGRADE_ONLY=y +# The network core cannot access external flash directly. The flash simulator must be used to +# provide a memory region that is used to forward the new firmware to the network core. +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y +CONFIG_FLASH_SIMULATOR_STATS=n + +# Enable custom command to erase settings partition. +CONFIG_ENABLE_MGMT_PERUSER=y +CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/light-switch-app/nrfconnect/child_image/multiprotocol_rpmsg.conf b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf similarity index 94% rename from examples/light-switch-app/nrfconnect/child_image/multiprotocol_rpmsg.conf rename to examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf index 329d787b50feab..b22013c122cf4d 100644 --- a/examples/light-switch-app/nrfconnect/child_image/multiprotocol_rpmsg.conf +++ b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. diff --git a/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf new file mode 100644 index 00000000000000..b22013c122cf4d --- /dev/null +++ b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=n +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay similarity index 100% rename from examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay rename to examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml similarity index 100% rename from examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml rename to examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml diff --git a/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf new file mode 100644 index 00000000000000..a3a49193dd2251 --- /dev/null +++ b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf @@ -0,0 +1,56 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y +CONFIG_PWM=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLight" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32773 == 0x8005 (example lighting-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32773 + +# Enable CHIP pairing automatically on application start. +CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y diff --git a/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf new file mode 100644 index 00000000000000..7c81ac23985a79 --- /dev/null +++ b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf @@ -0,0 +1,59 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y +CONFIG_PWM=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLight" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32773 == 0x8005 (example lighting-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32773 + +# Enable CHIP pairing automatically on application start. +CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y diff --git a/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf new file mode 100644 index 00000000000000..37f3cac417dd5d --- /dev/null +++ b/examples/lighting-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf @@ -0,0 +1,66 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y +CONFIG_PWM=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLight" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32773 == 0x8005 (example lighting-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32773 + +# Enable CHIP pairing automatically on application start. +CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/lock-app/nrfconnect/CMakeLists.txt b/examples/lock-app/nrfconnect/CMakeLists.txt index 9c813ca962a5c4..08abe0e7a86ed3 100644 --- a/examples/lock-app/nrfconnect/CMakeLists.txt +++ b/examples/lock-app/nrfconnect/CMakeLists.txt @@ -21,37 +21,10 @@ get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) -# Load NCS/Zephyr build system -set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf) +set(APPLICATION_CONFIG_DIR "configuration/\${BOARD}") -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf) - list(APPEND CONF_FILE boards/${BOARD}.conf) -endif() - -set(BUILD_WITH_DFU "MATTER" CACHE STRING "Build target with Device Firmware Upgrade support") - -if(NOT BUILD_WITH_DFU STREQUAL "OFF") - if(BUILD_WITH_DFU STREQUAL "BLE") - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-multi_image_smp_dfu_support.conf) - else() - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-single_image_smp_dfu_support.conf) - endif() - elseif(NOT BUILD_WITH_DFU STREQUAL "MATTER") - message(FATAL_ERROR "Selected invalid BUILD_WITH_DFU value: ${BUILD_WITH_DFU}") - endif() - - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-mcuboot_qspi_nor_support.conf) - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-ota_requestor.conf) - - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - # DFU over Matter doesn't support multi-image update yet, but using this configs should not harm it anyway. - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_multi_image_dfu.conf CACHE INTERNAL "") - else() - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_single_image_dfu.conf CACHE INTERNAL "") - endif() - - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static.yml) +if(NOT CONF_FILE STREQUAL "prj_no_dfu.conf") + set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) endif() list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module) @@ -95,6 +68,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/OTAUtil.cpp) endif() -if(BUILD_WITH_DFU STREQUAL "BLE") +if(CONFIG_MCUMGR_SMP_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/lock-app/nrfconnect/Kconfig b/examples/lock-app/nrfconnect/Kconfig index 2b702dc9fc0ebe..ccf45058d8fca3 100644 --- a/examples/lock-app/nrfconnect/Kconfig +++ b/examples/lock-app/nrfconnect/Kconfig @@ -23,4 +23,6 @@ config STATE_LEDS the device into a network or the factory reset initiation. Note that setting this option to 'n' does not disable the LED indicating the state of the simulated bolt. +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" +rsource "../../../config/nrfconnect/chip-module/Kconfig.features" source "Kconfig.zephyr" diff --git a/examples/lock-app/nrfconnect/README.md b/examples/lock-app/nrfconnect/README.md index 4ad73a8b7d4f90..60b702e5430952 100644 --- a/examples/lock-app/nrfconnect/README.md +++ b/examples/lock-app/nrfconnect/README.md @@ -36,6 +36,7 @@ into an existing Matter network and can be controlled by this network. - [Building with low-power configuration](#building-with-low-power-configuration) - [Building with Device Firmware Upgrade support](#building-with-device-firmware-upgrade-support) - [Configuring the example](#configuring-the-example) + - [Example build types](#example-build-types) - [Flashing and debugging](#flashing-and-debugging) - [Testing the example](#testing-the-example) - [Testing using CHIPTool](#testing-using-chiptool) @@ -375,7 +376,7 @@ following command: To build the example with release configuration that disables the diagnostic features like logs and command-line interface, run the following command: - $ west build -b build-target -- -DOVERLAY_CONFIG=third_party/connectedhomeip/config/nrfconnect/app/release.conf + $ west build -b build-target -- -DCONF_FILE=prj_release.conf Remember to replace _build-target_ with the build target name of the Nordic Semiconductor's kit you own. @@ -390,11 +391,11 @@ To build for the low-power configuration, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor's kit you own (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DOVERLAY_CONFIG=overlay-low_power.conf + $ west build -b build-target -- -DOVERLAY_CONFIG=../../overlay-low_power.conf For example, use the following command for `nrf52840dk_nrf52840`: - $ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=overlay-low_power.conf + $ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=../../overlay-low_power.conf ### Building with Device Firmware Upgrade support @@ -404,13 +405,13 @@ To enable DFU over Bluetooth LE, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=BLE + $ west build -b build-target -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y To completely disable support for both DFU methods, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=OFF + $ west build -b build-target -- -DCONF_FILE=prj_no_dfu.conf > **Note**: > @@ -421,29 +422,13 @@ Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): > upgrading the application core and network core firmware in two-core nRF5340 > DK devices. -#### Changing Device Firmware Upgrade configuration - -To change the default DFU configuration, edit the following overlay files -corresponding to the selected configuration: - -- `overlay-mcuboot_qspi_nor_support.conf` - general file enabling MCUboot and - QSPI NOR support, used by all DFU configurations -- `overlay-single_image_smp_dfu_support.conf` - file enabling single-image DFU - over Bluetooth LE using SMP -- `overlay-multi_image_smp_dfu_support.conf` - file enabling multi-image DFU - over Bluetooth LE using SMP -- `overlay-ota_requestor.conf` - file enabling Matter OTA Requestor support. - -The files are located in the `config/nrfconnect/app` directory. You can also -define the desired options in your example's `prj.conf` file. - #### Changing bootloader configuration -To change the default MCUboot configuration, edit the -`mcuboot_single_image_dfu.conf` or `mcuboot_multi_image_dfu.conf` overlay files -depending on whether the build target device supports multi-image DFU (nRF5340 -DK) or single-image DFU (nRF52840 DK). The files are located in the -`configuration` directory. +To change the default MCUboot configuration, edit the `mcuboot.conf` or +`mcuboot_release.conf` overlay files depending on whether you build the target +with debug or release configuration. The files are located in the +`configuration/build-target/child_image` directory (_build-target_ is your board +name, for example `nrf52840dk_nrf52840`). Make sure to keep the configuration consistent with changes made to the application configuration. This is necessary for the configuration to work, as @@ -460,7 +445,7 @@ purposes. You can change these settings by defining This example uses this option to define using an external flash. To modify the flash settings of your board (that is, your _build-target_, for -example `nrf52840dk_nrf52840`), edit the `pm_static.yml` file located in the +example `nrf52840dk_nrf52840`), edit the `pm_static_dfu.yml` file located in the `configuration/build-target/` directory.
@@ -482,6 +467,33 @@ Semiconductor's kit you own. Changes done with menuconfig will be lost if the `build` directory is deleted. To make them persistent, save the configuration options in the `prj.conf` file. + +### Example build types + +The example uses different configuration files depending on the supported +features. Configuration files are provided for different build types and they +are located in the `configuration/build-target` directory. + +The `prj.conf` file represents a debug build type. Other build types are covered +by dedicated files with the build type added as a suffix to the prj part, as per +the following list. For example, the release build type file name is +`prj_release.conf`. If a board has other configuration files, for example +associated with partition layout or child image configuration, these follow the +same pattern. + +Before you start testing the application, you can select one of the build types +supported by the sample. This sample supports the following build types, +depending on the selected board: + +- debug -- Debug version of the application - can be used to enable additional + features for verifying the application behavior, such as logs or + command-line shell. +- release -- Release version of the application - can be used to enable only + the necessary application functionalities to optimize its performance. +- no_dfu -- Debug version of the application without Device Firmware Upgrade + feature support - can be used only for the nRF52840 DK and nRF5340 DK, as + those platforms have DFU enabled by default. + For more information, see the [Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) page. diff --git a/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.conf b/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index 0b169c5894fab9..00000000000000 --- a/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf b/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index 5816e439e81409..00000000000000 --- a/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -CONFIG_XOROSHIRO_RANDOM_GENERATOR=y - diff --git a/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf new file mode 100644 index 00000000000000..d20c6c4440ed23 --- /dev/null +++ b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf @@ -0,0 +1,38 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_GPIO=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf new file mode 100644 index 00000000000000..d20c6c4440ed23 --- /dev/null +++ b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf @@ -0,0 +1,38 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_GPIO=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay similarity index 100% rename from examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay rename to examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay diff --git a/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml similarity index 100% rename from examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml rename to examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml diff --git a/examples/lock-app/nrfconnect/prj.conf b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf similarity index 83% rename from examples/lock-app/nrfconnect/prj.conf rename to examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf index dabdbeef761f31..39a5044a1581f7 100644 --- a/examples/lock-app/nrfconnect/prj.conf +++ b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2022 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. @@ -14,7 +14,10 @@ # limitations under the License. # -# This sample uses sample-defaults.conf to set options common for all +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all # samples. This file should contain only options specific for this sample # or overrides of default values. @@ -22,6 +25,7 @@ CONFIG_DK_LIBRARY=y # OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n @@ -35,6 +39,9 @@ CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" # Bluetooth overrides CONFIG_BT_DEVICE_NAME="MatterLock" +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + # Additional configs for debbugging experience. CONFIG_THREAD_NAME=y CONFIG_MPU_STACK_GUARD=y diff --git a/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf new file mode 100644 index 00000000000000..d562b96cdae399 --- /dev/null +++ b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf @@ -0,0 +1,56 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLock" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32774 == 0x8006 (example lock-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32774 diff --git a/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf new file mode 100644 index 00000000000000..7a59e7a28c5a19 --- /dev/null +++ b/examples/lock-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf @@ -0,0 +1,63 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLock" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32774 == 0x8006 (example lock-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32774 + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf new file mode 100644 index 00000000000000..df25649250f4cb --- /dev/null +++ b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf @@ -0,0 +1,52 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# The following configurations are required to support simultaneous multi image update +CONFIG_PCD_APP=y +CONFIG_UPDATEABLE_IMAGE_NUMBER=2 +CONFIG_BOOT_UPGRADE_ONLY=y +# The network core cannot access external flash directly. The flash simulator must be used to +# provide a memory region that is used to forward the new firmware to the network core. +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y +CONFIG_FLASH_SIMULATOR_STATS=n + +# Enable custom command to erase settings partition. +CONFIG_ENABLE_MGMT_PERUSER=y +CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_GPIO=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf new file mode 100644 index 00000000000000..df25649250f4cb --- /dev/null +++ b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf @@ -0,0 +1,52 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# The following configurations are required to support simultaneous multi image update +CONFIG_PCD_APP=y +CONFIG_UPDATEABLE_IMAGE_NUMBER=2 +CONFIG_BOOT_UPGRADE_ONLY=y +# The network core cannot access external flash directly. The flash simulator must be used to +# provide a memory region that is used to forward the new firmware to the network core. +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y +CONFIG_FLASH_SIMULATOR_STATS=n + +# Enable custom command to erase settings partition. +CONFIG_ENABLE_MGMT_PERUSER=y +CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_GPIO=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/lock-app/nrfconnect/child_image/multiprotocol_rpmsg.conf b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf similarity index 94% rename from examples/lock-app/nrfconnect/child_image/multiprotocol_rpmsg.conf rename to examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf index 329d787b50feab..b22013c122cf4d 100644 --- a/examples/lock-app/nrfconnect/child_image/multiprotocol_rpmsg.conf +++ b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. diff --git a/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf new file mode 100644 index 00000000000000..b22013c122cf4d --- /dev/null +++ b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=n +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay similarity index 100% rename from examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay rename to examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml similarity index 100% rename from examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml rename to examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml diff --git a/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf new file mode 100644 index 00000000000000..0038efbb5e0e0e --- /dev/null +++ b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf @@ -0,0 +1,54 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLock" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32774 == 0x8006 (example lock-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32774 diff --git a/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf new file mode 100644 index 00000000000000..b49bf94062bce6 --- /dev/null +++ b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf @@ -0,0 +1,57 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLock" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y +CONFIG_RESET_ON_FATAL_ERROR=n + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32774 == 0x8006 (example lock-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32774 diff --git a/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf new file mode 100644 index 00000000000000..d730a92b932f97 --- /dev/null +++ b/examples/lock-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf @@ -0,0 +1,64 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterLock" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32774 == 0x8006 (example lock-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32774 + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/pigweed-app/nrfconnect/CMakeLists.txt b/examples/pigweed-app/nrfconnect/CMakeLists.txt index 0011014caa2537..20be593146793d 100644 --- a/examples/pigweed-app/nrfconnect/CMakeLists.txt +++ b/examples/pigweed-app/nrfconnect/CMakeLists.txt @@ -22,7 +22,8 @@ set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) # Load NCS/Zephyr build system -set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf) +set(CONF_FILE prj.conf) + if(${BOARD} STREQUAL "nrf52840dongle_nrf52840") list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-usb_support.conf) endif() diff --git a/examples/all-clusters-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf b/examples/pigweed-app/nrfconnect/Kconfig similarity index 74% rename from examples/all-clusters-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf rename to examples/pigweed-app/nrfconnect/Kconfig index ce2e61edce82ca..d862fc1d2ace52 100644 --- a/examples/all-clusters-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf +++ b/examples/pigweed-app/nrfconnect/Kconfig @@ -13,5 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +mainmenu "Matter nRF Connect Lighting Example Application" -CONFIG_XOROSHIRO_RANDOM_GENERATOR=y +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" +rsource "../../../config/nrfconnect/chip-module/Kconfig.features" +source "Kconfig.zephyr" diff --git a/examples/pigweed-app/nrfconnect/prj.conf b/examples/pigweed-app/nrfconnect/prj.conf index 58a0fe63277b34..ff25bac4606447 100644 --- a/examples/pigweed-app/nrfconnect/prj.conf +++ b/examples/pigweed-app/nrfconnect/prj.conf @@ -13,12 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +CONFIG_CHIP=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + # Export POSIX names for functions implementing a subset of POSIX standard in Zephyr CONFIG_POSIX_API=y # Add support for LEDs and buttons on Nordic development kits CONFIG_DK_LIBRARY=y +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y + # Additional configs for debbugging experience. CONFIG_THREAD_NAME=y CONFIG_MPU_STACK_GUARD=y @@ -26,6 +35,12 @@ CONFIG_MPU_STACK_GUARD=y # Enable Pigweed RPC CONFIG_CHIP_PW_RPC=y +# Disable OTA requestor +CONFIG_CHIP_OTA_REQUESTOR=n + +# Disable QSPI NOR +CONFIG_CHIP_QSPI_NOR=n + # Add support for C++17 to build Pigweed components CONFIG_STD_CPP14=n CONFIG_STD_CPP17=y diff --git a/examples/pump-app/nrfconnect/CMakeLists.txt b/examples/pump-app/nrfconnect/CMakeLists.txt index c251817163c0e6..d031f6bd2f1b04 100644 --- a/examples/pump-app/nrfconnect/CMakeLists.txt +++ b/examples/pump-app/nrfconnect/CMakeLists.txt @@ -21,37 +21,10 @@ get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) -# Load NCS/Zephyr build system -set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf) +set(APPLICATION_CONFIG_DIR "configuration/\${BOARD}") -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf) - list(APPEND CONF_FILE boards/${BOARD}.conf) -endif() - -set(BUILD_WITH_DFU "MATTER" CACHE STRING "Build target with Device Firmware Upgrade support") - -if(NOT BUILD_WITH_DFU STREQUAL "OFF") - if(BUILD_WITH_DFU STREQUAL "BLE") - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-multi_image_smp_dfu_support.conf) - else() - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-single_image_smp_dfu_support.conf) - endif() - elseif(NOT BUILD_WITH_DFU STREQUAL "MATTER") - message(FATAL_ERROR "Selected invalid BUILD_WITH_DFU value: ${BUILD_WITH_DFU}") - endif() - - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-mcuboot_qspi_nor_support.conf) - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-ota_requestor.conf) - - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - # DFU over Matter doesn't support multi-image update yet, but using this configs should not harm it anyway. - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_multi_image_dfu.conf CACHE INTERNAL "") - else() - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_single_image_dfu.conf CACHE INTERNAL "") - endif() - - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static.yml) +if(NOT CONF_FILE STREQUAL "prj_no_dfu.conf") + set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) endif() list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module) @@ -95,6 +68,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/OTAUtil.cpp) endif() -if(BUILD_WITH_DFU STREQUAL "BLE") +if(CONFIG_MCUMGR_SMP_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/light-switch-app/nrfconnect/boards/nrf52840dk_nrf52840.conf b/examples/pump-app/nrfconnect/Kconfig similarity index 74% rename from examples/light-switch-app/nrfconnect/boards/nrf52840dk_nrf52840.conf rename to examples/pump-app/nrfconnect/Kconfig index fb419f0c7aa921..d862fc1d2ace52 100644 --- a/examples/light-switch-app/nrfconnect/boards/nrf52840dk_nrf52840.conf +++ b/examples/pump-app/nrfconnect/Kconfig @@ -13,5 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +mainmenu "Matter nRF Connect Lighting Example Application" -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" +rsource "../../../config/nrfconnect/chip-module/Kconfig.features" +source "Kconfig.zephyr" diff --git a/examples/pump-app/nrfconnect/README.md b/examples/pump-app/nrfconnect/README.md index c9dbacc8ee7f6f..85d9030b2527ae 100644 --- a/examples/pump-app/nrfconnect/README.md +++ b/examples/pump-app/nrfconnect/README.md @@ -33,6 +33,7 @@ into an existing Matter network and can be controlled by this network. - [Using native shell for setup](#using-native-shell-for-setup) - [Building](#building) - [Configuring the example](#configuring-the-example) + - [Example build types](#example-build-types) - [Flashing and debugging](#flashing-and-debugging) - [Testing the example](#testing-the-example) - [Testing using CHIPTool](#testing-using-chiptool) @@ -368,7 +369,7 @@ following command: To build the example with release configuration that disables the diagnostic features like logs and command-line interface, run the following command: - $ west build -b build-target -- -DOVERLAY_CONFIG=third_party/connectedhomeip/config/nrfconnect/app/release.conf + $ west build -b build-target -- -DCONF_FILE=prj_release.conf Remember to replace _build-target_ with the build target name of the Nordic Semiconductor's kit you own. @@ -381,13 +382,13 @@ To enable DFU over Bluetooth LE, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=BLE + $ west build -b build-target -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y To completely disable support for both DFU methods, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=OFF + $ west build -b build-target -- -DCONF_FILE=prj_no_dfu.conf > **Note**: > @@ -401,29 +402,13 @@ Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): > Currently the multi-image mode is only available for the DFU over Bluetooth LE > method. -#### Changing Device Firmware Upgrade configuration - -To change the default DFU configuration, edit the following overlay files -corresponding to the selected configuration: - -- `overlay-mcuboot_qspi_nor_support.conf` - general file enabling MCUboot and - QSPI NOR support, used by all DFU configurations -- `overlay-single_image_smp_dfu_support.conf` - file enabling single-image DFU - over Bluetooth LE using SMP -- `overlay-multi_image_smp_dfu_support.conf` - file enabling multi-image DFU - over Bluetooth LE using SMP -- `overlay-ota_requestor.conf` - file enabling Matter OTA Requestor support. - -The files are located in the `config/nrfconnect/app` directory. You can also -define the desired options in your example's `prj.conf` file. - #### Changing bootloader configuration -To change the default MCUboot configuration, edit the -`mcuboot_single_image_dfu.conf` or `mcuboot_multi_image_dfu.conf` overlay files -depending on whether the build target device supports multi-image DFU (nRF5340 -DK) or single-image DFU (nRF52840 DK). The files are located in the -`configuration` directory. +To change the default MCUboot configuration, edit the `mcuboot.conf` or +`mcuboot_release.conf` overlay files depending on whether you build the target +with debug or release configuration. The files are located in the +`configuration/build-target/child_image` directory (_build-target_ is your board +name, for example `nrf52840dk_nrf52840`). Make sure to keep the configuration consistent with changes made to the application configuration. This is necessary for the configuration to work, as @@ -440,7 +425,7 @@ purposes. You can change these settings by defining This example uses this option to define using an external flash. To modify the flash settings of your board (that is, your _build-target_, for -example `nrf52840dk_nrf52840`), edit the `pm_static.yml` file located in the +example `nrf52840dk_nrf52840`), edit the `pm_static_dfu.yml` file located in the `configuration/build-target/` directory.
@@ -462,6 +447,33 @@ Semiconductor's kit you own. Changes done with menuconfig will be lost if the `build` directory is deleted. To make them persistent, save the configuration options in the `prj.conf` file. + +### Example build types + +The example uses different configuration files depending on the supported +features. Configuration files are provided for different build types and they +are located in the `configuration/build-target` directory. + +The `prj.conf` file represents a debug build type. Other build types are covered +by dedicated files with the build type added as a suffix to the prj part, as per +the following list. For example, the release build type file name is +`prj_release.conf`. If a board has other configuration files, for example +associated with partition layout or child image configuration, these follow the +same pattern. + +Before you start testing the application, you can select one of the build types +supported by the sample. This sample supports the following build types, +depending on the selected board: + +- debug -- Debug version of the application - can be used to enable additional + features for verifying the application behavior, such as logs or + command-line shell. +- release -- Release version of the application - can be used to enable only + the necessary application functionalities to optimize its performance. +- no_dfu -- Debug version of the application without Device Firmware Upgrade + feature support - can be used only for the nRF52840 DK and nRF5340 DK, as + those platforms have DFU enabled by default. + For more information, see the [Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) page. diff --git a/examples/pump-app/nrfconnect/boards/nrf52840dk_nrf52840.conf b/examples/pump-app/nrfconnect/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index 0b169c5894fab9..00000000000000 --- a/examples/pump-app/nrfconnect/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf b/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index 5816e439e81409..00000000000000 --- a/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -CONFIG_XOROSHIRO_RANDOM_GENERATOR=y - diff --git a/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf new file mode 100644 index 00000000000000..d20c6c4440ed23 --- /dev/null +++ b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf @@ -0,0 +1,38 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_GPIO=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf new file mode 100644 index 00000000000000..d20c6c4440ed23 --- /dev/null +++ b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf @@ -0,0 +1,38 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_GPIO=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay similarity index 100% rename from examples/pump-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay rename to examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay diff --git a/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml similarity index 100% rename from examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml rename to examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml diff --git a/examples/pump-app/nrfconnect/prj.conf b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf similarity index 82% rename from examples/pump-app/nrfconnect/prj.conf rename to examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf index b6e1e7eae71fa6..68b4c1320fb60c 100644 --- a/examples/pump-app/nrfconnect/prj.conf +++ b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2022 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. @@ -14,7 +14,10 @@ # limitations under the License. # -# This sample uses sample-defaults.conf to set options common for all +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all # samples. This file should contain only options specific for this sample # or overrides of default values. @@ -22,6 +25,7 @@ CONFIG_DK_LIBRARY=y # OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n @@ -35,6 +39,9 @@ CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" # Bluetooth overrides CONFIG_BT_DEVICE_NAME="MatterPump" +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + # Additional configs for debbugging experience. CONFIG_THREAD_NAME=y CONFIG_MPU_STACK_GUARD=y diff --git a/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf new file mode 100644 index 00000000000000..0d29aa913b923d --- /dev/null +++ b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf @@ -0,0 +1,55 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterPump" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32784 == 0x8010 (example pump-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32784 diff --git a/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf new file mode 100644 index 00000000000000..a9f073043b924c --- /dev/null +++ b/examples/pump-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf @@ -0,0 +1,63 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterPump" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32784 == 0x8010 (example pump-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32784 + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf new file mode 100644 index 00000000000000..df25649250f4cb --- /dev/null +++ b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf @@ -0,0 +1,52 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# The following configurations are required to support simultaneous multi image update +CONFIG_PCD_APP=y +CONFIG_UPDATEABLE_IMAGE_NUMBER=2 +CONFIG_BOOT_UPGRADE_ONLY=y +# The network core cannot access external flash directly. The flash simulator must be used to +# provide a memory region that is used to forward the new firmware to the network core. +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y +CONFIG_FLASH_SIMULATOR_STATS=n + +# Enable custom command to erase settings partition. +CONFIG_ENABLE_MGMT_PERUSER=y +CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_GPIO=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf new file mode 100644 index 00000000000000..df25649250f4cb --- /dev/null +++ b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf @@ -0,0 +1,52 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# The following configurations are required to support simultaneous multi image update +CONFIG_PCD_APP=y +CONFIG_UPDATEABLE_IMAGE_NUMBER=2 +CONFIG_BOOT_UPGRADE_ONLY=y +# The network core cannot access external flash directly. The flash simulator must be used to +# provide a memory region that is used to forward the new firmware to the network core. +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y +CONFIG_FLASH_SIMULATOR_STATS=n + +# Enable custom command to erase settings partition. +CONFIG_ENABLE_MGMT_PERUSER=y +CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_GPIO=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/lighting-app/nrfconnect/child_image/multiprotocol_rpmsg.conf b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf similarity index 94% rename from examples/lighting-app/nrfconnect/child_image/multiprotocol_rpmsg.conf rename to examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf index 329d787b50feab..b22013c122cf4d 100644 --- a/examples/lighting-app/nrfconnect/child_image/multiprotocol_rpmsg.conf +++ b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 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. diff --git a/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf new file mode 100644 index 00000000000000..b22013c122cf4d --- /dev/null +++ b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=n +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay similarity index 100% rename from examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay rename to examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml similarity index 100% rename from examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml rename to examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml diff --git a/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf new file mode 100644 index 00000000000000..94abcbad2810d1 --- /dev/null +++ b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf @@ -0,0 +1,53 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterPump" + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32784 == 0x8010 (example pump-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32784 diff --git a/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf new file mode 100644 index 00000000000000..2ec86913fe010c --- /dev/null +++ b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf @@ -0,0 +1,56 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterPump" + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32784 == 0x8010 (example pump-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32784 diff --git a/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf new file mode 100644 index 00000000000000..7e707ad90dac26 --- /dev/null +++ b/examples/pump-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf @@ -0,0 +1,64 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterPump" + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32784 == 0x8010 (example pump-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32784 + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/pump-controller-app/nrfconnect/CMakeLists.txt b/examples/pump-controller-app/nrfconnect/CMakeLists.txt index f71527619100db..9f70b2167e7b93 100644 --- a/examples/pump-controller-app/nrfconnect/CMakeLists.txt +++ b/examples/pump-controller-app/nrfconnect/CMakeLists.txt @@ -21,37 +21,10 @@ get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) -# Load NCS/Zephyr build system -set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf) +set(APPLICATION_CONFIG_DIR "configuration/\${BOARD}") -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf) - list(APPEND CONF_FILE boards/${BOARD}.conf) -endif() - -set(BUILD_WITH_DFU "MATTER" CACHE STRING "Build target with Device Firmware Upgrade support") - -if(NOT BUILD_WITH_DFU STREQUAL "OFF") - if(BUILD_WITH_DFU STREQUAL "BLE") - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-multi_image_smp_dfu_support.conf) - else() - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-single_image_smp_dfu_support.conf) - endif() - elseif(NOT BUILD_WITH_DFU STREQUAL "MATTER") - message(FATAL_ERROR "Selected invalid BUILD_WITH_DFU value: ${BUILD_WITH_DFU}") - endif() - - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-mcuboot_qspi_nor_support.conf) - list(INSERT OVERLAY_CONFIG 0 ${CHIP_ROOT}/config/nrfconnect/app/overlay-ota_requestor.conf) - - if(BOARD STREQUAL "nrf5340dk_nrf5340_cpuapp") - # DFU over Matter doesn't support multi-image update yet, but using this configs should not harm it anyway. - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_multi_image_dfu.conf CACHE INTERNAL "") - else() - set(mcuboot_OVERLAY_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/configuration/mcuboot_single_image_dfu.conf CACHE INTERNAL "") - endif() - - set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static.yml) +if(NOT CONF_FILE STREQUAL "prj_no_dfu.conf") + set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) endif() list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module) @@ -95,6 +68,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/OTAUtil.cpp) endif() -if(BUILD_WITH_DFU STREQUAL "BLE") +if(CONFIG_MCUMGR_SMP_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/all-clusters-app/nrfconnect/boards/nrf52840dk_nrf52840.conf b/examples/pump-controller-app/nrfconnect/Kconfig similarity index 74% rename from examples/all-clusters-app/nrfconnect/boards/nrf52840dk_nrf52840.conf rename to examples/pump-controller-app/nrfconnect/Kconfig index fb419f0c7aa921..d862fc1d2ace52 100644 --- a/examples/all-clusters-app/nrfconnect/boards/nrf52840dk_nrf52840.conf +++ b/examples/pump-controller-app/nrfconnect/Kconfig @@ -13,5 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +mainmenu "Matter nRF Connect Lighting Example Application" -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" +rsource "../../../config/nrfconnect/chip-module/Kconfig.features" +source "Kconfig.zephyr" diff --git a/examples/pump-controller-app/nrfconnect/README.md b/examples/pump-controller-app/nrfconnect/README.md index bfe847869c5cda..7bdeaa3f1f7306 100644 --- a/examples/pump-controller-app/nrfconnect/README.md +++ b/examples/pump-controller-app/nrfconnect/README.md @@ -34,6 +34,7 @@ into an existing Matter network and can be controlled by this network. - [Using native shell for setup](#using-native-shell-for-setup) - [Building](#building) - [Configuring the example](#configuring-the-example) + - [Example build types](#example-build-types) - [Flashing and debugging](#flashing-and-debugging) - [Testing the example](#testing-the-example) - [Testing using CHIPTool](#testing-using-chiptool) @@ -368,7 +369,7 @@ following command: To build the example with release configuration that disables the diagnostic features like logs and command-line interface, run the following command: - $ west build -b build-target -- -DOVERLAY_CONFIG=third_party/connectedhomeip/config/nrfconnect/app/release.conf + $ west build -b build-target -- -DCONF_FILE=prj_release.conf Remember to replace _build-target_ with the build target name of the Nordic Semiconductor's kit you own. @@ -381,13 +382,13 @@ To enable DFU over Bluetooth LE, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=BLE + $ west build -b build-target -- -DCONFIG_CHIP_DFU_OVER_BT_SMP=y To completely disable support for both DFU methods, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): - $ west build -b build-target -- -DBUILD_WITH_DFU=OFF + $ west build -b build-target -- -DCONF_FILE=prj_no_dfu.conf > **Note**: > @@ -401,29 +402,13 @@ Semiconductor kit you are using (for example `nrf52840dk_nrf52840`): > Currently the multi-image mode is only available for the DFU over Bluetooth LE > method. -#### Changing Device Firmware Upgrade configuration - -To change the default DFU configuration, edit the following overlay files -corresponding to the selected configuration: - -- `overlay-mcuboot_qspi_nor_support.conf` - general file enabling MCUboot and - QSPI NOR support, used by all DFU configurations -- `overlay-single_image_smp_dfu_support.conf` - file enabling single-image DFU - over Bluetooth LE using SMP -- `overlay-multi_image_smp_dfu_support.conf` - file enabling multi-image DFU - over Bluetooth LE using SMP -- `overlay-ota_requestor.conf` - file enabling Matter OTA Requestor support. - -The files are located in the `config/nrfconnect/app` directory. You can also -define the desired options in your example's `prj.conf` file. - #### Changing bootloader configuration -To change the default MCUboot configuration, edit the -`mcuboot_single_image_dfu.conf` or `mcuboot_multi_image_dfu.conf` overlay files -depending on whether the build target device supports multi-image DFU (nRF5340 -DK) or single-image DFU (nRF52840 DK). The files are located in the -`configuration` directory. +To change the default MCUboot configuration, edit the `mcuboot.conf` or +`mcuboot_release.conf` overlay files depending on whether you build the target +with debug or release configuration. The files are located in the +`configuration/build-target/child_image` directory (_build-target_ is your board +name, for example `nrf52840dk_nrf52840`). Make sure to keep the configuration consistent with changes made to the application configuration. This is necessary for the configuration to work, as @@ -440,7 +425,7 @@ purposes. You can change these settings by defining This example uses this option to define using an external flash. To modify the flash settings of your board (that is, your _build-target_, for -example `nrf52840dk_nrf52840`), edit the `pm_static.yml` file located in the +example `nrf52840dk_nrf52840`), edit the `pm_static_dfu.yml` file located in the `configuration/build-target/` directory.
@@ -462,6 +447,33 @@ Semiconductor's kit you own. Changes done with menuconfig will be lost if the `build` directory is deleted. To make them persistent, save the configuration options in the `prj.conf` file. + +### Example build types + +The example uses different configuration files depending on the supported +features. Configuration files are provided for different build types and they +are located in the `configuration/build-target` directory. + +The `prj.conf` file represents a debug build type. Other build types are covered +by dedicated files with the build type added as a suffix to the prj part, as per +the following list. For example, the release build type file name is +`prj_release.conf`. If a board has other configuration files, for example +associated with partition layout or child image configuration, these follow the +same pattern. + +Before you start testing the application, you can select one of the build types +supported by the sample. This sample supports the following build types, +depending on the selected board: + +- debug -- Debug version of the application - can be used to enable additional + features for verifying the application behavior, such as logs or + command-line shell. +- release -- Release version of the application - can be used to enable only + the necessary application functionalities to optimize its performance. +- no_dfu -- Debug version of the application without Device Firmware Upgrade + feature support - can be used only for the nRF52840 DK and nRF5340 DK, as + those platforms have DFU enabled by default. + For more information, see the [Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) page. diff --git a/examples/pump-controller-app/nrfconnect/boards/nrf52840dk_nrf52840.conf b/examples/pump-controller-app/nrfconnect/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index 0b169c5894fab9..00000000000000 --- a/examples/pump-controller-app/nrfconnect/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf b/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf deleted file mode 100644 index 5816e439e81409..00000000000000 --- a/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.conf +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -CONFIG_XOROSHIRO_RANDOM_GENERATOR=y - diff --git a/examples/pump-controller-app/nrfconnect/child_image/multiprotocol_rpmsg.conf b/examples/pump-controller-app/nrfconnect/child_image/multiprotocol_rpmsg.conf deleted file mode 100644 index 329d787b50feab..00000000000000 --- a/examples/pump-controller-app/nrfconnect/child_image/multiprotocol_rpmsg.conf +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -CONFIG_BT_PERIPHERAL=y -CONFIG_BT_CENTRAL=n -CONFIG_BT_MAX_CONN=1 -CONFIG_BT_BUF_ACL_RX_SIZE=502 -CONFIG_BT_BUF_ACL_TX_SIZE=251 -CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/pump-controller-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf b/examples/pump-controller-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf deleted file mode 100644 index ccc69439f449f0..00000000000000 --- a/examples/pump-controller-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf +++ /dev/null @@ -1,52 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -# QSPI configuration -CONFIG_NORDIC_QSPI_NOR=y -CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 -CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 - -CONFIG_BOOT_MAX_IMG_SECTORS=256 - -# The following configurations are required to support simultaneous multi image update -CONFIG_PCD_APP=y -CONFIG_UPDATEABLE_IMAGE_NUMBER=2 -CONFIG_BOOT_UPGRADE_ONLY=y -# The network core cannot access external flash directly. The flash simulator must be used to -# provide a memory region that is used to forward the new firmware to the network core. -CONFIG_FLASH_SIMULATOR=y -CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y -CONFIG_FLASH_SIMULATOR_STATS=n - -# Enable custom command to erase settings partition. -CONFIG_ENABLE_MGMT_PERUSER=y -CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y - -# bootloader size optimization -CONFIG_LOG=n -CONFIG_CONSOLE=n -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_CONSOLE_HANDLER=n -CONFIG_BOOT_BANNER=n -CONFIG_TIMESLICING=n -CONFIG_RESET_ON_FATAL_ERROR=n -CONFIG_MULTITHREADING=n -CONFIG_TICKLESS_KERNEL=n -CONFIG_TIMEOUT_64BIT=n -CONFIG_USE_SEGGER_RTT=n -CONFIG_GPIO=n -CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-controller-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf b/examples/pump-controller-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf deleted file mode 100644 index 807ba68b805796..00000000000000 --- a/examples/pump-controller-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf +++ /dev/null @@ -1,38 +0,0 @@ -# -# Copyright (c) 2021 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. -# - -# QSPI configuration -CONFIG_NORDIC_QSPI_NOR=y -CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 -CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 - -CONFIG_BOOT_MAX_IMG_SECTORS=256 - -# bootloader size optimization -CONFIG_LOG=n -CONFIG_CONSOLE=n -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_CONSOLE_HANDLER=n -CONFIG_BOOT_BANNER=n -CONFIG_TIMESLICING=n -CONFIG_RESET_ON_FATAL_ERROR=n -CONFIG_MULTITHREADING=n -CONFIG_TICKLESS_KERNEL=n -CONFIG_TIMEOUT_64BIT=n -CONFIG_USE_SEGGER_RTT=n -CONFIG_GPIO=n -CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf new file mode 100644 index 00000000000000..56e61619aef7d4 --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot.conf @@ -0,0 +1,38 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf new file mode 100644 index 00000000000000..56e61619aef7d4 --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/child_image/mcuboot_release.conf @@ -0,0 +1,38 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-controller-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay similarity index 100% rename from examples/pump-controller-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay rename to examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/nrf52840dk_nrf52840.overlay diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml similarity index 100% rename from examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static.yml rename to examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/pm_static_dfu.yml diff --git a/examples/pump-controller-app/nrfconnect/prj.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf similarity index 82% rename from examples/pump-controller-app/nrfconnect/prj.conf rename to examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf index ec6dfbc35d01ab..045576f555e204 100644 --- a/examples/pump-controller-app/nrfconnect/prj.conf +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2022 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. @@ -14,7 +14,10 @@ # limitations under the License. # -# This sample uses sample-defaults.conf to set options common for all +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all # samples. This file should contain only options specific for this sample # or overrides of default values. @@ -22,6 +25,7 @@ CONFIG_DK_LIBRARY=y # OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n @@ -35,6 +39,9 @@ CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" # Bluetooth overrides CONFIG_BT_DEVICE_NAME="MatterPumpCtrl" +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + # Additional configs for debbugging experience. CONFIG_THREAD_NAME=y CONFIG_MPU_STACK_GUARD=y diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf new file mode 100644 index 00000000000000..cda38ca40a8960 --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_no_dfu.conf @@ -0,0 +1,55 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterPumpCtrl" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32785 == 0x8011 (example pump-controller-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32785 \ No newline at end of file diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf new file mode 100644 index 00000000000000..2f7b9c818b540d --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf52840dk_nrf52840/prj_release.conf @@ -0,0 +1,63 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterPumpCtrl" + +# Increase maximum data length of PDU supported in the Controller +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32785 == 0x8011 (example pump-controller-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32785 + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf new file mode 100644 index 00000000000000..bdfc87a648561b --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot.conf @@ -0,0 +1,52 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# The following configurations are required to support simultaneous multi image update +CONFIG_PCD_APP=y +CONFIG_UPDATEABLE_IMAGE_NUMBER=2 +CONFIG_BOOT_UPGRADE_ONLY=y +# The network core cannot access external flash directly. The flash simulator must be used to +# provide a memory region that is used to forward the new firmware to the network core. +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y +CONFIG_FLASH_SIMULATOR_STATS=n + +# Enable custom command to erase settings partition. +CONFIG_ENABLE_MGMT_PERUSER=y +CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf new file mode 100644 index 00000000000000..bdfc87a648561b --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/mcuboot_release.conf @@ -0,0 +1,52 @@ +# +# Copyright (c) 2022 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. +# + +# QSPI configuration +CONFIG_NORDIC_QSPI_NOR=y +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# The following configurations are required to support simultaneous multi image update +CONFIG_PCD_APP=y +CONFIG_UPDATEABLE_IMAGE_NUMBER=2 +CONFIG_BOOT_UPGRADE_ONLY=y +# The network core cannot access external flash directly. The flash simulator must be used to +# provide a memory region that is used to forward the new firmware to the network core. +CONFIG_FLASH_SIMULATOR=y +CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y +CONFIG_FLASH_SIMULATOR_STATS=n + +# Enable custom command to erase settings partition. +CONFIG_ENABLE_MGMT_PERUSER=y +CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y + +# bootloader size optimization +CONFIG_LOG=n +CONFIG_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_UART_CONSOLE=n +CONFIG_CONSOLE_HANDLER=n +CONFIG_BOOT_BANNER=n +CONFIG_TIMESLICING=n +CONFIG_RESET_ON_FATAL_ERROR=n +CONFIG_MULTITHREADING=n +CONFIG_TICKLESS_KERNEL=n +CONFIG_TIMEOUT_64BIT=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_GPIO=n +CONFIG_NRF_ENABLE_ICACHE=n diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf new file mode 100644 index 00000000000000..b22013c122cf4d --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=n +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf new file mode 100644 index 00000000000000..b22013c122cf4d --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/child_image/multiprotocol_rpmsg_release.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_CENTRAL=n +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_BUF_ACL_RX_SIZE=502 +CONFIG_BT_BUF_ACL_TX_SIZE=251 +CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 diff --git a/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay similarity index 100% rename from examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay rename to examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml similarity index 100% rename from examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static.yml rename to examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf new file mode 100644 index 00000000000000..7160d74d41d4a4 --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj.conf @@ -0,0 +1,53 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterPumpCtrl" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32785 == 0x8011 (example pump-controller-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32785 diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf new file mode 100644 index 00000000000000..0a77704018057a --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_no_dfu.conf @@ -0,0 +1,56 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterPumpCtrl" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Additional configs for debbugging experience. +CONFIG_THREAD_NAME=y +CONFIG_MPU_STACK_GUARD=y + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32785 == 0x8011 (example pump-controller-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32785 diff --git a/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf new file mode 100644 index 00000000000000..6f093af999af13 --- /dev/null +++ b/examples/pump-controller-app/nrfconnect/configuration/nrf5340dk_nrf5340_cpuapp/prj_release.conf @@ -0,0 +1,64 @@ +# +# Copyright (c) 2022 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. +# + +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# Add support for LEDs and buttons on Nordic development kits +CONFIG_DK_LIBRARY=y + +# OpenThread configs +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y +CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y +CONFIG_OPENTHREAD_MTD=y +CONFIG_OPENTHREAD_FTD=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Bluetooth overrides +CONFIG_BT_DEVICE_NAME="MatterPumpCtrl" + +# Generate random numbers using Xoroshiro algorithm instead of direct calls +# to the cryptocell library to workaround firmware hangs. +CONFIG_XOROSHIRO_RANDOM_GENERATOR=y + +# Enable system reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=y + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h" +# 32785 == 0x8011 (example pump-controller-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32785 + +# Disable all debug features +CONFIG_SHELL=n +CONFIG_OPENTHREAD_SHELL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_LOG=n +CONFIG_LOG_MODE_MINIMAL=n +CONFIG_ASSERT_VERBOSE=n +CONFIG_PRINTK=n +CONFIG_THREAD_NAME=n diff --git a/examples/shell/nrfconnect/CMakeLists.txt b/examples/shell/nrfconnect/CMakeLists.txt index 87f43c4dff3e61..099f60ba63c0e2 100644 --- a/examples/shell/nrfconnect/CMakeLists.txt +++ b/examples/shell/nrfconnect/CMakeLists.txt @@ -21,7 +21,8 @@ get_filename_component(APP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/.. REALPATH) include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) # Load NCS/Zephyr build system -set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf) +set(CONF_FILE prj.conf) + list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module) find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) diff --git a/examples/shell/nrfconnect/Kconfig b/examples/shell/nrfconnect/Kconfig new file mode 100644 index 00000000000000..d862fc1d2ace52 --- /dev/null +++ b/examples/shell/nrfconnect/Kconfig @@ -0,0 +1,20 @@ +# +# Copyright (c) 2022 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. +# +mainmenu "Matter nRF Connect Lighting Example Application" + +rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" +rsource "../../../config/nrfconnect/chip-module/Kconfig.features" +source "Kconfig.zephyr" diff --git a/examples/shell/nrfconnect/prj.conf b/examples/shell/nrfconnect/prj.conf index 8dcc92edfa3891..77317f6a180ee5 100644 --- a/examples/shell/nrfconnect/prj.conf +++ b/examples/shell/nrfconnect/prj.conf @@ -14,10 +14,15 @@ # limitations under the License. # -# This sample uses sample-defaults.conf to set options common for all +CONFIG_CHIP=y +CONFIG_STD_CPP14=y + +# This sample uses Kconfig.defaults to set options common for all # samples. This file should contain only options specific for this sample # or overrides of default values. +CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y + # Add support for LEDs and buttons on Nordic development kits CONFIG_DK_LIBRARY=y @@ -33,6 +38,12 @@ CONFIG_OPENTHREAD_FTD=y CONFIG_THREAD_NAME=y CONFIG_MPU_STACK_GUARD=y +# Disable OTA requestor +CONFIG_CHIP_OTA_REQUESTOR=n + +# Disable QSPI NOR +CONFIG_CHIP_QSPI_NOR=n + # CHIP configuration CONFIG_CHIP_PROJECT_CONFIG="CHIPProjectConfig.h" # 32786 == 0x8012 (example shell-app)