Skip to content

Commit 4b91989

Browse files
oyvindronningstadcarlescufi
authored andcommitted
[nrf noup] pm: Adapt to changes in partition manager
Use 'inside' and 'inherit_size'. Add KConfig-based size entries. Signed-off-by: Øyvind Rønningstad <[email protected]>
1 parent aebd4b9 commit 4b91989

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

boot/zephyr/include/sysflash/sysflash.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#if USE_PARTITION_MANAGER
77
#include <pm_config.h>
88

9-
#define FLASH_AREA_IMAGE_PRIMARY PM_MCUBOOT_PARTITIONS_PRIMARY_ID
10-
#define FLASH_AREA_IMAGE_SECONDARY PM_MCUBOOT_PARTITIONS_SECONDARY_ID
9+
#define FLASH_AREA_IMAGE_PRIMARY PM_MCUBOOT_PRIMARY_ID
10+
#define FLASH_AREA_IMAGE_SECONDARY PM_MCUBOOT_SECONDARY_ID
1111
#define FLASH_AREA_IMAGE_SCRATCH PM_MCUBOOT_SCRATCH_ID
1212

1313
#else

boot/zephyr/pm.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
1-
# The size of this partition is defined by the kconfig symbol
2-
# CONFIG_PM_PARTITION_SIZE_MCUBOOT
1+
#include <autoconf.h>
2+
33
mcuboot:
4+
size: CONFIG_PM_PARTITION_SIZE_MCUBOOT
45
placement:
5-
# MCUboot must be placed in front of 'mcuboot_pad'.
6-
before: [mcuboot_pad]
6+
before: [mcuboot_primary]
7+
8+
mcuboot_primary_app:
9+
# All images to be placed in MCUboot's slot 0 should be placed in this
10+
# partition
11+
span: [app]
712

8-
mcuboot_partitions:
9-
# Define a set of sub-partitions which spans over 'mcuboot_pad', 'spm' and
10-
# 'app' if both are present. If only 'app' is present, then these partitions
11-
# will only span across that partition.
12-
# The sub partitions share the size of the parent partition(s) equally.
13-
sub_partitions: [primary, secondary]
14-
span: [mcuboot_pad, spm, app]
13+
mcuboot_primary:
14+
span: [mcuboot_pad, mcuboot_primary_app]
15+
16+
mcuboot_secondary:
17+
share_size: [mcuboot_primary]
18+
placement:
19+
after:
20+
[mcuboot_primary]
1521

16-
# The size of this partition is defined by the kconfig symbol
17-
# CONFIG_PM_PARTITION_SIZE_MCUBOOT_SCRATCH
1822
mcuboot_scratch:
23+
size: CONFIG_PM_PARTITION_SIZE_MCUBOOT_SCRATCH
1924
placement:
2025
after: [app]
2126

22-
# The size of this partition is defined by the kconfig symbol
23-
# CONFIG_PM_PARTITION_SIZE_MCUBOOT_STORAGE
2427
mcuboot_storage:
28+
size: CONFIG_PM_PARTITION_SIZE_MCUBOOT_STORAGE
2529
placement:
2630
after: [mcuboot_scratch]
2731

2832
# Padding placed before image to boot
2933
mcuboot_pad:
3034
# MCUboot pad must be placed before the 'spm' partition if that is present.
3135
# If 'spm' partition is not present, it must be placed before the 'app'.
36+
size: CONFIG_PM_PARTITION_SIZE_MCUBOOT_PAD
3237
placement:
33-
before: [spm, app]
38+
before: [mcuboot_primary_app]

0 commit comments

Comments
 (0)