Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] Update matter bridge to NCS 2.4.0 #1

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@

cmake_minimum_required(VERSION 3.20.0)

get_filename_component(MATTER_MODULE_ROOT $ENV{ZEPHYR_BASE}/../modules/lib/matter REALPATH)

# Set Kconfig root files that will be processed as a first Kconfig for used child images.
set(mcuboot_KCONFIG_ROOT ${MATTER_MODULE_ROOT}/config/nrfconnect/chip-module/Kconfig.mcuboot.root)
set(multiprotocol_rpmsg_KCONFIG_ROOT ${MATTER_MODULE_ROOT}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root)

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()

find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

project(matter-bridge)
Expand Down Expand Up @@ -34,6 +44,14 @@ target_sources(app PRIVATE
${COMMON_ROOT}/src/thread_util.cpp
)

if(CONFIG_CHIP_OTA_REQUESTOR)
target_sources(app PRIVATE ${COMMON_ROOT}/src/ota_util.cpp)
endif()

if(CONFIG_MCUMGR_SMP_BT)
target_sources(app PRIVATE ${COMMON_ROOT}/src/dfu_over_smp.cpp)
endif()

chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/bridge.zap
Expand Down
8 changes: 4 additions & 4 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

source "Kconfig.zephyr"

menu "Matter Bridge"
mainmenu "Matter Bridge sample application"

config ZIGBEE_SHELL_DEVICE_NAME
string "UART device name for Zigbee shell"
default "UART_1"

endmenu
source "${ZEPHYR_BASE}/../modules/lib/matter/config/nrfconnect/chip-module/Kconfig.features"
source "${ZEPHYR_BASE}/../modules/lib/matter/config/nrfconnect/chip-module/Kconfig.defaults"
source "Kconfig.zephyr"
7 changes: 7 additions & 0 deletions boards/nrf52840dk_nrf52840.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the sample is going to support OTA DFU on the nRF5340 DK, it needs the below code in its overlay as well.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not looked at OTA at all.

nordic,pm-ext-flash = &mx25r64;
};
};


/ {
/*
* In some default configurations within the nRF Connect SDK,
Expand Down
23 changes: 23 additions & 0 deletions child_image/mcuboot/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# 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.
# This target uses Kconfig.mcuboot.defaults to set options common for all
# samples using mcuboot. This file should contain only options specific for this sample
# mcuboot configuration or overrides of default values.

CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h"

# Bootloader size optimization
# Disable not used modules that cannot be set in Kconfig.mcuboot.defaults due to overriding
# in board files.
CONFIG_GPIO=n
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
23 changes: 23 additions & 0 deletions child_image/mcuboot/prj_release.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# 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.
# This target uses Kconfig.mcuboot.defaults to set options common for all
# samples using mcuboot. This file should contain only options specific for this sample
# mcuboot configuration or overrides of default values.

CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h"

# Bootloader size optimization
# Disable not used modules that cannot be set in Kconfig.mcuboot.defaults due to overriding
# in board files.
CONFIG_GPIO=n
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
10 changes: 0 additions & 10 deletions child_image/multiprotocol_rpmsg.conf

This file was deleted.

15 changes: 15 additions & 0 deletions child_image/multiprotocol_rpmsg/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# This target uses Kconfig.multiprotocol_rpmsg.defaults to set options common for all
# samples using multiprotocol_rpmsg. This file should contain only options specific for this sample
# multiprotocol_rpmsg configuration or overrides of default values.

# Disable not used modules that cannot be set in Kconfig.multiprotocol_rpmsg.defaults due to overriding
# in board files.

CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
15 changes: 15 additions & 0 deletions child_image/multiprotocol_rpmsg/prj_no_dfu.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Copyright (c) 2022 Nordic Semiconductor ASA

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prj_no_dfu.conf and prj_release.conf files are not needed in the mcuboot and multiprotocol_rpmsg directories, as long, as we have only one prj.conf file in the main sample directory.

#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# This target uses Kconfig.multiprotocol_rpmsg.defaults to set options common for all
# samples using multiprotocol_rpmsg. This file should contain only options specific for this sample
# multiprotocol_rpmsg configuration or overrides of default values.

# Disable not used modules that cannot be set in Kconfig.multiprotocol_rpmsg.defaults due to overriding
# in board files.

CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
15 changes: 15 additions & 0 deletions child_image/multiprotocol_rpmsg/prj_release.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# This target uses Kconfig.multiprotocol_rpmsg.defaults to set options common for all
# samples using multiprotocol_rpmsg. This file should contain only options specific for this sample
# multiprotocol_rpmsg configuration or overrides of default values.

# Disable not used modules that cannot be set in Kconfig.multiprotocol_rpmsg.defaults due to overriding
# in board files.

CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
38 changes: 38 additions & 0 deletions configuration/nrf52840dk_nrf52840/pm_static_dfu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
mcuboot:
address: 0x0
size: 0x7000
region: flash_primary
mcuboot_pad:
address: 0x7000
size: 0x200
app:
address: 0x7200
size: 0xf4e00
mcuboot_primary:
orig_span: &id001
- mcuboot_pad
- app
span: *id001
address: 0x7000
size: 0xf5000
region: flash_primary
mcuboot_primary_app:
orig_span: &id002
- app
span: *id002
address: 0x7200
size: 0xf4e00
settings_storage:
address: 0xfc000
size: 0x4000
region: flash_primary
mcuboot_secondary:
address: 0x0
size: 0xf5000
device: MX25R64
region: external_flash
external_flash:
address: 0xf5000
size: 0x70b000
device: MX25R64
region: external_flash
52 changes: 52 additions & 0 deletions configuration/nrf5340dk_nrf5340_cpuapp/pm_static_dfu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
mcuboot:
address: 0x0
size: 0xC000
region: flash_primary
mcuboot_pad:
address: 0xC000
size: 0x200
app:
address: 0xC200
size: 0xefe00
mcuboot_primary:
orig_span: &id001
- mcuboot_pad
- app
span: *id001
address: 0xC000
size: 0xf0000
region: flash_primary
mcuboot_primary_app:
orig_span: &id002
- app
span: *id002
address: 0xC200
size: 0xefe00
settings_storage:
address: 0xfc000
size: 0x4000
region: flash_primary
mcuboot_primary_1:
address: 0x0
size: 0x40000
device: flash_ctrl
region: ram_flash
mcuboot_secondary:
address: 0x0
size: 0xf0000
device: MX25R64
region: external_flash
mcuboot_secondary_1:
address: 0xf0000
size: 0x40000
device: MX25R64
region: external_flash
external_flash:
address: 0x130000
size: 0x6D0000
device: MX25R64
region: external_flash
pcd_sram:
address: 0x20000000
size: 0x2000
region: sram_primary
Loading