Skip to content

Commit

Permalink
samples: matter: Refactor nRF54H20 partition in samples
Browse files Browse the repository at this point in the history
- Refactored nRF54H20 partitions to support storing Nordic-related
SoC binaries in external flash.
- Enabled storing Nordic SoC binaries in the external flash if
the SUIT_ENVELOPE_NORDIC_TOP_DIRECTORY kconfig value is provided.

Signed-off-by: Arkadiusz Balys <[email protected]>
  • Loading branch information
ArekBalysNordic committed Jan 17, 2025
1 parent 749ab53 commit 491b885
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 101 deletions.
4 changes: 0 additions & 4 deletions applications/matter_bridge/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ config DFU_MULTI_IMAGE_PACKAGE_NET
endif # SOC_SERIES_NRF53X
endif # BOOTLOADER_MCUBOOT

## Disable DFU for nRF54h20
config MATTER_OTA
default n if SOC_SERIES_NRF54HX

#### Enable generating factory data
config MATTER_FACTORY_DATA_GENERATE
default y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# TODO: Workaround to be removed once DFU and external flash will be supported on nRF54H20.
CONFIG_CHIP_QSPI_NOR=n

CONFIG_MPU_STACK_GUARD=n

# Enable PSA crypto from SSF client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,3 @@
#include <../samples/matter/common/dts/nrf54h20/nrf54h20_cpuapp_peripherals.dtsi>
#include <../samples/matter/common/dts/nrf54h20/nrf54h20_cpuapp_memory_map.dtsi>
#include <../samples/matter/common/dts/nrf54h20/nrf54h20_ram_allocation.dtsi>

/delete-node/ &cpuapp_rx_partitions;
/delete-node/ &cpuapp_rw_partitions;

