From 80687f3dac0e1e3c1bcf2ee2492faf80d105dc0c Mon Sep 17 00:00:00 2001 From: Maciej Baczmanski Date: Mon, 2 Dec 2024 09:19:40 +0100 Subject: [PATCH] samples: matter: bootloader size optimizations 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 --- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- .../light_bulb/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- .../light_switch/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- samples/matter/lock/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- .../smoke_co_alarm/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...ic_nrf54l15dk_nrf54l15_cpuapp_internal.yml | 30 ++++++++-------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- .../matter/template/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- .../thermostat/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- .../window_covering/sysbuild/mcuboot/prj.conf | 7 ++-- 33 files changed, 243 insertions(+), 564 deletions(-) delete mode 100644 samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay diff --git a/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ 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 @@ -32,14 +32,14 @@ factory_data: 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 @@ -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 diff --git a/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ 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 @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -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 @@ -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 @@ -70,10 +70,10 @@ 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 @@ -81,11 +81,11 @@ tfm_secure: 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 diff --git a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/light_bulb/sysbuild/mcuboot/prj.conf b/samples/matter/light_bulb/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/light_bulb/sysbuild/mcuboot/prj.conf +++ b/samples/matter/light_bulb/sysbuild/mcuboot/prj.conf @@ -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 @@ -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 diff --git a/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ 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 @@ -32,14 +32,14 @@ factory_data: 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 @@ -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 diff --git a/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ 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 @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -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 @@ -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 @@ -70,10 +70,10 @@ 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 @@ -81,11 +81,11 @@ tfm_secure: 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 diff --git a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/light_switch/sysbuild/mcuboot/prj.conf b/samples/matter/light_switch/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/light_switch/sysbuild/mcuboot/prj.conf +++ b/samples/matter/light_switch/sysbuild/mcuboot/prj.conf @@ -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 @@ -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 diff --git a/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ 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 @@ -32,14 +32,14 @@ factory_data: 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 @@ -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 diff --git a/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ 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 @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -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 @@ -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 @@ -70,10 +70,10 @@ 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 @@ -81,11 +81,11 @@ tfm_secure: 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 diff --git a/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/lock/sysbuild/mcuboot/prj.conf b/samples/matter/lock/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/lock/sysbuild/mcuboot/prj.conf +++ b/samples/matter/lock/sysbuild/mcuboot/prj.conf @@ -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 @@ -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 diff --git a/samples/matter/smoke_co_alarm/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/smoke_co_alarm/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/smoke_co_alarm/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/smoke_co_alarm/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ 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 @@ -32,14 +32,14 @@ factory_data: 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 @@ -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 diff --git a/samples/matter/smoke_co_alarm/sysbuild/mcuboot/prj.conf b/samples/matter/smoke_co_alarm/sysbuild/mcuboot/prj.conf index ac67aa9b15d9..17b3e8b90ff3 100644 --- a/samples/matter/smoke_co_alarm/sysbuild/mcuboot/prj.conf +++ b/samples/matter/smoke_co_alarm/sysbuild/mcuboot/prj.conf @@ -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 @@ -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 diff --git a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ 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 @@ -32,14 +32,14 @@ factory_data: 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 @@ -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 diff --git a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml index 1b34a86cb297..a73ddb883041 100644 --- a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml +++ b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml @@ -1,32 +1,32 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xa000 + size: 0xD000 mcuboot_pad: - address: 0xa000 + address: 0xD000 region: flash_primary size: 0x800 app: - address: 0xa800 + address: 0xD800 region: flash_primary - size: 0xd6800 + size: 0xD4800 mcuboot_primary: - address: 0xa000 + address: 0xD000 orig_span: &id001 - app - mcuboot_pad region: flash_primary - size: 0xd7000 + size: 0xD5000 span: *id001 mcuboot_primary_app: - address: 0xa800 + address: 0xD800 orig_span: &id002 - app region: flash_primary - size: 0xd6800 + size: 0xD4800 span: *id002 mcuboot_secondary: - address: 0xe1000 + address: 0xE2000 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app @@ -35,17 +35,17 @@ mcuboot_secondary: span: *id003 mcuboot_secondary_pad: region: flash_primary - address: 0xe1000 + address: 0xE2000 size: 0x800 mcuboot_secondary_app: region: flash_primary - address: 0xe1800 - size: 0x8f800 + address: 0xE2800 + size: 0x8F800 factory_data: - address: 0x171000 + address: 0x172000 region: flash_primary size: 0x1000 settings_storage: - address: 0x172000 + address: 0x173000 region: flash_primary - size: 0xb000 + size: 0xA000 diff --git a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ 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 @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -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 @@ -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 @@ -70,10 +70,10 @@ 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 @@ -81,11 +81,11 @@ tfm_secure: 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 diff --git a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/template/sysbuild/mcuboot/prj.conf b/samples/matter/template/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/template/sysbuild/mcuboot/prj.conf +++ b/samples/matter/template/sysbuild/mcuboot/prj.conf @@ -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 @@ -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 diff --git a/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ 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 @@ -32,14 +32,14 @@ factory_data: 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 @@ -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 diff --git a/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ 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 @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -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 @@ -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 @@ -70,10 +70,10 @@ 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 @@ -81,11 +81,11 @@ tfm_secure: 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 diff --git a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/thermostat/sysbuild/mcuboot/prj.conf b/samples/matter/thermostat/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/thermostat/sysbuild/mcuboot/prj.conf +++ b/samples/matter/thermostat/sysbuild/mcuboot/prj.conf @@ -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 @@ -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 diff --git a/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ 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 @@ -32,14 +32,14 @@ factory_data: 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 @@ -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 diff --git a/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ 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 @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -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 @@ -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 @@ -70,10 +70,10 @@ 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 @@ -81,11 +81,11 @@ tfm_secure: 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 diff --git a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/window_covering/sysbuild/mcuboot/prj.conf b/samples/matter/window_covering/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/window_covering/sysbuild/mcuboot/prj.conf +++ b/samples/matter/window_covering/sysbuild/mcuboot/prj.conf @@ -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 @@ -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