Skip to content

Commit

Permalink
samples: matter: rework PM static partitions for nRF54L
Browse files Browse the repository at this point in the history
* enabled mx25r64 external flash over SPI for Matter samples
* added pm_static* files that configures static memory map with
  MCUboot secondary slot residing on the external flash
* added initial MCUboot configuration to support DFU
* provided default/debug and release variants for every sample
* left the pm_static file with internal flash only for the
  template sample as a reference for dual bank DFU with no
  external flash
* updated documentation to describe supported DFU variants

Signed-off-by: Marcin Kajor <[email protected]>
  • Loading branch information
markaj-nordic committed May 28, 2024
1 parent 5f4c331 commit 55a3e59
Show file tree
Hide file tree
Showing 67 changed files with 1,122 additions and 466 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,6 @@ Matter samples
* :ref:`matter_thermostat_sample` sample.
* :ref:`matter_window_covering_sample` sample.

DFU support for the nRF54L15 PDK is available only for the ``release`` build type.

* Enabled the Bluetooth® LE Extended Announcement feature for all samples, and increased advertising timeout from 15 minutes to 1 hour.

* :ref:`matter_lock_sample` sample:
Expand Down
7 changes: 2 additions & 5 deletions samples/matter/light_bulb/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ config MATTER_FACTORY_DATA
default y if !BOARD_NRF21540DK

choice BOOTLOADER
default BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK && !BOARD_NRF54L15PDK_NRF54L15_CPUAPP
default BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK
endchoice

config PARTITION_MANAGER
default n if BOARD_NRF54L15PDK_NRF54L15_CPUAPP

if BOOTLOADER_MCUBOOT

config DFU_MULTI_IMAGE_PACKAGE_BUILD
Expand Down Expand Up @@ -58,6 +55,6 @@ endif # BOOTLOADER_MCUBOOT
endif # (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP)

config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP
default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF54L15PDK_NRF54L15_CPUAPP

source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
4 changes: 0 additions & 4 deletions samples/matter/light_bulb/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ Device Firmware Upgrade support
:start-after: matter_door_lock_sample_build_with_dfu_start
:end-before: matter_door_lock_sample_build_with_dfu_end

.. include:: ../template/README.rst
:start-after: matter_template_nrf54l15_build_with_dfu_start
:end-before: matter_template_nrf54l15_build_with_dfu_end

FEM support
===========

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
# Multirole is the only currently supported role by SoftDevice.
CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y

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

CONFIG_FPU=n
CONFIG_PM=n
CONFIG_HWINFO_NRF=n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
*/

/ {
aliases {
factory-data = &factory_data;
factory-data-memory-region = &rram0;

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

aliases {
// Configure PWM module for led1 (LED2 on the board)
pwm-led1 = &pwm_led1;

Expand All @@ -24,34 +26,8 @@
};
};

/delete-node/ &rram0;

&rram_controller {
reg = < 0x5004b000 0x17d000 >;

rram0: rram@0 {
compatible = "soc-nv-flash";
erase-block-size = < 0x1000 >;
write-block-size = < 0x10 >;
reg = < 0x0 0x17d000 >;
partitions {
compatible = "fixed-partitions";
#address-cells = < 0x1 >;
#size-cells = < 0x1 >;
slot0_partition: partition@0 {
label = "image-0";
reg = < 0x0 0x174000 >;
};
factory_data: partition@174000 {
label = "factory-data";
reg = < 0x174000 0x1000 >;
};
storage_partition: partition@175000 {
label = "storage";
reg = < 0x175000 0x8000 >;
};
};
};
&mx25r64 {
status = "okay";
};

&pwm20 {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};

aliases {
// Configure PWM module for led1 (LED2 on the board)
pwm-led1 = &pwm_led1;

// Use watchdog wdt31 as the application watchdog
watchdog0 = &wdt31;
};

pwmleds {
compatible = "pwm-leds";
pwm_led1: pwm_led_1 {
pwms = <&pwm20 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
};
};
};

&mx25r64 {
status = "okay";
};

&pwm20 {
status = "okay";
pinctrl-0 = <&pwm_default>;
pinctrl-1 = <&pwm_sleep>;
pinctrl-names = "default", "sleep";
};

&pinctrl {
pwm_default: pwm_default {
group1 {
psels = <NRF_PSEL(PWM_OUT1, 1, 8)>;
};
};
pwm_sleep: pwm_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT1, 1, 8)>;
low-power-enable;
};
};
};

