Crazyflie Bootloader Recovery
It is possible for the crazyflie bootloader to get overwritten or corrupted. Some symptoms of this include:
- When powering on the crazyflie, only the M2 led is lit and stays solid
- The power button does not power off the crazyflie
- When putting the Crazyflie into bootloader mode by holding down the power button, only the M2 led flashes slowly
- If the power button does not work, must unplug the battery, hold the power button, and plug the battery back in while holding the power button
To fix this, the bootloader and firmware must be reflashed to the crazyflie. To flash the bootloader do the following:
- Clone the Bitcraze Crazyflie Bootloader repository
- Build the bootloader by running
make
from withincrazyflie2-stm-bootloader/
. This should generate thecf2loader.bin
file. - Put the Crazyflie into DFU mode
- Disconnect the battery
- Hold the power button down
- Connect the Crazyflie to your machine via USB
- Continue holding the power button (about 5 seconds) until the blue light reaches its second speed of flashing (about 1hz). The crazyflie's microprocessor (STM32F405) is now in DFU mode.
- Overwrite the existing bootloader by running
dfu-util -d 0483:df11 -a 0 -s 0x08000000 -D cf2loader.bin
.- Note: this command downloads cf2loader.bin to address
0x08000000
, this is the start of the crazyflie memory and is different from where the firmware is flashed.
- Note: this command downloads cf2loader.bin to address
- Once finished downloading the bootloader to the crazyflie, disconnect USB.
- At this point, putting the Crazyflie into bootloader mode should show both M2 and M3 LEDs flashing.
- Flash the Crazyflie firmware as normal, see Flashing