Skip deck firmware that is already up to date - #16
Merged
Merged
Conversation
The Lighthouse deck cannot be commanded into its bootloader, and the firmware only leaves it there when its bitstream is out of date. A running deck is therefore already up to date, so skip it rather than failing the whole flash run. Skip the reboot too when nothing was written. Fixes #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flashing a Crazyflie with a Lighthouse deck attached failed with
Section cannot reset to bootloaderand aborted the whole run, including decks queued after it.That is not an error state. The Lighthouse deck has no
commandResetToBootloader, andlighthouseDeckFlasherCheckVersionAndBoot()only leaves it in its bootloader when the bitstream CRC does not match the one the firmware requires — which is also the only time it setsUPGRADE_REQUIRED. A Lighthouse deck that is running is therefore already carrying the bitstream we would have flashed.This applies the same rule
cfloaderuses in crazyflie-lib-python: a deck that can be commanded into its bootloader always is, a deck that cannot is only flashed when it reportsUPGRADE_REQUIRED. Note the bit cannot be used on its own — the Lighthouse driver is the only one in the firmware that ever sets it, so keying solely off it would silently skip the AI deck, bcCam and the color-LED decks.A skipped deck needs no restart either, so the reboot and the 3–7 s restart delay are now only done when something was actually written.
Fixes #6