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 17, 2024
1 parent 02cd095 commit 42224d9
Show file tree
Hide file tree
Showing 65 changed files with 1,068 additions and 443 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,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 target.

* :ref:`matter_lock_sample` sample:

* Added support for emulation of the nRF7001 Wi-Fi companion IC on the nRF7002 DK.
Expand Down
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 @@ -8,12 +8,10 @@
chosen {
zephyr,console = &uart30;
zephyr,shell-uart = &uart30;
nordic,pm-ext-flash = &mx25r64;
};

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

// Configure PWM module for led1 (LED2 on the board)
pwm-led1 = &pwm_led1;
};
Expand All @@ -26,37 +24,11 @@
};
};

/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 >;
};
};
};
&uart30 {
status = "okay";
};

&uart30 {
&mx25r64 {
status = "okay";
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* 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;
};

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;
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
chosen {
zephyr,console = &uart30;
zephyr,shell-uart = &uart30;
nordic,pm-ext-flash = &mx25r64;
};

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

// Configure PWM module for led1 (LED2 on the board)
pwm-led1 = &pwm_led1;
};
Expand All @@ -27,37 +25,11 @@
};
};

/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 >;
};
};
};
&uart30 {
status = "okay";
};

&uart30 {
&mx25r64 {
status = "okay";
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* 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;
};

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;
};
};
};
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,17 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# TODO: Workaround Fprotect is not supported on nRF54l15 yet.
CONFIG_FPROTECT=n
# TODO: Workaround, disable memory guard to avoid false faults in application after boot
CONFIG_HW_STACK_PROTECTION=n

CONFIG_BOOT_WATCHDOG_FEED=n

CONFIG_GPIO=y

# Adjust the maximum sectors to the app image size of ~1.4MB
CONFIG_BOOT_MAX_IMG_SECTORS=512
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

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

&mx25r64 {
status = "okay";
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ CONFIG_FPROTECT=n
CONFIG_HW_STACK_PROTECTION=n

CONFIG_BOOT_WATCHDOG_FEED=n

CONFIG_GPIO=y

# Adjust the maximum sectors to the app image size of ~1.4MB
CONFIG_BOOT_MAX_IMG_SECTORS=512
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

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

&mx25r64 {
status = "okay";
};
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 42224d9

Please sign in to comment.