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

params: flash: erase corrupt sector #24065

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dakejahl
Copy link
Contributor

@dakejahl dakejahl commented Dec 3, 2024

Problem
When updating from Ardupilot to PX4 on a board that uses flash based params PX4 will fail to load params. It will continue to fail until the MCU is mass erased. This is because the params sector contains the Ardupilot param format.

Solution
Erase parameter sector if parameters_token is not found. This essentially tells us that the sector is not in the proper format and therefore we assume it is generally "corrupted". This is what Ardupilot does and doesn't have this issue.

Testing
Tested on an ARK FPV.

@dakejahl dakejahl requested review from bkueng and dagar December 3, 2024 01:53
bkueng
bkueng previously approved these changes Dec 3, 2024
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I generally did a full erase when switching from another FW.

src/lib/parameters/flashparams/flashfs32.c Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants