Skip to content

Commit 8392962

Browse files
samples: Fix FOTA for nRF54LM20
- Removed a wrong DTS configuration that changes the ROM/RAM sizes. - Modified Mcuboot files to support compression and internal-rom only. - Aligned sysbuild to support compression and internal-rom only for nRF54LM20 target. - Added readme note. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
1 parent b4056a6 commit 8392962

File tree

6 files changed

+62
-58
lines changed

6 files changed

+62
-58
lines changed

samples/light_switch/Kconfig.sysbuild

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ endif # SOC_SERIES_NRF53X
4545
if BOARD_NRF54LM20DK
4646

4747
config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK
48+
default n
49+
50+
config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
51+
default n
52+
53+
choice MCUBOOT_MODE
54+
default MCUBOOT_MODE_OVERWRITE_ONLY
55+
endchoice
56+
57+
config MCUBOOT_COMPRESSED_IMAGE_SUPPORT
4858
default y
4959

5060
endif # BOARD_NRF54LM20DK

samples/light_switch/README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ For example, when building from the command line, use the following command:
125125
Alternatively, you can :ref:`configure Zigbee FOTA manually <ug_zigbee_configuring_components_ota>`.
126126

127127
.. note::
128-
You can use the :file:`prj_fota.conf` file only with a development kit that contains the nRF52840, nRF5340, nRF54L15 or nRF54L10 SoC.
128+
You can use the :file:`prj_fota.conf` file only with the nRF52840, nRF5340, nRF54L15, nRF54L10, or nRF54LM20 SoC.
129+
The nRF54LM20 SoC does not use the external flash.
130+
All the images are stored in the internal flash with the compression enabled.
129131

130132
To activate the Multiprotocol Bluetooth LE extension, set :makevar:`EXTRA_CONF_FILE` to the :file:`overlay-multiprotocol_ble.conf`.
131133
For example, when building from the command line, use the following command:

samples/light_switch/boards/nrf54lm20dk_nrf54lm20a_cpuapp_fota.overlay

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
zephyr,zigbee-timer = &timer24;
1414
zephyr,code-partition = &slot0_partition;
1515
zephyr,ieee802154 = &ieee802154;
16-
nordic,pm-ext-flash = &mx25r64;
1716
};
1817

1918
pwmleds {
@@ -46,19 +45,6 @@
4645
};
4746
};
4847

49-
/* Restore full RRAM and SRAM */
50-
&cpuapp_rram {
51-
reg = <0x0 DT_SIZE_K(2036)>;
52-
};
53-
54-
&cpuapp_sram {
55-
reg = <0x20000000 DT_SIZE_K(512)>;
56-
};
57-
5848
&timer24 {
5949
status = "okay";
6050
};
61-
62-
&mx25r64 {
63-
status = "okay";
64-
};

samples/light_switch/sysbuild/mcuboot/boards/nrf54lm20dk_nrf54lm20a_cpuapp.conf

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,24 @@
77
CONFIG_HW_STACK_PROTECTION=n
88
CONFIG_BOOT_WATCHDOG_FEED=n
99

10-
# nRF54LM20DK uses SPI NOR external flash
11-
CONFIG_GPIO=y
12-
CONFIG_SPI=y
13-
CONFIG_SPI_NOR=y
14-
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
15-
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
16-
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
10+
# Disable all debug features
11+
CONFIG_ASSERT_VERBOSE=n
12+
CONFIG_ASSERT_NO_FILE_INFO=y
13+
CONFIG_PRINTK=n
14+
15+
# Bootloader size optimization to fit into 28 KB partition.
16+
# These options can be safely disabled because in this configuration,
17+
# the secondary slot resides in the internal RRAM, so features
18+
# needed to handle the external flash are not needed.
19+
CONFIG_SPI_NOR=n
20+
CONFIG_SPI=n
1721

