boot: imgtool: Extend align to 128B - #2797
Conversation
d3zd3z
left a comment
There was a problem hiding this comment.
This doesn't appear to test the larger alignment in the simulator.
Also, the docs/design.md needs to be updated to include the new alignments possible.
|
Thanks for the review. |
d3zd3z
left a comment
There was a problem hiding this comment.
Please ensure the simulator support is also then tested. Also, the docs still need to be updated to include the new alignments.
|
#2801 will handle setting CONFIG_BOOT_SERIAL_UNALIGNED_BUFFER_SIZE to 128 for all renesas RA family of MCUs |
|
Would suggest reading comments on #2440 if your write size is 128 bytes then really it doesn't make much sense to use a swap mode since your overhead is so large it destroys any real swap use case |
|
Thanks @nordicjm for the review. Still new to the project, and I missed that closed PR. |
|
I'm not understanding the reason for the closure of #2440 either. I believe swap is still usable. The write block size is 128 bytes, but the erase block or sector size is larger (a combination of 8-8KiB and 30-32KiB blocks on the RA6M3, other RA6 family have similar). If you treat it all as 32KiB sectors, only 6KiB is required for the trailer, rather than 1.5MiB. Treating it all as 8KiB sectors requires a 24KiB trailer. Not great, but not unusable. |
|
Yes, also looking back at the CMakeLists.txt we have: In my case we have: And: boot_status_data_size = 14 * 3 * 128 = 5376 B In the end: @nordicjm You're far more expert than me, can you tell me please if we miss something? P.S. I found out how it manages to sign in overwrite only mode, it sets align to 1 here |
With overwrite only, the max align is ignored since you have nothing extra to write, so you don't need any changes |
The comment gives the figures it uses which was based on a random image size of 512KiB and assuming that the erase and write block sizes were the same (the user did not specify an erase size) |
|
Ok thanks for all the clarifications. |
|
Should be signed-off now, sorry about that |
d3zd3z
left a comment
There was a problem hiding this comment.
I think this is in reasonably good shape. I think, aside from this, we probably have an issue with the CI test for each PR getting too long, but that is something to address separately. There is a formatting issue in the docs, which should be fixable by pasting in the actual output of --help instead of editing that output.
af91f5e to
35cb0b4
Compare
|
I have confirmed that #2808 fixes the issue with the Stm32f4SpiFlash, and the combined result passes CI without needing to disable at specific part. |
|
Great, I'll remove the suppression, thanks for your help! |
|
We'll need to get 2808 merged before I'd expect CI to pass. You can also pull 2808 into your tree, rebase on top of that, and set the merge base of this PR to my branch, but it might be easier to just get the 2 reviews on 2808 and get it merged, and you can then just rebase on main. |
|
Ok, I'll keep an eye out for #2808 being merged, I'll rebase and remove that suppression before pushing again. |
Incresaed align to 128B to support Renesas RA family MCUs, which have a flash controller that expects 128B writes. Signed-off-by: Paolo Bazzanella <pbazzanella@qubicaamf.com>
Added simulator support for the flash used in the RA6M3. Added two new features: max-align-64 and max-align-128. Signed-off-by: Paolo Bazzanella <pbazzanella@qubicaamf.com>
Signed-off-by: Paolo Bazzanella <pbazzanella@qubicaamf.com>
|
Rebased on top of main which now features the commits contained in #2808 and edited the second commit to remove the suppression tests/core.rs not in the modified files list anymore. |
I wanted to use the latest mcuboot upstream version together building it with Zephyr.
We are using a Renesas RA6M3 MCU, which has a controller which can write the flash only 128Bytes at a time.
I extended the aligment and max-alignment in the imgtool signer to allow the app to be signed by west, and the image gets correctly signed.
For what concerns bootloader support, I managed to make the boot work on a custom board we have by setting CONFIG_BOOT_SERIAL_UNALIGNED_BUFFER_SIZE=128.
CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=n
CONFIG_BOOT_MAX_IMG_SECTORS=14
As the renesas drivers do not support the soc-nv-flash compatible yet and the mapped-partitions but AFAIK there is some work in progress here:
zephyrproject-rtos/zephyr#110365
zephyrproject-rtos/zephyr#109125