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

Fix/reload dct functions #1868

Merged
merged 3 commits into from
Jul 30, 2019
Merged

Fix/reload dct functions #1868

merged 3 commits into from
Jul 30, 2019

Conversation

XuGuohui
Copy link
Member

@XuGuohui XuGuohui commented Jul 30, 2019

Problem

Particle Update fails to update a Photon/P1 from Device OS <1.2.1-rc.3 to 1.2.1 via DFU mode. This is caused by that after updating the system parts, the address of DCT functions that resided in system parts aren't consistent, so when bootloader tries accessing the DCT after that, it then crashes.

Solution

Dirty a flag after every DFU write operation to the internal flash, so that after updating the system parts, next time when bootloader calls DCT functions, it will reload the DCT functions to make sure that the address of the DCT functions in new system parts are valid.

Steps to Test

  1. Build and flash the new bootloader
  2. Flash older DeviceOS e.g. 1.0.0 onto the device
  3. Reset and go into DFU
  4. Write into DCT
  5. Write system-part1 and system-part2 of DeviceOS release v1.2.1 without resetting
  6. Write into DCT again, this should succeed and not crash the device

Example App

N/A

References

particle-iot/particle-cli#499
https://community.particle.io/t/device-os-1-2-1-and-particle-cli-1-43-fail-in-particle-update/51140

  • [bugfix] [Photon/P1] Bootloader correctly re-imports the DCT functions from system firmware after its modification through DFU.

@avtolstoy avtolstoy added ready to merge PR has been reviewed and tested and removed needs review labels Jul 30, 2019
@avtolstoy avtolstoy merged commit 1b9a2d5 into develop Jul 30, 2019
@avtolstoy avtolstoy deleted the fix/reload_dct_functions branch July 30, 2019 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bootloader bug ready to merge PR has been reviewed and tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants