Skip to content

Commit fce4dac

Browse files
adsz-nordiccarlescufi
authored andcommitted
[nrf noup] boot: zephyr: Fix for partition alignment
Fix partition alignment generated by Partition Manager when fprotect is not enabled. Ref: NCSDK-38833 Signed-off-by: Adam Szczygieł <adam.szczygiel@nordicsemi.no> (cherry picked from commit 669034e)
1 parent 28b8a69 commit fce4dac

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

boot/zephyr/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,4 +1527,9 @@ config NCS_MCUBOOT_IMG_VALIDATE_ATTEMPT_WAIT_MS
15271527
Time between image validation attempts, in milliseconds.
15281528
Allows for recovery from transient bit flips or similar situations.
15291529

1530+
config PM_APP_ALIGNMENT
1531+
hex
1532+
default 0x1000 if SOC_SERIES_NRF54L
1533+
default FPROTECT_BLOCK_SIZE
1534+
15301535
source "Kconfig.zephyr"

boot/zephyr/pm.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ mcuboot_secondary:
2525
align: {start: 4}
2626
#else
2727
placement:
28-
align: {start: CONFIG_FPROTECT_BLOCK_SIZE}
29-
align_next: CONFIG_FPROTECT_BLOCK_SIZE # Ensure that the next partition does not interfere with this image
28+
align: {start: CONFIG_PM_APP_ALIGNMENT}
29+
align_next: CONFIG_PM_APP_ALIGNMENT # Ensure that the next partition does not interfere with this image
3030
after: mcuboot_primary
3131
#endif /* CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY */
3232

@@ -42,7 +42,7 @@ mcuboot_secondary_pad:
4242
share_size: mcuboot_pad
4343
placement:
4444
after: mcuboot_primary
45-
align: {start: CONFIG_FPROTECT_BLOCK_SIZE}
45+
align: {start: CONFIG_PM_APP_ALIGNMENT}
4646

4747
mcuboot_secondary_app:
4848
share_size: mcuboot_primary_app
@@ -59,7 +59,7 @@ mcuboot_scratch:
5959
size: CONFIG_PM_PARTITION_SIZE_MCUBOOT_SCRATCH
6060
placement:
6161
after: app
62-
align: {start: CONFIG_FPROTECT_BLOCK_SIZE}
62+
align: {start: CONFIG_PM_APP_ALIGNMENT}
6363
#endif /* CONFIG_BOOT_SWAP_USING_SCRATCH */
6464

6565
# Padding placed before image to boot. This reserves space for the MCUboot image header
@@ -71,7 +71,7 @@ mcuboot_pad:
7171
placement:
7272
before: [mcuboot_primary_app]
7373
#ifdef CONFIG_FPROTECT
74-
align: {start: CONFIG_FPROTECT_BLOCK_SIZE}
74+
align: {start: CONFIG_PM_APP_ALIGNMENT}
7575
#endif
7676

7777
#if (CONFIG_NRF53_MCUBOOT_PRIMARY_1_RAM_FLASH)
@@ -86,7 +86,7 @@ mcuboot_secondary_1:
8686
region: external_flash
8787
#else
8888
placement:
89-
align: {start: CONFIG_FPROTECT_BLOCK_SIZE}
89+
align: {start: CONFIG_PM_APP_ALIGNMENT}
9090
after: mcuboot_secondary
9191
#endif
9292
size: CONFIG_NRF53_RAM_FLASH_SIZE

0 commit comments

Comments
 (0)