&wdt31 {
status = "okay";
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@


/ {
aliases {
factory-data = &factory_data;
factory-data-memory-region = &rram0;
chosen {
nordic,pm-ext-flash = &mx25r64;
};

aliases {
// Configure PWM module for led1 (LED2 on the board)
pwm-led1 = &pwm_led1;

Expand All @@ -25,34 +26,8 @@
};
};

/delete-node/ &rram0;

&rram_controller {
reg = < 0x5004b000 0x17d000 >;

rram0: rram@0 {
compatible = "soc-nv-flash";
erase-block-size = < 0x1000 >;
write-block-size = < 0x10 >;
reg = < 0x0 0x17d000 >;
partitions {
compatible = "fixed-partitions";
#address-cells = < 0x1 >;
#size-cells = < 0x1 >;
slot0_partition: partition@0 {
label = "image-0";
reg = < 0x0 0x174000 >;
};
factory_data: partition@174000 {
label = "factory-data";
reg = < 0x174000 0x1000 >;
};
storage_partition: partition@175000 {
label = "storage";
reg = < 0x175000 0x8000 >;
};
};
};
&mx25r64 {
status = "okay";
};

&pwm20 {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/


/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};

aliases {
// Configure PWM module for led1 (LED2 on the board)
pwm-led1 = &pwm_led1;

// Use watchdog wdt31 as the application watchdog
watchdog0 = &wdt31;
};

pwmleds {
compatible = "pwm-leds";
pwm_led1: pwm_led_1 {
pwms = <&pwm20 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
};
};
};

&mx25r64 {
status = "okay";
};

&pwm20 {
status = "okay";
pinctrl-0 = <&pwm_default>;
pinctrl-1 = <&pwm_sleep>;
pinctrl-names = "default", "sleep";
};

&pinctrl {
pwm_default: pwm_default {
group1 {
psels = <NRF_PSEL(PWM_OUT1, 1, 10)>;
};
};
pwm_sleep: pwm_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT1, 1, 10)>;
low-power-enable;
};
};
};

&wdt31 {
status = "okay";
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# Multirole is the only currently supported role by SoftDevice.
CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y

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

CONFIG_FPU=n
CONFIG_PM=n
CONFIG_HWINFO_NRF=n
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
mcuboot:
address: 0x0
region: flash_primary
size: 0xc000
mcuboot_pad:
address: 0xc000
region: flash_primary
size: 0x800
app:
address: 0xc800
region: flash_primary
size: 0x167800
mcuboot_primary:
orig_span: &id001
- mcuboot_pad
- app
span: *id001
address: 0xc000
region: flash_primary
size: 0x168000
mcuboot_primary_app:
orig_span: &id002
- app
span: *id002
address: 0xc800
region: flash_primary
size: 0x167800
factory_data:
address: 0x174000
region: flash_primary
size: 0x1000
settings_storage:
address: 0x175000
region: flash_primary
size: 0x8000
mcuboot_secondary:
address: 0x0
orig_span: &id003
- mcuboot_secondary_pad
- mcuboot_secondary_app
region: external_flash
size: 0x168000
span: *id003
mcuboot_secondary_pad:
region: external_flash
address: 0x0
size: 0x800
mcuboot_secondary_app:
region: external_flash
address: 0x800
size: 0x167800
external_flash:
address: 0x168000
size: 0x698000
device: MX25R64
region: external_flash
Loading

0 comments on commit 55a3e59

Please sign in to comment.