First the drone is connected with a USB-cable in boot mode. Boot mode is achieved by holding the boot button while the power is connected via the USB-cable. After the power is connected the boot button can be released.
To flash the M4 the following command is run from a terminal:
dfu-util -a 0 -d 0483:df11 -s 0x08000000 -D FILE
Where FILE is replace with the path and filename of the bin firmware file.
First the M4 is connected to the computer with a ST-Link. In Crossworks to Open a connection to the M4 go to Target → Connect → ST-LINK/V2. In the bottom of the screen it could say something like Cortex-M4 r0p1 on ST-LINK/V2.
Open the AutoQuad project and go to Build → Build and run. It will flash the M4 with the current build.
Remember to change the following in the aq.h file:
# ifndef BOARD_VERSION # define BOARD_VERSION 1 # endif # ifndef BOARD_REVISION # define BOARD_REVISION 0 # endif
# ifndef BOARD_VERSION # define BOARD_VERSION 8 # endif # ifndef BOARD_REVISION # define BOARD_REVISION 6 # endif
By selecting the AutoQuad project in the Project explore and the go to the Properties window. Then under Linker options → Additional Output format, a bin file can be chosen.