feat: use rmk-boot.x linker script for DFU partition layout - #1018
feat: use rmk-boot.x linker script for DFU partition layout#1018Schievel1 wants to merge 1 commit into
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
| /// | ||
| /// Reads linker-defined absolute symbols. The symbols must be present in the | ||
| /// linked binary or the firmware will not link. | ||
| pub fn init_flash_from_linkerscript(flash_peri: Peri<'static, FLASH>) -> PartitionType { |
There was a problem hiding this comment.
This function is duplicate, this should be a generic should over (Async)NorFlash in embedded-storage trait.
|
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. |
…_flash_from_linkerscript Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
c091e81 to
bb76750
Compare
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