-
Notifications
You must be signed in to change notification settings - Fork 707
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
Increase minimum flash write #949
Changes from 8 commits
61e4980
dc17403
694f13a
e757f7b
b0fd6c5
d0378c8
dea04b6
417781c
3edc773
4f9e089
b37ec96
78871c7
55e3d5d
81bc531
35b305d
15138f6
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 |
---|---|---|
|
@@ -139,16 +139,24 @@ struct boot_status { | |
* | Encryption key 0 (16 octets) [*] | | ||
* | | | ||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
* | 0xff padding as needed (BOOT_MAX_ALIGN - 16 EK0 octets) [*] | | ||
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. EK0? 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 believe it stands for Encryption Key 0. In #1217 I've proposed a different layout in an attempt to making it easier to understand. |
||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
* | Encryption key 1 (16 octets) [*] | | ||
* | | | ||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
* | 0xff padding as needed (BOOT_MAX_ALIGN - 16 EK1 octets) [*] | | ||
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. EK1? |
||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
* | Swap size (4 octets) | | ||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
* | Swap info | 0xff padding (7 octets) | | ||
* | 0xff padding as needed (BOOT_MAX_ALIGN - 4 Swap Size octets) | | ||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
* | Swap info | 0xff padding (BOOT_MAX_ALIGN - 1 octets) | | ||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
* | Copy done | 0xff padding (7 octets) | | ||
* | Copy done | 0xff padding (BOOT_MAX_ALIGN - 1 octets) | | ||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
* | Image OK | 0xff padding (7 octets) | | ||
* | Image OK | 0xff padding (BOOT_MAX_ALIGN - 1 octets) | | ||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
* | 0xff padding as needed (BOOT_MAX_ALIGN - 16 MAGIC octets) | | ||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
* | MAGIC (16 octets) | | ||
* | | | ||
|
@@ -214,17 +222,6 @@ _Static_assert(BOOT_IMAGE_NUMBER > 0, "Invalid value for BOOT_IMAGE_NUMBER"); | |
(hdr)->ih_ver.iv_revision, \ | ||
(hdr)->ih_ver.iv_build_num) | ||
|
||
/* | ||
* The current flashmap API does not check the amount of space allocated when | ||
* loading sector data from the flash device, allowing for smaller counts here | ||
* would most surely incur in overruns. | ||
* | ||
* TODO: make flashmap API receive the current sector array size. | ||
*/ | ||
#if BOOT_MAX_IMG_SECTORS < 32 | ||
#error "Too few sectors, please increase BOOT_MAX_IMG_SECTORS to at least 32" | ||
#endif | ||
|
||
#if MCUBOOT_SWAP_USING_MOVE | ||
#define BOOT_STATUS_MOVE_STATE_COUNT 1 | ||
#define BOOT_STATUS_SWAP_STATE_COUNT 2 | ||
|
@@ -243,8 +240,6 @@ _Static_assert(BOOT_IMAGE_NUMBER > 0, "Invalid value for BOOT_IMAGE_NUMBER"); | |
#define BOOT_STATUS_SOURCE_SCRATCH 1 | ||
#define BOOT_STATUS_SOURCE_PRIMARY_SLOT 2 | ||
|
||
#define BOOT_MAGIC_SZ (sizeof boot_img_magic) | ||
|
||
/** | ||
* Compatibility shim for flash sector type. | ||
* | ||
|
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.
Should we apply this same patch to https://github.com/mcu-tools/mcuboot/blob/main/boot/bootutil/src/bootutil_public.c#L149?