bootloaders/riotboot_vfs: add VFS based bootloader#17379
Open
benpicco wants to merge 7 commits intoRIOT-OS:masterfrom
Open
bootloaders/riotboot_vfs: add VFS based bootloader#17379benpicco wants to merge 7 commits intoRIOT-OS:masterfrom
benpicco wants to merge 7 commits intoRIOT-OS:masterfrom
Conversation
c6c3b34 to
39ad6a4
Compare
39ad6a4 to
699e993
Compare
Contributor
|
@benpicco Could you split out all the unrelated commits as well as document the added vfs/riotboot functions? |
699e993 to
8131421
Compare
8131421 to
efd638f
Compare
4577836 to
470045d
Compare
470045d to
bff8a78
Compare
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.
Contribution description
Often it's not feasible to partition the internal flash into two halves simple because the required firmware is too large for just half of the flash. With the current chip shortage larger chips are not always available (if such parts even exist).
If the board has an external flash with a filesystem, we can store the new firmware there and use riotboot to transfer it to the internal flash.
Before flashing the new firmware, we make a backup of the current one so that the board can recover on it's own in case of a bad firmware. (In a follow-up we can add a watchdog timer to do an automated reboot if the new firmware does not clear it in time).
The path to firmware file to flash is stored in a
do_updatefile as text. Once the firmware is flashed, the file contains the path of the backup firmware. It is the job of the new firmware to remove this file, otherwise the backup is applied on reboot.Testing procedure
I have not figured out how to create a combined image yet and whenever I flash the application firmware the bootloader also gets erased. So whenever you flash the application, you also have to flash the bootloader:
tests/riotboot_vfson a board with external storagebootloaders/riotboot_vfsNow on the shell, save the current firmware with
dump_rom /nvm0/test.binYou can re-flash the current firmware with
flash_rom /nvm0/test.binsame54-xpro
nrf52840dk
Issues/PRs references
depends on and includes #17341