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
Implement parameter backup for 4.0 #16442
Conversation
if header on primary parameter storage is corrupt then restore from backup
added params_restored error
not needed any more
I have done some light bench testing of this on a cubeorange and all seems fine but I'll continue with some more tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
// header doesn't match. We can't recover any variables. Wipe | ||
// the header and setup the sentinal directly after the header | ||
Debug("bad header in setup - erasing"); | ||
erase_all(); | ||
} | ||
|
||
// ensure that backup is in sync with primary | ||
_storage_bak.copy_area(_storage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not checking return value here. Should probably be a flow-of-control internal error on failure.
In fact, copy_area should probably be void.
This will be released with Copter-4.0.7 |
This is a backport of #16304 which implements the parameter backup system to resolve the parameter reset problem seen on some boards.
I don't know if there will be another 4.0.x release, but as some people are being badly affected by this issue I am making it available as a PR for easy use with 4.0.x releases.