Compatibility issues of slots when using the scratch swap method #2533
Unanswered
TwoBrushes
asked this question in
Q&A
Replies: 1 comment
-
|
It won't do anything or work because 5KiB is not divisable by the 2KiB sector size |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Assuming that the primary slot has 64 sectors with a sector size of 1KB, the secondary slot has 32 sectors with a sector size of 2KB, and the scratch slot has 5 sectors with a sector size of 1KB (excluding the trailer size), the boot_slots_compatible(struct boot_loader_state *state) function should determine that the slots are compatible. Assuming the code is approximately 32KB, in the run_swap() function, sz = boot_copy_sz(state, last_sector_idx, &first_sector_idx), the return value of sz should be 5KB, since the sector indices in the input parameters are referenced to the primary slot. However, during the BOOT_STATUS_STATE_1 phase of the swap process, the secondary slot's sectors need to be erased. Since 5KB is not a boundary of the secondary slot, will erasing the secondary slot's sectors not erase the lower 1KB?
Beta Was this translation helpful? Give feedback.
All reactions