Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gen3] make sure that extended system-part1 is compatible with older bootloaders as well as 6.1.2 #2831

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

avtolstoy
Copy link
Member

@avtolstoy avtolstoy commented Sep 16, 2024

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

  1. Flash a device with 5.9.0 (including bootloader)
  2. Flash system-part1 out of this branch over DFU
  3. The device should boot correctly, SMH, reset and still boot correctly

References

https://www.notion.so/Gen-3-platforms-out-of-flash-space-for-Device-OS-features-13ec13233b404d739ae947b6350d4332?d=bdc4ff20fa9e4287b2b1295616d085c0&pvs=4#2e5cf972e1a7410c82c1365b7277eb7a


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@avtolstoy avtolstoy added this to the 6.2.0 milestone Sep 16, 2024
@avtolstoy avtolstoy requested a review from technobly September 16, 2024 18:40
@avtolstoy avtolstoy merged commit 9502b01 into develop Sep 19, 2024
13 checks passed
@avtolstoy avtolstoy deleted the feature/gen3-part1-compat-with-older-bootloader branch September 19, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants