cpu/stm32f7: add riotboot requirements#11899
Merged
aabadie merged 2 commits intoRIOT-OS:masterfrom Aug 9, 2019
Merged
Conversation
cb5324a to
a4534bf
Compare
- stm32f7 use sectors instead of pages, they go either from 16KB to 128KB, or from 32KB to 25KB. Smaller sectors are at the begining of the flash. Slots must start at the begining of a sector to not overlap. - Minimum required RIOBOOT_HDR_LEN or stm32f7 is 0x200 to respect vector table alignment - Add CPU_FLASH_BASE
a4534bf to
73aeac7
Compare
aabadie
reviewed
Aug 9, 2019
73aeac7 to
644cb9f
Compare
Contributor
Author
|
@aabadie thanks for the review! |
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
This PR adds riotboot for stm32f7. Since F7 works with sectors for riotboot to work each slot must start at the beginning of a sector. For stm32f7 the smallest sector is of length 16kB or 32kb depending on CPU_MODEL, therefore that must be the length of the bootloader and the same amount must be taken from the second half of the flash to optimize flash usage.
This PR is part of 3, since just adding riotboot doesn't make much sense if it can't perform ota. Although it doesn't depend on them but it is highly related to:
Also pulling #11808 can ease testing significantly.
Testing procedure
It has been tested on the supported boards:
nucleo-f746zgandnucleo-f767zi1.- Test riotboot:
BOARD=nucleo-f746zg FEATURES_REQUIRED+=riotboot make -C tests/xtimer_usleep riotboot/flash-extended-slot0 termBOARD=nucleo-f746zg FEATURES_REQUIRED+=riotboot make -C tests/xtimer_usleep riotboot/flash-slot1 termIn both cases it should run without issues.
2.- Since the sector division is important when updating the slots by writing to flash directly it would be ideal to rebase on top off flashpage: #11681 and #11705, as well as #11808
and run
tests/riotboot_flashwriteThe following patch can be applied to the test Makefile
make -C tests/riotboot_flashwrite/ BOARD=nucleo-f746zg flash testIssues/PRs references
Support flashpage: cpu/stm32f7/4/2: add flashpage and flashpage_raw #11681
Support flashpage raw for flashwrite: riotboot/flashwrite: use chunks instead of pages, support flashpage_write_raw #11705
Also pulling tests/riotboot_flashwrite: add python test script #11808 can ease testing significantly.