Skip to content
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

cpu/stm32f7: add riotboot requirements #11899

Merged
merged 2 commits into from
Aug 9, 2019

Conversation

fjmolinas
Copy link
Contributor

@fjmolinas fjmolinas commented Jul 24, 2019

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 and nucleo-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

@fjmolinas fjmolinas added Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: OTA Area: Over-the-air updates labels Jul 24, 2019
@fjmolinas fjmolinas requested a review from aabadie July 24, 2019 08:49
@fjmolinas fjmolinas force-pushed the pr_stm32f7_riotboot_requirements branch 2 times, most recently from cb5324a to a4534bf Compare August 7, 2019 16:05
- 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
@fjmolinas fjmolinas force-pushed the pr_stm32f7_riotboot_requirements branch from a4534bf to 73aeac7 Compare August 7, 2019 16:37
@fjmolinas fjmolinas force-pushed the pr_stm32f7_riotboot_requirements branch from 73aeac7 to 644cb9f Compare August 9, 2019 11:16
@fjmolinas fjmolinas added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 9, 2019
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK and go!

@aabadie aabadie merged commit 9cf8da0 into RIOT-OS:master Aug 9, 2019
@fjmolinas fjmolinas deleted the pr_stm32f7_riotboot_requirements branch August 9, 2019 13:59
@fjmolinas
Copy link
Contributor Author

@aabadie thanks for the review!

@kb2ma kb2ma added this to the Release 2019.10 milestone Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: OTA Area: Over-the-air updates CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants