forked from mcu-tools/mcuboot
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Version number extraction #1
Open
lefebvresam
wants to merge
17
commits into
main
Choose a base branch
from
dev/get-version-number
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Twister now expects a yaml list of plaforms. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Updates to a newer version of the zephyr docker image Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Limits the modules that are checked out as part of zephyr to reduce storage space needed and CI run time Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Ensure that bootloader info and measurements are saved to retained memory when using mcuboot in single-image mode. Signed-off-by: Dane Wagner <dane.wagner@gmail.com>
passing user_sha parameters while creating compressed image Signed-off-by: Mateusz Michalek <mateusz.michalek@nordicsemi.no>
Adds default configuration for the frdm-mcxa156 board. Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
After a partial swap has been resumed and completed, the image headers are reloaded. The idea is that we want to update the bootloader state (boot_data) to properly reflect the new state of the slots: the image headers in the primary and secondary slots are now respectively the headers of the new and previous active image. However, the implementation was doing the exact opposite when swap-scratch was used, which could lead to erroneous behaviors such as a failure when validating the primary slot. Signed-off-by: Thomas Altenbach <thomas.altenbach@legrand.com>
Let's suppose after an upgrade you have a non-functional image in the primary slot. The image won't be confirmed, leading to a revert at next boot. At the beginning of the revert process, fixup_revert is invoked, which rewrites the trailer in the secondary slot so that the revert looks like a permanent upgrade. Normally, after the execution of this routine, the secondary slot has a valid trailer, in particular with a valid magic number. Let's imagine a power failure occurs during the writing of the trailer's magic, i.e. in boot_write_magic. The magic number in the secondary slot is in an undefined state and might be partially written, which implies at next boot it will be considered in BOOT_MAGIC_BAD state. So, at next boot, we have the following state: Primary slot: magic=good, copy-done=set, image-ok=unset Secondary slot: magic=bad, copy-done=unset, image-ok=set This doesn't match any state leading to an upgrade or revert process to be initiated, which means MCUboot will not perform the revert and attempt to boot from the primary slot, containing a non-functional image. Hence, the device is bricked unless it is possible to reflash the secondary slot without a functional image. To avoid this issue, a revert is performed no matter the state of the magic number in the secondary slot's trailer, provided the copy-done flag is set in the primary slot but the image-ok flag is not. The copy-done flag is set only after having completed an upgrade or revert process so if the copy-done flag is set but the image-ok is unset, it is guaranteed an upgrade has been performed but the new image has not been confirmed, which implies a revert is needed. Signed-off-by: Thomas Altenbach <thomas.altenbach@legrand.com>
Adds NXP platforms, sorted alphabetically, to the boot zephyr allow list. Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
Add ctcc/nrf52840 and ctcc/nrf9161 board targets. Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
Signed-off-by: Zachary Crockett <zachary.crockett@sofarocean.com>
…te change Before pushing MCUBOOT_STATUS_UPGRADING, check if has_upgrade is true to ensure this is not pushed at every boot and only when needed. Signed-off-by: Joseph Todd <joseph.todd@lascar.co.uk>
Configured CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32 Which ensure the fastest bulk RRAM write operations. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Is there any news on this? Should this pull request be on the upstream project? |
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.
After some investigation it's possible to extract the version number by calling
boot_read_image_header()
with the boot status fetched withswap_read_status()
. According to the demo of George Beckstein with utility function and the fetch function I did some improvements to avoid having the wrong decisions in the calls with hanging code or reading from the wrong slot as result.Changes:
int boot_get_current_version(struct image_version *version)
in /mcuboot/boot/bootutil/scr/bootutil_misc.c