cpu/stm32f7: add riotboot requirements #11899
Merged
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-f746zg
andnucleo-f767zi
1.- Test riotboot:
BOARD=nucleo-f746zg FEATURES_REQUIRED+=riotboot make -C tests/xtimer_usleep riotboot/flash-extended-slot0 term
BOARD=nucleo-f746zg FEATURES_REQUIRED+=riotboot make -C tests/xtimer_usleep riotboot/flash-slot1 term
In 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_flashwrite
The following patch can be applied to the test Makefile
make -C tests/riotboot_flashwrite/ BOARD=nucleo-f746zg flash test
Issues/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.