Add new utils for descriptors#11
Merged
madeleyneVaca merged 2 commits intoJun 11, 2025
Merged
Conversation
If an EC configures the flexspi during application code, memory mapped reads like are done in get_active_slot and get_app_at_slot may not return the proper data. This commit adds utils to get the app slot number and the app descriptors base address. Application code can read the descriptor region into a buffer and then use AppImageDescriptor::from_region with that buffer and the slot number
d803a92 to
6278f0d
Compare
JamesHuard
reviewed
Jun 9, 2025
f7e5fdd to
8c4d25b
Compare
JamesHuard
previously approved these changes
Jun 10, 2025
Contributor
JamesHuard
left a comment
There was a problem hiding this comment.
think you've got some clippy warnings around documentation
8c4d25b to
d598e9e
Compare
Adds from_region to allow a user to build the boot descriptors from a provided buffer instead of utilizing memory-mapped reads at an address. This is useful in case application code has already configured the flexspi module as not all configs will read bits in the same was as the FCB. Because of the pointer arithmetic in locating the app descriptors, this function is considered unsafe as special care MUST be given to the buffer argument to avoid invalid memory access. Adds from_header_and_app_regions to allow a user to build the boot descriptors from two small buffers containing the bytes for the header and the bytes for the app descriptors separately. This is useful in case these chunks are not contiguous in memory.
d598e9e to
a79470d
Compare
felipebalbi
approved these changes
Jun 10, 2025
tullom
approved these changes
Jun 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If an EC configures the flexspi during application code, memory mapped reads like are done in get_active_slot and get_app_at_slot may not return the proper data. This commit adds utils to get the necessary info to be able to read the right section of memory into a buffer(s) (not memory mapped; i.e. something like a flash driver) and then construct the descriptors directly from the buffer(s).