Skip to content

Commit

Permalink
samples: matter: bootloader size optimizations
Browse files Browse the repository at this point in the history
Add LTO and size optimization configs for mcuboot and remove
redundant configs.
Set mcuboot size to `0xD000` for nRF54Lxx
Remove PDK overlays.

Signed-off-by: Maciej Baczmanski <[email protected]>
  • Loading branch information
maciejbaczmanski committed Dec 3, 2024
1 parent ebfa915 commit 9063c92
Show file tree
Hide file tree
Showing 34 changed files with 250 additions and 564 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,13 @@ Matter samples
* Updated all Matter samples that support low-power mode to enable the :ref:`lib_ram_pwrdn` feature.
It is enabled by default for the release configuration of the :ref:`matter_lock_sample`, :ref:`matter_light_switch_sample`, :ref:`matter_smoke_co_alarm_sample`, and :ref:`matter_window_covering_sample` samples.

* Updated:

* All Matter samples that support low-power mode to enable the :ref:`lib_ram_pwrdn` feature.
It is enabled by default for the release configuration of the :ref:`matter_lock_sample`, :ref:`matter_light_switch_sample`, :ref:`matter_smoke_co_alarm_sample`, and :ref:`matter_window_covering_sample` samples.

* The ``pm_static`` configuration for the :ref:`zephyr:nrf54l15dk_nrf54l15` board target, increasing MCUboot size to enable the ED25519 signature type.

* :ref:`matter_template_sample` sample:

* Updated the internal configuration for the :ref:`zephyr:nrf54l15dk_nrf54l15` target to use the DFU image compression and provide more memory space for the application.
Expand Down
26 changes: 13 additions & 13 deletions samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
mcuboot:
address: 0x0
region: flash_primary
size: 0xc000
size: 0xD000
mcuboot_pad:
address: 0xc000
address: 0xD000
region: flash_primary
size: 0x800
app:
address: 0xc800
address: 0xD800
region: flash_primary
size: 0x165800
size: 0x164800
mcuboot_primary:
orig_span: &id001
- mcuboot_pad
- app
span: *id001
address: 0xc000
address: 0xD000
region: flash_primary
size: 0x166000
size: 0x165000
mcuboot_primary_app:
orig_span: &id002
- app
span: *id002
address: 0xc800
address: 0xD800
region: flash_primary
size: 0x165800
size: 0x164800
factory_data:
address: 0x172000
region: flash_primary
size: 0x1000
settings_storage:
address: 0x173000
region: flash_primary
size: 0xa000
size: 0xA000
mcuboot_secondary:
address: 0x0
orig_span: &id003
- mcuboot_secondary_pad
- mcuboot_secondary_app
region: external_flash
size: 0x166000
size: 0x165000
span: *id003
mcuboot_secondary_pad:
region: external_flash
Expand All @@ -48,9 +48,9 @@ mcuboot_secondary_pad:
mcuboot_secondary_app:
region: external_flash
address: 0x800
size: 0x165800
size: 0x164800
external_flash:
address: 0x166000
size: 0x69a000
address: 0x165000
size: 0x69B000
device: MX25R64
region: external_flash
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
mcuboot:
address: 0x0
region: flash_primary
size: 0xc000
size: 0xD000
mcuboot_pad:
address: 0xc000
address: 0xD000
region: flash_primary
size: 0x800
tfm:
address: 0xc800
address: 0xD800
region: flash_primary
size: 0x1F800
app:
address: 0x2C000
address: 0x2D000
region: flash_primary
size: 0x13E000
size: 0x13D000
factory_data:
address: 0x16A000
region: flash_primary
size: 0x1000
settings_storage:
address: 0x16B000
region: flash_primary
size: 0xa000
size: 0xA000
tfm_storage:
address: 0x175000
orig_span: &id006
Expand All @@ -33,8 +33,8 @@ tfm_storage:
size: 0x8000
span: *id006
external_flash:
address: 0x15E000
size: 0x6A2000
address: 0x15D000
size: 0x6A3000
device: MX25R64
region: external_flash
### Bootloader configuration
Expand All @@ -44,24 +44,24 @@ mcuboot_primary:
- tfm
- app
span: *id001
address: 0xc000
address: 0xD000
region: flash_primary
size: 0x15E000
size: 0x15D000
mcuboot_primary_app:
orig_span: &id002
- app
- tfm
span: *id002
address: 0xc800
address: 0xD800
region: flash_primary
size: 0x15D800
size: 0x15C800
mcuboot_secondary:
address: 0x0
orig_span: &id003
- mcuboot_secondary_pad
- mcuboot_secondary_app
region: external_flash
size: 0x15E000
size: 0x15D000
span: *id003
mcuboot_secondary_pad:
region: external_flash
Expand All @@ -70,22 +70,22 @@ mcuboot_secondary_pad:
mcuboot_secondary_app:
region: external_flash
address: 0x800
size: 0x15D800
size: 0x15C800
### TFM configuration
tfm_secure:
address: 0xc000
address: 0xD000
orig_span: &id004
- mcuboot_pad
- tfm
region: flash_primary
size: 0x20000
span: *id004
tfm_nonsecure:
address: 0x2C000
address: 0x2D000
orig_span: &id005
- app
region: flash_primary
size: 0x13E000
size: 0x13D000
span: *id005
tfm_its:
address: 0x175000
Expand Down

This file was deleted.

This file was deleted.

7 changes: 5 additions & 2 deletions samples/matter/light_bulb/sysbuild/mcuboot/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ CONFIG_PM=n
CONFIG_FLASH=y
CONFIG_FPROTECT=y

CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h"

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y

Expand All @@ -37,3 +35,8 @@ CONFIG_MULTITHREADING=n
CONFIG_TICKLESS_KERNEL=n
CONFIG_TIMEOUT_64BIT=n
CONFIG_NRF_ENABLE_ICACHE=n
CONFIG_SIZE_OPTIMIZATIONS=y

# Activate LTO
CONFIG_LTO=y
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
mcuboot:
address: 0x0
region: flash_primary
size: 0xc000
size: 0xD000
mcuboot_pad:
address: 0xc000
address: 0xD000
region: flash_primary
size: 0x800
app:
address: 0xc800
address: 0xD800
region: flash_primary
size: 0x165800
size: 0x164800
mcuboot_primary:
orig_span: &id001
- mcuboot_pad
- app
span: *id001
address: 0xc000
address: 0xD000
region: flash_primary
size: 0x166000
size: 0x165000
mcuboot_primary_app:
orig_span: &id002
- app
span: *id002
address: 0xc800
address: 0xD800
region: flash_primary
size: 0x165800
size: 0x164800
factory_data:
address: 0x172000
region: flash_primary
size: 0x1000
settings_storage:
address: 0x173000
region: flash_primary
size: 0xa000
size: 0xA000
mcuboot_secondary:
address: 0x0
orig_span: &id003
- mcuboot_secondary_pad
- mcuboot_secondary_app
region: external_flash
size: 0x166000
size: 0x165000
span: *id003
mcuboot_secondary_pad:
region: external_flash
Expand All @@ -48,9 +48,9 @@ mcuboot_secondary_pad:
mcuboot_secondary_app:
region: external_flash
address: 0x800
size: 0x165800
size: 0x164800
external_flash:
address: 0x166000
size: 0x69a000
address: 0x165000
size: 0x69B000
device: MX25R64
region: external_flash
Loading

0 comments on commit 9063c92

Please sign in to comment.