-
Notifications
You must be signed in to change notification settings - Fork 8k
stm32: mcuboot: add support for mcuboot tests and samples #93862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c65a97c
81c085b
062a2eb
8c240fa
920d124
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
zephyr,shell-uart = &usart2; | ||
zephyr,sram = &sram0; | ||
zephyr,flash = &flash0; | ||
zephyr,code-partition = &slot0_partition; | ||
}; | ||
|
||
leds: leds { | ||
|
@@ -167,6 +168,21 @@ | |
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
boot_partition: partition@0 { | ||
label = "mcuboot"; | ||
reg = <0x00000000 DT_SIZE_K(64)>; | ||
}; | ||
|
||
slot0_partition: partition@10000 { | ||
label = "image-0"; | ||
reg = <0x00010000 DT_SIZE_K(32)>; | ||
}; | ||
|
||
slot1_partition: partition@18000 { | ||
label = "image-1"; | ||
reg = <0x00018000 DT_SIZE_K(30)>; | ||
}; | ||
Comment on lines
+176
to
+184
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sizes are different? |
||
|
||
/* Set 2KB of storage at the end of 128KB flash */ | ||
storage_partition: partition@1f800 { | ||
label = "storage"; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
zephyr,flash = &flash0; | ||
zephyr,dtcm = &dtcm; | ||
zephyr,canbus = &can1; | ||
zephyr,code-partition = &slot0_partition; | ||
}; | ||
|
||
leds: leds { | ||
|
@@ -235,3 +236,31 @@ zephyr_udc0: &usbotg_fs { | |
&vbat { | ||
status = "okay"; | ||
}; | ||
|
||
&flash0 { | ||
partitions { | ||
compatible = "fixed-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
boot_partition: partition@0 { | ||
label = "mcuboot"; | ||
reg = <0x00000000 DT_SIZE_K(64)>; | ||
}; | ||
|
||
storage_partition: partition@10000 { | ||
label = "storage"; | ||
reg = <0x00010000 DT_SIZE_K(192)>; | ||
}; | ||
|
||
slot0_partition: partition@40000 { | ||
label = "image-0"; | ||
reg = <0x00040000 DT_SIZE_K(448)>; | ||
}; | ||
|
||
slot1_partition: partition@b0000 { | ||
label = "image-1"; | ||
reg = <0x000b0000 DT_SIZE_K(320)>; | ||
}; | ||
Comment on lines
+256
to
+264
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sizes are very different? If using different sizes then the extra sector should be in slot 1 and swap using offset should be used rather than swap using move There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your feedback. |
||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,17 +177,17 @@ stm32_lp_tick_source: &lptim1 { | |
|
||
boot_partition: partition@0 { | ||
label = "mcuboot"; | ||
reg = <0x00000000 DT_SIZE_K(34)>; | ||
reg = <0x00000000 DT_SIZE_K(64)>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 48KB is the minimum MCUboot partition size, Flash sectors are atmost 4KB on this SoC, so why give more to MCUboot? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just based it on how the nucleo_wba55cg was added, and also compared the sizes of the flash sectors/pages in the refman and adapted with the rest so that it worked on the tests. |
||
}; | ||
|
||
slot0_partition: partition@8800 { | ||
slot0_partition: partition@10000 { | ||
label = "image-0"; | ||
reg = <0x00008800 DT_SIZE_K(240)>; | ||
reg = <0x000010000 DT_SIZE_K(192)>; | ||
}; | ||
|
||
slot1_partition: partition@44800 { | ||
slot1_partition: partition@40000 { | ||
label = "image-1"; | ||
reg = <0x00044800 DT_SIZE_K(234)>; | ||
reg = <0x00040000 DT_SIZE_K(192)>; | ||
}; | ||
|
||
/* Set 4Kb of storage at the end of the 512Kb of flash */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't know what the sector size is but for nvs this would need to be at least 3 sectors to be usable