ports/stm32f4: Keep bootloader within first 32K#420
Conversation
|
So, based on the CI failure... A few things are clear:
Thoughts on making this an optional different linker file/set of offsets that boards can opt in to? |
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. Available by setting COMPACT_BOOTLOADER in board.mk
76da845 to
608a8d4
Compare
|
Ok, I've made this change "opt in" by setting |
|
Great work. one question I tried, seems after this change , we still can't change starting at 0x10000 ? to 0x0C000 ? is there any restrict on APP Start Addr ? |
I haven't tried, but I don't see why you couldn't. In my case, I specifically need the two sectors starting at 0xC000 for application settings storage, so I want to keep the same start address. |
|
Sorry, I clearly needed more coffee/sleep when working on this. This keeps it in the first 16K, but that's really not needed for my use case, so closing. |

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.