feat: use rmk-boot.x linker script for DFU partition layout - #1018
Conversation
2d22a39 to
b9a6d44
Compare
|
The symbol existence is checked in rmk when bootloader feature like And I think it should not be overwritten by The last point from me is the storage size, default 128KB is a little bit more. For example, nRF52833 has only 512KB flash(I just realized that it's impossible to use rmk-boot on it). I want it to be tunable, or default to 32KB. |
b9a6d44 to
aae555f
Compare
Size Report
|
c50e87d to
02022c8
Compare
for now I prefer to bind everything bootloader related to the The offsets and sizes are now bound to symbols defined in Storage size is not easily changeable in RMK when using embassy-boot, because when changing the storage size (offset) this also changes the size of the ACTIVE and DFU partitions. So you end up with new sizes and offsets for them as well. I tuned down the default to 32K and in rmk-boot I added the possibility to easily change the storage size. Then users just need to do change that, build rmk-boot, flash it and copy the |
dbaed24 to
c091e81
Compare
|
Will be done when I finally get my external flash to test things out. I prefer smaller PRs that are about one thing only. It's easier to review and test this way. |
c091e81 to
bb76750
Compare
|
Should I merge this PR as is and leave the |
|
Yes that's I wanted to do. But I wanted to have another go in this PR. Also let me do the small fixes in the corresponding PR in rmk-boot first. They should be merged at the same time. |
ee99640 to
3ee618e
Compare
|
Using those symbols now. I think it's better to have the same symbols instead of doing our own thing. I will test this once more with rp and nrf this weekend and then mark it ready to merge. |
a0bae0a to
2008729
Compare
|
Tested with RP2040 and nRF52840. I think this is good now. |
…_flash_from_linkerscript Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2008729 to
97221ad
Compare
|
great, thanks! |
This PR should simplify the process of setting the right flash layout when using rmk-boot.
The calculation formula is still the same (flash size - what the bootloader takes up - storage = rest. ACTIVE = rest/2 - 1 page, DFU = rest/2 + 1 page) and rmk-boot's
build.rscreates amemory.xaccordingly. Additionally it should create armk-memory.xwith the matching flash layout of the (RMK-)application + a few linker symbols that the application can use to initialize the flash and its partitions.e.g. a
rmk-memory.xlooks like this:rmk-boot not only creates that
rmk-memory.xat build, it also provides matchingrmk-memory.x-files for its pre-built variants. (rmk-rp2040-16mb-memory.x for example)The users can copy those files into their project directory and rename them to
memory.x.The users code can then use
rmk::dfu::init_flash_from_linkerscript()instead ofrmk::dfu::init_flash()to partition the flash without giving any offsets and sizes. For use_config this happens automatically.User who build their own bootloader with embassy-boots swap feature can change the symbols in memory.x accordingly.
Related PRs:
rmk-rs/rmk-boot#2