Repository navigation
Add platform dfu to restart the STM32 into USB DFU - #25
Merged
Merged
Conversation
Sends the nRF51 the command that power-cycles the STM32 with BOOT0 high (bitcraze/crazyflie2-nrf-firmware#126), the same as holding the power button from off, and waits for the STM32 to show up on USB as 0483:df11. The nRF51 only gets the command over the radio, so a usb:// URI is refused up front. If no DFU device appears, the command fails and points at platform reboot to get the STM32 back into its firmware.
evoggy
force-pushed
the
evoggy/platform-dfu
branch
from
October 7, 2026 17:09
7c1e8d9 to
f371321
Compare
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.
Adds
cfcli platform dfu, which restarts the STM32 into its ROM bootloader so it can be flashedover USB DFU, without holding the power button.
Depends on bitcraze/crazyflie2-nrf-firmware#126, which adds the nRF51 command this sends.
How it works
platform dfusends0xFF 0xFE 0x07to the nRF51, the same waysleep,wakeupandpower-offsend their commands. The nRF51 then power-cycles the STM32 with BOOT0 high, and cfcliwaits up to 5 s for it to show up on USB as
0483:df11:usb://URI is refused with an error instead of silently doing nothing.USB, or its nRF51 firmware does not have the command yet (older firmware ignores it). The
message points at
cfcli platform rebootin case the STM32 did restart.docs/platform.mdhas a new section for the command.Testing
On a Crazyflie 2.1 Brushless running nRF51 firmware with #126, connected over the radio and USB:
cfcli platform dfusucceeded, and the DFU device was listed bydfu-util -lwith all four altsettings.
dfu-utiland read back to match.cfcli platform rebootbrought the Crazyflie back to its firmware.cargo testpasses.