1822
# Increase the maximum number of sectors to 512 to fit the big image size (> 1024 kB).
1923
CONFIG_BOOT_MAX_IMG_SECTORS=512
24+
25+
# Currently, without tickless kernel, the SYSCOUNTER value after the software
26+
# reset is not set properly and due to that the first system interrupt is not called
27+
# in the proper time - the SYSCOUNTER value is set to the value from before
28+
# reset + 1. Hence, the reboot time increases more and more.
29+
# To avoid it enable tickles kernel for mcuboot.
30+
CONFIG_TICKLESS_KERNEL=y

samples/light_switch/sysbuild/mcuboot/boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
*/
66

7-
/ {
8-
chosen {
9-
nordic,pm-ext-flash = &mx25r64;
10-
};
11-
};
12-
7+
/* Disable the external flash, as it's not needed
8+
* for the configuration with secondary slot residing
9+
* in the internal RRAM.
10+
*/
1311
&mx25r64 {
14-
status = "okay";
12+
status = "disabled";
1513
};

samples/light_switch/sysbuild/mcuboot/prj.conf

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,39 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
CONFIG_PM=n
87

98
CONFIG_MAIN_STACK_SIZE=10240
10-
CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h"
119

1210
CONFIG_BOOT_SWAP_SAVE_ENCTLV=n
13-
CONFIG_BOOT_ENCRYPT_IMAGE=n
14-
15-
CONFIG_BOOT_UPGRADE_ONLY=n
1611
CONFIG_BOOT_BOOTSTRAP=n
17-
18-
### mbedTLS has its own heap
19-
# CONFIG_HEAP_MEM_POOL_SIZE is not set
20-
21-
### We never want Zephyr's copy of tinycrypt. If tinycrypt is needed,
22-
### MCUboot has its own copy in tree.
23-
# CONFIG_TINYCRYPT is not set
24-
# CONFIG_TINYCRYPT_ECC_DSA is not set
25-
# CONFIG_TINYCRYPT_SHA256 is not set
12+
CONFIG_PM=n
2613

2714
CONFIG_FLASH=y
2815
CONFIG_FPROTECT=y
2916

30-
### Various Zephyr boards enable features that we don't want.
31-
# CONFIG_BT is not set
32-
# CONFIG_BT_CTLR is not set
33-
# CONFIG_I2C is not set
34-
35-
CONFIG_LOG=y
36-
CONFIG_LOG_MODE_MINIMAL=y # former CONFIG_MODE_MINIMAL
37-
### Ensure Zephyr logging changes don't use more resources
38-
CONFIG_LOG_DEFAULT_LEVEL=0
39-
### Use info log level by default
40-
CONFIG_MCUBOOT_LOG_LEVEL_INF=y
41-
### Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y
17+
# Bootloader size optimization
4218
CONFIG_CBPRINTF_NANO=y
43-
CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=0
44-
### Use the minimal C library to reduce flash usage
45-
CONFIG_MINIMAL_LIBC=y
19+
CONFIG_PRINTK=n
20+
CONFIG_CONSOLE=n
21+
CONFIG_SERIAL=n
22+
CONFIG_UART_CONSOLE=n
23+
CONFIG_USE_SEGGER_RTT=n
24+
CONFIG_GPIO=n
25+
26+
CONFIG_BOOT_MAX_IMG_SECTORS=256
27+
28+
CONFIG_LOG=n
29+
CONFIG_CONSOLE_HANDLER=n
30+
CONFIG_BOOT_BANNER=n
31+
CONFIG_NCS_BOOT_BANNER=n
32+
CONFIG_TIMESLICING=n
33+
CONFIG_RESET_ON_FATAL_ERROR=n
34+
CONFIG_MULTITHREADING=n
35+
CONFIG_TICKLESS_KERNEL=n
36+
CONFIG_TIMEOUT_64BIT=n
37+
CONFIG_NRF_ENABLE_ICACHE=n
38+
CONFIG_SIZE_OPTIMIZATIONS=y
39+
40+
# Activate LTO
41+
CONFIG_LTO=y
42+
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y

0 commit comments

Comments
 (0)