-
Notifications
You must be signed in to change notification settings - Fork 714
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
[RFC] Hooks to support choosing image to boot in runtime #2161
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
57f882c
boot/zephyr: Fix SINGLE_APPLICATION_SLOT_RAM_LOAD file inclusion
edersondisouza a6f22e8
boot/bootutil: Get bootloader state
edersondisouza b04a37c
boot/bootutil: Make RAM loading methods public
edersondisouza ae5963b
boot: New boot_go hook
edersondisouza 6d59eaa
boot: Add flash area ID/device ID retrieval hooks
edersondisouza b987727
samples: Add a sample for runtime chosen image
edersondisouza 27c2202
samples/runtime-source: Make it buildable on twister
edersondisouza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
actually after having a talk with David about other issues I don't think this will work, @d3zd3z
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.
Hmm... why? My goal here is to have some state that can be prepared and passed to
boot_load_image_to_sram
without needing to exposestruct boot_loader_state
itself. I went with getting a static one instead of creating a new one to avoid allocation. Note that the one that matters to me is theboot_get_loader_state
atboot/zephyr/single_loader.c
- which is there just to be shared - instead of the one here at bootutil, which I only added for completeness.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.
Unfortunately I am not that fluent with the simulator, so unable to comment here.
@d3zd3z Do you find this to be a blocker? How should we deal with this, have you any insight?
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.
So the issue with the statics is that we want the state to be static on target, but only gotten at the top level and passed down. This is effectively just moving this definition from the zephyr-specific code, although I question then why the declaration remains within the Zephyr code as well.
I'm not quite sure I understand why this gets added here as well. If it does get moved to loader.c, we should remove the one in the Zephyr-specific code. I'm not quite I follow it yet, but it almost looks at this point as if we now have two copies of the state, one in a zephyr-specific file, and now one here.
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.
About having it on both
zephyr/single_loader.c
andloader.c
, remember that only one of the files is included on build, so there's no moving happening here.What I really need is a state on the
zephyr/single_loader.c
case (to be able to use RAM loading code), so there I both declare the static variable as well as the getter. On commonloader.c
, the static variable already exists, I just added the getter for consistency - if there's such a state, make it available.One can argue that
loader.c
getter "consistency" is not needed, as there's no users, and I can just drop this bit.