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

[BACKPORT release/1.15] tools/bootloader: add force-erase option and add bootloader version #23210

Merged
merged 10 commits into from
Jun 6, 2024

Conversation

julianoes
Copy link
Contributor

@julianoes julianoes commented May 30, 2024

Backport of: #22777
And fixups: #23174
And updated target list: #23234

Best to be rebased cleanly so that the git hash embedded in the bootloader makes sense and points to the actual branch.

@julianoes julianoes requested a review from davids5 May 30, 2024 22:00
Copy link
Member

@davids5 davids5 left a comment

Choose a reason for hiding this comment

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

@julianoes - I have the bugfix changes for the RT in #23110 (commits). Since this PR changes system behavior, I think we should bring in the bux fix PR first and then rebase this PR on it.

@julianoes
Copy link
Contributor Author

Ok, that's fine with me. Let me know when I should rebase it.

@dk7xe dk7xe mentioned this pull request Jun 3, 2024
@davids5
Copy link
Member

davids5 commented Jun 5, 2024

Ok, that's fine with me. Let me know when I should rebase it.

@julianoes - Please rebase

julianoes and others added 7 commits June 6, 2024 09:17
If the STM32H7 fails to program or erase a full chunk of 256 bytes, the
ECC check will trigger a busfault when trying to read from it.

To speed up erasing and optimize wear, we read before erasing to check
if it actually needs erasing. That's when a busfault happens and the
erase time outs.

The workaround is to add an option to do a full erase without check.

Credit goes to:
ArduPilot/ardupilot#22090

And the protocol option added to the bootloader is the same as for
ArduPilot, so compatible.

Signed-off-by: Julian Oes <julian@oes.ch>
This adds a new protocol extension which allows to get the bootloader
version.

The bootloader version is different from the bootloader protocol
revision which has stabilized at 5 and is not easy to update unless a
bootloader is actually breaking the protocol. The reason being that both
the Python script as well as the uploader used in QGC will not attempt
to load firmware if they don't know the bootloader version, so it could
basically be considered a "breaking" protocol revision.

Signed-off-by: Julian Oes <julian@oes.ch>
Includes:
- Remove some of the outdated Python2 checks and compatibility.
- Try not catch all exceptions but only the expected ones. Otherwise,
  this makes it really hard to debug if anything unexpected actually
  goes wrong.
- Make use of fstrings.
- Make output slightly prettier.

Signed-off-by: Julian Oes <julian@oes.ch>
Just so we don't conflict on these commands in the future.
Signed-off-by: Julian Oes <julian@oes.ch>
@julianoes julianoes force-pushed the pr-release/1.15-bootloader-backports branch from ee43c0c to e5b40c1 Compare June 5, 2024 21:26
@julianoes
Copy link
Contributor Author

julianoes commented Jun 5, 2024

@davids5 hang on, I need to add the commits from: #23234.

Ok: cherry-picked, rebuilt and force pushed.

julianoes and others added 3 commits June 6, 2024 10:18
@julianoes julianoes force-pushed the pr-release/1.15-bootloader-backports branch from e5b40c1 to 5f76134 Compare June 5, 2024 22:32
@davids5 davids5 requested review from dagar and davids5 June 6, 2024 07:26
Copy link
Member

@davids5 davids5 left a comment

Choose a reason for hiding this comment

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

LGTM @dagar - pleas have a look

@julianoes julianoes merged commit 71bf06a into release/1.15 Jun 6, 2024
5 checks passed
@julianoes julianoes deleted the pr-release/1.15-bootloader-backports branch June 6, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants