[gen3] make sure that extended system-part1 is compatible with older bootloaders as well as 6.1.2 #2831
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In order to allow older bootloaders to boot into a larger system-part1 without any modifications we can keep a “fake” module info header in the normal/old location @ 0x30000 + 0x200 (vector table size). All it needs to contain is proper platform id, start and end addresses, so that (end - start) equals sizeof(vector table) + sizeof(module info) + sizeof(dynalib table). This whole section needs to be CRC32-d and CRC32 appended immediately after dynalib. This should allow the checks in https://github.com/particle-iot/device-os/blob/v5.9.0/bootloader/src/nRF52840/dfu_usb.c#L15 to pass and current bootloaders will correctly jump into a larger system-part1. All at the cost of 24 bytes of module info header and a kilo of makefile/linker magic.
PR also enables running 5.8.0 to 6.0.0 applications now that everything has been merged together.
Steps to Test
References
https://www.notion.so/Gen-3-platforms-out-of-flash-space-for-Device-OS-features-13ec13233b404d739ae947b6350d4332?d=bdc4ff20fa9e4287b2b1295616d085c0&pvs=4#2e5cf972e1a7410c82c1365b7277eb7a
Completeness