mcuboot icon indicating copy to clipboard operation
mcuboot copied to clipboard

Make RAM loading available for single loaders

Open edersondisouza opened this issue 1 year ago • 10 comments

Code for loading the image to RAM is currently under bootutil/loader.c. However, single loaders (used when one sets MCUBOOT_SINGLE_APPLICATION_SLOT) cannot use this file - a single loader in fact re-implements some of the methods of bootutil/loader.c. This PR splits the bits of code related to RAM loading to another file inside bootutil (ram_load.c) and make them available on bootutil_priv.h, so that single loaders can simply reuse this code.

Note: these are basically the first four patches from #2044 - it seems that the multiple source bits of that PR are a bit controversial, so this PR focus on the RAM loading availability, which is hopefully less controversial.

edersondisouza avatar Sep 12 '24 20:09 edersondisouza

Code for loading the image to RAM is currently under bootutil/loader.c. However, single loaders (used when one sets MCUBOOT_SINGLE_APPLICATION_SLOT) cannot use this file - a single loader in fact re-implements some of the methods of bootutil/loader.c.

Because single application slot has nothing to do with RAM load mode, they are two completely different modes, RAM load is it's own dual-slot system, single application image is a single flash image. If you want to add a single RAM slot mode then that's something that can be added as a distinct mode, not as modifying single application slot

nordicjm avatar Sep 13 '24 06:09 nordicjm

v2:

  • Have a separate Kconfig for RAM loading on single application slot

edersondisouza avatar Sep 13 '24 22:09 edersondisouza

Code for loading the image to RAM is currently under bootutil/loader.c. However, single loaders (used when one sets MCUBOOT_SINGLE_APPLICATION_SLOT) cannot use this file - a single loader in fact re-implements some of the methods of bootutil/loader.c.

Because single application slot has nothing to do with RAM load mode, they are two completely different modes, RAM load is it's own dual-slot system, single application image is a single flash image. If you want to add a single RAM slot mode then that's something that can be added as a distinct mode, not as modifying single application slot

Ok - using a separate Kconfig instead of reusing the choice under !SINGLE_APPLICATION_SLOT.

edersondisouza avatar Sep 13 '24 22:09 edersondisouza

v3:

  • CONFIG_SINGLE_APPLICATION_SLOT_RAM_LOAD is not behind CONFIG_SINGLE_APPLICATION_SLOT.

edersondisouza avatar Sep 16 '24 19:09 edersondisouza

v4:

  • CONFIG_SINGLE_APPLICATION_SLOT_RAM_LOAD doesn't select CONFIG_SINGLE_APPLICATION_SLOT anymore. This means that there a bit more widespread changes, though.

edersondisouza avatar Sep 18 '24 18:09 edersondisouza

@teburd Needs a signed off line from you

nordicjm avatar Sep 24 '24 15:09 nordicjm

@teburd Needs a signed off line from you

Done

teburd avatar Sep 24 '24 15:09 teburd

@teburd CI still failing on sign off

nordicjm avatar Sep 26 '24 06:09 nordicjm

@nordicjm @nvlsianpu all commits with signed-off now (as the rebase I guess has changed the committer, which makes sense), CI passing, please re-review thanks!

teburd avatar Oct 01 '24 13:10 teburd

@nvlsianpu any updates? Seems I'll need a rebase now but would like feedback that this is good to go

teburd avatar Oct 15 '24 14:10 teburd

Latest rebase should fix the conflict that was introduced, the boot_enc_decrypt rename cause the rebase to show a conflict and that was fixed.

teburd avatar Oct 23 '24 22:10 teburd

CI issues need to be fixed

They’ve been fixed again, please do review again when you can

teburd avatar Oct 24 '24 02:10 teburd