Hello world :-) Michal Lenc is proposing new interesting features in nxboot but that will break current nxboot compatibility, please review the PR and join the discussion :-)
https://github.com/apache/nuttx-apps/pull/3024 ### Summary This commit enhances the bootloader capabilities. The image's header is extended with header version, size, platform identifier and pointer to optional next header. CRC32 now includes part of the header in its calculation as well. The change also avoids having two different magics for image uploaded over programmer and update image. Both these images have the same magic and this magic is changed internally by the bootloader's logic. The change is needed because image with standard magic is automatically considered as a confirmed image (uploaded with programmer). The current implementation avoids tails at all, therefore the user application uploading the image does not have to erase the tail before new upload. The image is considered as confirmed if it has standard magic or its recovery is present. This means the bootloader has to erase the header of the update image after the update is done (to avoid update loop and to mark the image as unstable). This page is written back during the confirmation. This is a breaking change, but necessary for the future development of the bootloader. The added header version field will allow to add minor/major updates while keeping the backwards compatibility. ### Impact Breaking change for nxboot bootloader. I think no one is using it so far (except for us at Elektroline), so it should not be a big issue. This also adds version field in the header so future breaking changes could be tracked easily. It is also a better and more user friendly design, so I think these advantages are big enough to break the old images that are not used by anyone so far. Documentation updated at apache/nuttx#15981 ### Testing Tested on SAMv7 custom board with various scenarios: revert after update confirm after update multiple updates in a row board power restarts during recovery creation, update and revert processes All these scenarios lead to the valid image in primary slot. @michallenc -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info