Updating the Onboard Bootloader

Do NOT update the bootloader unless being asked to do explicitely.

The FMU bootloader is a very stable piece of software and needs seldomly to be updated. If the documentation or mailing list indicates that it should be updated, follow the steps below. There are total three options to update it:

  1. With a microSD card
  2. With the ST DFUse tool via USB
  3. Via JTAG (for developers)

Determining the Bootloader Version

Build and flash the current firmware

make px4fmu-v2_default upload

The bootloader version will be printed on the console during the upload process.

Upload via microSD card

Download the most recent bootloader version, usually provided on this page.

  • Current PX4FMUv1 Bootloader px4fmu_bl.bin.zip – 2014-02-03 / rev 4.0 same file as built in the Bootloader code base, git hash: 8916d70e9580053701064edbceb79ad144ebc63f.
  • Current PX4FMUv2 Bootloader px4fmuv2_bl.bin.zip – 2014-02-03 / rev 4.0 same file as built in the Bootloader code base, git hash: 8916d70e9580053701064edbceb79ad144ebc63f.

UNZIP and put it onto a microSD / SDHC / SDXC card in the main directory.

Then connect to NSH and run this command to update (equivalent for v2):

bl_update /fs/microsd/px4fmu_bl.bin

The response is:

bl_update: image validated, erasing bootloader...
bl_update: flashing...
bl_update: verifying...
bl_update: bootloader update complete

Upload via DFUse

Setup Windows

The details can be read in the ST Micro USB DFU instructions, for the scope of the use here this wiki page is sufficient. Download the USB DFU utility:

  • stsw-stm32080.zip – USB DFU utility from ST Micro (only version v3.0.3, or maybe higher, works for the STM32F4)

Download and install it (the one ending with _x64.exe is for 64bit Windows versions). Enter anything for the company name, as the installer won't continue else (e.g. XXX).

Setup Linux

Mac OS below. The dfu-util tool is the equivalent to the ST windows tool and can upload DFUse files and bin files (the file linked on top of this page).

The right command for PX4 is:

 dfu-util -a 0 --dfuse-address 0x08000000 -D px4fmu_bl.bin

Setup Mac OS

The dfu-util tool is the equivalent to the ST windows tool and can upload DFUse files and bin files (the file linked on top of this page).

 brew install dfu-util
 dfu-util -a 0 --dfuse-address 0x08000000 -D px4fmu_bl.bin

More details Dfu-util instructions from SeeedStudio.

Connecting the board (all operating systems)

To put PX4FMU into the ST bootloader mode, bridge the VDD_3V3 and BOOT0 test points on the back of the board, as shown in this image. The bridging is only required during the USB plugging instant, so a set of tweezers or a wire with open ends is sufficient.

Connect the board to USB while the pins are still bridged. You can remove the connection after the board is powered via USB. Do not power the board from any other power source.

Uploading Windows

Unless a brand new bootloader version is out, it is recommended to skip this step and to download the DFU file linked after this paragraph.

Generate a DFU file (skip this section)

Unless there is a good reason to generate the file yourself, please skip this section and use the .DFU file provided below.

If a new version has to be built, the first step is to convert the .bin bootloader file (linked above) into a DFU-uploadable file. Start Windows/Start → All Applications → STMicroelectronics → DfuSe → DFU File Manager.

On the next screen, select “I want to GENERATE a DFU file from S19, HEX or BIN files”.

On the resulting screen, enter these settings:

  • Vendor ID: 0x 0483
  • Product ID: 0x df11
  • Version ID: 0x 2100

Download (from the top of this page) px4fmu_bl.bin.zip and unzip it. Click on the Multi BIN… button. In the next dialog, click on the … button and select the file. After that, set the address to 0x08000000 and click “Add to list »”. Then click OK on the bottom.

As last step, click Generate… and select the output file name. The resulting file is uploaded here for the rev. 3 bootloader (current version):

Upload DFU File

It is recommended to use the file linked below to flash the bootloader and not generate one yourself with the DFU file manager

After the DFU file has been generated or downloaded, start the actual upload tool from Windows/Start → All applications → STMicroelectronics → DfuSe → DfuSe Demonstration.

It should display “STM Device in DFU Mode” in the top right drop-down menu. In the bottom left section labeled “Upgrade or Verify Action, select the px4fmu_bl.dfu file. It should display “File correctly loaded” in green on the bottom of the Window.

Do not check the checkbox “Verify after download”, then click on upgrade - it should report a successful upgrade. Now click on verify. Otherwise the program will probably crash.

The procedure is now finished, unplug and re-plug the board, the red led should flash rapidly for 3 seconds and then either switch off (if the app is flashed) or keep flashing. Check if Windows detects it now as PX4 FMU bootloader.

Uploading Mac OS

Next connect the board to the computer. It should be detected as ST USB device. On a Mac it will show up as this device (use system_profiler SPUSBDataType):

                STM32  BOOTLOADER:

                  Product ID: 0xdf11
                  Vendor ID: 0x0483  (STMicroelectronics)
                  Version: 21.00
                  Serial Number: 365D305F3131
                  Speed: Up to 12 Mb/sec
                  Manufacturer: STMicroelectronics
                  Location ID: 0xfa137000 / 10
                  Current Available (mA): 500
                  Current Required (mA): 100

Uploading Linux

Install the dfu-util:

Ubuntu:

  sudo apt-get install dfu-util
  

Arch Linux:

  yaourt dfu-util

Then bring the FMU in DFU-Mode as described above and look for it using:

 dfu-util --list
dfu-util 0.5
 
(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY
 
dfu-util does currently only support DFU version 1.0
 
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash  /0x08000000/04*016Kg,01*064Kg,07*128Kg"
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=1, name="@Option Bytes  /0x1FFFC000/01*016 g"
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=2, name="@OTP Memory /0x1FFF7800/01*512 g,01*016 g"
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=3, name="@Device Feature/0xFFFF0000/01*004 g"
 

Then execute:

  dfu-util -a 0 -d 0483:df11 -D px4fmu_bl.dfu -v
dfu-util 0.5
 
(C) 2005-2008 by Weston Schmidt, Harald Welte and OpenMoko Inc.
(C) 2010-2011 Tormod Volden (DfuSe support)
This program is Free Software and has ABSOLUTELY NO WARRANTY
 
dfu-util does currently only support DFU version 1.0
 
Filter on vendor = 0x0483 product = 0xdf11
Opening DFU USB device... ID 0483:df11
Run-time device DFU version 011a
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash  /0x08000000/04*016Kg,01*064Kg,07*
128Kg"
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
Dfu suffix version 11a
DfuSe interface name: "Internal Flash  "
Memory segment at 0x08000000   4 x 16384 = 65536 (rew)
Memory segment at 0x08010000   1 x 65536 = 65536 (rew)
Memory segment at 0x08020000   7 x 131072 = 917504 (rew)
file contains 1 DFU images
parsing DFU image 1
image for alternate setting 0, (1 elements, total size = 8080)
parsing element 1, address = 0x08000000, size = 8072
 Download from image offset 00000000 to memory 08000000-080007ff, size 2048
 Download from image offset 00000800 to memory 08000800-08000fff, size 2048
 Download from image offset 00001000 to memory 08001000-080017ff, size 2048
 Download from image offset 00001800 to memory 08001800-08001f87, size 1928
done parsing DfuSe file

Upload via JTAG

The recommended way to update the bootloader for developers is to use JTAG. Instructions how to compile and flash the bootloader are on this page:

Translations of this page:


Quick Links

QR Code: URL of current page