Hi!
We are currently migrating our SD-based SDK code to Zephyr, on nrf52833 boards.
While we have finally been able to get MCUBoot (CONFIG_BOOTLOADER_MCUBOOT=y) to run with a static partition file, we consistently get the following log on runtime, and the app is never started:
00> *** Booting Zephyr OS build v3.2.99-ncs1 ***
00> I: Starting bootloader
00> W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=128 - too small?
00> W: Cannot upgrade: not a compatible amount of sectors
00> E: Unable to find bootable image
I have a few questions regarding this:
- I have created the partition manager file (pm_static.yml) from the original build of our project, and added partitions to match our dts overlay (both are at bottom). The default setup causes s.t. the bootloader. which is much smaller than the default of 0xC000 = 48 KB for MCUboot, to sit apart from the mcuboot_pad and the app more than needed (see picture from nrfConnect Programmer below). What is the correct way to work with this?
- If I try to remove the mcuboot_pad totally, I consistently receive a failure of the static partition manager on build: "Partition manager failed: End of last partition is after last valid address". Why is this? Is the pad a must?
- In the default partition manager (As you can see below), alignment is consistently used ("align: start: 0x1000"). Is there a specific reason for this?
- The big one - what is the reason that the aforementioned mcuboot print is received?
Thanks ahead of time!
Roi
pm_static.yml:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
app:
address: 0xc200
end_address: 0x3e000
region: flash_primary
size: 0x31e00
mcuboot:
address: 0x0
end_address: 0xc000
placement:
before:
- mcuboot_primary
region: flash_primary
size: 0xc000
mcuboot_pad:
address: 0xc000
end_address: 0xc200
placement:
align:
start: 0x1000
before:
- mcuboot_primary_app
dts overlay:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/delete-node/ &storage_partition;
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0xC000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x32000>;
};
slot1_partition: partition@3e000 {
label = "image-1";
reg = <0x0003E000 0x32000>;
};
scratch_partition: partition@70000 {
mcuboot.conf (merged via edit to CMakeLists):
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
CONFIG_DISABLE_FLASH_PATCH=y
CONFIG_BOOT_SIGNATURE_KEY_FILE="/mcuboot/skey.pem"
CONFIG_UART_CONSOLE=n
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_PRINTK=n
CONFIG_LOG_PRINTK=n
CONFIG_STDOUT_CONSOLE=n
CONFIG_RTT_CONSOLE=y
CONFIG_BOOT_BANNER=y
CONFIG_USE_SEGGER_RTT=y