ports/stm32f4: Keep bootloader within first 32K #420
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.
In order to free up sectors 2 and 3 for the application, limit the bootloader to the first 16K sector, config to the next 16K. We keep the application still starting at 0x10000 so that 0x8000 and 0xC000 sectors can be used by the application for settings/config storage.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
This checklist items that are not applicable to your PR can be deleted.
Description of Change
While trying to set up an stm32f401cb based board to run ZMK (using Zephyr under the hood), I ran into an issue trying to use Zephy's NVS driver for persistence of settings. Zephyr's NVS expects two sectors of 16K, which basically means I need to use sectors 2 and 3 for this:
I was able to make this work with the correct partitioning on the Zephyr/ZMK side, and properly fit the bootloader into the first two sectors with the changes in this PR. The device runs, and properly store settings as expected.