&mram1x {
erase-block-size = <0x1000>;
write-block-size = <0x10>;

cpuapp_rx_partitions: cpuapp-rx-partitions {
compatible = "nordic,owned-partitions", "fixed-partitions";
status = "okay";
nordic,access = <NRF_OWNER_ID_APPLICATION NRF_PERM_RXS>;
#address-cells = <1>;
#size-cells = <1>;

companion_partition: partition@98000 {
reg = <0x98000 DT_SIZE_K(64)>;
};

cpuapp_slot0_partition: partition@a8000 {
reg = <0xa8000 DT_SIZE_K(948)>;
};
};

cpuapp_rw_partitions: cpuapp-rw-partitions {
compatible = "nordic,owned-partitions", "fixed-partitions";
status = "okay";
nordic,access = <NRF_OWNER_ID_APPLICATION NRF_PERM_RW>;
#address-cells = <0x1>;
#size-cells = <0x1>;

storage_partition: partition@195000 {
reg = <0x195000 DT_SIZE_K(32)>;
};

factory_data: partition@19D000 {
reg = <0x19D000 DT_SIZE_K(4)>;
};

/* DFU partition to store SUIT manifests and Nordic Firmware update */
dfu_partition: partition@19E000 {
reg = <0x19E000 DT_SIZE_K(300)>;
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ SUIT_Envelope_Tagged:
- suit-send-record-failure
- suit-send-sysinfo-success
- suit-send-sysinfo-failure
{%- if 'SB_CONFIG_SUIT_ENVELOPE_NORDIC_TOP_IN_ROOT' in sysbuild['config'] %}
- suit-directive-set-component-index: 0
- suit-directive-override-parameters:
suit-parameter-image-size:
raw: 0
{%- endif %}

suit-manifest-component-id:
- INSTLD_MFST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ SUIT_Envelope_Tagged:
- suit-send-record-failure
- suit-send-sysinfo-success
- suit-send-sysinfo-failure
{%- if 'SB_CONFIG_SUIT_ENVELOPE_NORDIC_TOP_IN_ROOT' in sysbuild['config'] %}
- suit-directive-set-component-index: 0
- suit-directive-override-parameters:
suit-parameter-image-size:
raw: 0
{%- endif %}

suit-manifest-component-id:
- INSTLD_MFST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,25 +153,28 @@ SUIT_Envelope_Tagged:

suit-install:
- suit-directive-set-component-index: 0
{%- if application is defined %}
{%- if nordic_top %}
- suit-directive-override-parameters:
suit-parameter-uri: '#{{ application['name'] }}'
suit-parameter-uri: '#top'
- suit-directive-fetch:
- suit-send-record-failure
- suit-condition-dependency-integrity:
- suit-send-record-success
- suit-send-record-failure
- suit-send-sysinfo-success
- suit-send-sysinfo-failure
- suit-directive-process-dependency:
- suit-send-record-success
- suit-send-record-failure
- suit-send-sysinfo-success
- suit-send-sysinfo-failure
- suit-directive-run-sequence:
- suit-directive-override-parameters:
suit-parameter-soft-failure: True
- suit-directive-process-dependency:
- suit-send-record-success
- suit-send-record-failure
- suit-send-sysinfo-success
- suit-send-sysinfo-failure
{%- endif %}
{%- if radio is defined %}
{%- if application is defined %}
- suit-directive-override-parameters:
suit-parameter-uri: '#{{ radio['name'] }}'
suit-parameter-uri: '#{{ application['name'] }}'
- suit-directive-fetch:
- suit-send-record-failure
- suit-condition-dependency-integrity:
Expand All @@ -185,9 +188,9 @@ SUIT_Envelope_Tagged:
- suit-send-sysinfo-success
- suit-send-sysinfo-failure
{%- endif %}
{%- if nordic_top %}
{%- if radio is defined %}
- suit-directive-override-parameters:
suit-parameter-uri: '#top'
suit-parameter-uri: '#{{ radio['name'] }}'
- suit-directive-fetch:
- suit-send-record-failure
- suit-condition-dependency-integrity:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#address-cells = <1>;
#size-cells = <1>;

cpuapp_slot0_partition: partition@98000 {
reg = <0x98000 DT_SIZE_K(848)>;
cpuapp_slot0_partition: partition@86000 {
reg = <0x86000 DT_SIZE_K(1336)>;
};
};

Expand All @@ -48,17 +48,17 @@
#address-cells = < 0x1 >;
#size-cells = < 0x1 >;

storage_partition: partition@16C000 {
reg = < 0x16C000 DT_SIZE_K(32) >;
storage_partition: partition@1D4000 {
reg = < 0x1D4000 DT_SIZE_K(32) >;
};

factory_data: partition@174000 {
reg = < 0x174000 DT_SIZE_K(4) >;
factory_data: partition@1DC000 {
reg = < 0x1DC000 DT_SIZE_K(4) >;
};

/* DFU partition to store SUIT manifests and Nordic Firmware update */
dfu_partition: partition@175000 {
reg = < 0x175000 DT_SIZE_K(464) >;
dfu_partition: partition@1DD000 {
reg = < 0x1DD000 DT_SIZE_K(64) >;
};

};
Expand All @@ -72,7 +72,7 @@
#size-cells = <1>;

dfu_cache_partition_1: partition@0 {
reg = <0x0 DT_SIZE_K(1024)>;
reg = <0x0 DT_SIZE_K(2048)>;
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
nordic,access = <NRF_OWNER_ID_RADIOCORE NRF_PERM_RXS>;
#address-cells = < 0x1 >;
#size-cells = < 0x1 >;
cpurad_slot0_partition: partition@66000 {
reg = < 0x66000 DT_SIZE_K(200) >;
cpurad_slot0_partition: partition@54000 {
reg = < 0x54000 DT_SIZE_K(200) >;
};
};
};
13 changes: 0 additions & 13 deletions samples/matter/lock/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,6 @@ endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS

endif # BOOTLOADER_MCUBOOT

if SOC_SERIES_NRF54HX

config SUIT_ENVELOPE
default y

config SUIT_BUILD_FLASH_COMPANION
default y

config SUIT_MULTI_IMAGE_PACKAGE_BUILD
default y if MATTER_OTA

endif # SOC_SERIES_NRF54HX

#### Enable generating factory data
config MATTER_FACTORY_DATA_GENERATE
default y if !BOARD_NRF21540DK
Expand Down
13 changes: 0 additions & 13 deletions samples/matter/template/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,6 @@ endif # BOARD_NRF54L15DK

endif # BOOTLOADER_MCUBOOT

if SOC_SERIES_NRF54HX

config SUIT_ENVELOPE
default y

config SUIT_BUILD_FLASH_COMPANION
default y

config SUIT_MULTI_IMAGE_PACKAGE_BUILD
default y if MATTER_OTA

endif # SOC_SERIES_NRF54HX

#### Enable generating factory data
config MATTER_FACTORY_DATA_GENERATE
default y if !BOARD_NRF21540DK
Expand Down
11 changes: 10 additions & 1 deletion sysbuild/Kconfig.matter
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
menuconfig MATTER
bool "Matter"
depends on ZEPHYR_CONNECTEDHOMEIP_MODULE
# Matter requires at least one DFU transport so we always need to have SUIT mechanisms for nRF54H series
select SUIT_ENVELOPE if SOC_SERIES_NRF54HX
select SUIT_BUILD_FLASH_COMPANION if SOC_SERIES_NRF54HX
select SUIT_MULTI_IMAGE_PACKAGE_BUILD if MATTER_OTA && SOC_SERIES_NRF54HX
select SUIT_ENVELOPE_NORDIC_TOP_EXTRACT_PAYLOADS_TO_CACHE if SUIT_ENVELOPE_NORDIC_TOP_DIRECTORY != "" && SOC_SERIES_NRF54HX

if MATTER

Expand Down Expand Up @@ -37,7 +42,11 @@ config MATTER_OTA_IMAGE_FILE_NAME
help
Provides the file name of the generated Matter OTA image in the build directory.

if SOC_SERIES_NRF54HX

# Set the default value of manifest variant dedicated to Matter
config SUIT_BASE_MANIFEST_VARIANT
default "matter/v1"

endif
endif # SOC_SERIES_NRF54HX
endif # MATTER

0 comments on commit 491b885

Please sign in to comment.