Difference between revisions of "DFU"

From PaparazziUAV
Jump to navigation Jump to search
m (typo, minor edit)
Line 6: Line 6:
__TOC__
__TOC__


DFU (Device Firmware Upgrade) is the standard method to upload paparazzi code to a stm32 MCU via usb.<br/>
DFU (Device Firmware Upgrade) is the standard method to upload new code to a STM32 MCU via USB.<br/>


There are two different dfu bootloader which require different software:
There are two different DFU bootloader which require different software:
* custom [[Luftboot]]/KroozSD bootloader which uses stm32_mem.py script
* custom [[Luftboot]]/[[KroozSD#Bootloader|KroozSD]] bootloader which uses stm32_mem.py script
* native (embedded in ROM) dfu bootloader which uses external dfu-util
* native (embedded in ROM) dfu bootloader which requires dfu-util
 
==Custom bootloader (e.g.[[Luftboot]],[[KroozSD#Bootloader|KroozSD]])==


==Custom bootloader (e.g.[[Luftboot]])==
This bootloader must be upload first, so paparazzi center can use stm32_mem.py to upload code to the MCU.<br/>
This bootloader must be upload first, so paparazzi center can use stm32_mem.py to upload code to the MCU.<br/>
This bootloader is available for LisaM/Lia ([[Luftboot]]) and Krooz/kroozSD ([[KroozSD#Bootloader|KroozSD]]) boards.
This bootloader is available for LisaM/Lia ([[Luftboot]]) and Krooz/kroozSD ([[KroozSD#Bootloader|KroozSD]]) boards.


===Airframe configuration===
===Airframe configuration===
This will be set as default at the appropriate makefile of the board.<br/>
This will be set as default at the appropriate makefile of the board.<br/>
Set '''Flash_Mode=DFU'''
Set '''Flash_Mode=DFU'''
   
   
===stm32_mem.py===
===stm32_mem.py===
stm32_mem.py will be used to upload the code.<br/>
stm32_mem.py will be used to upload the code.<br/>
To get a list of possible options, run:  
To get a list of possible options, run:  
Line 26: Line 29:


==Native DFU bootloader (embedded in ROM)==
==Native DFU bootloader (embedded in ROM)==
This bootloader is already embedded in the ROM of the MCU. <br/>
This bootloader is already embedded in the ROM of the MCU. <br/>
The MCU will not go automatically in DFU mode. <br/>
The MCU will not go automatically in DFU mode. <br/>
Line 34: Line 38:


===Airframe configuration===
===Airframe configuration===
This will be set as default at the appropriate makefile of the board.<br/>
This will be set as default at the appropriate makefile of the board.<br/>
Set '''Flash_Mode=DFU''' <br/>
Set '''Flash_Mode=DFU''' <br/>
Line 39: Line 44:


===Needed software===
===Needed software===
dfu-util packet is needed for this bootloader.<br/>
dfu-util packet is needed for this bootloader.<br/>
  sudo apt-get install dfu-util
  sudo apt-get install dfu-util

Revision as of 07:43, 15 February 2014

DFU (Device Firmware Upgrade) is the standard method to upload new code to a STM32 MCU via USB.

There are two different DFU bootloader which require different software:

  • custom Luftboot/KroozSD bootloader which uses stm32_mem.py script
  • native (embedded in ROM) dfu bootloader which requires dfu-util

Custom bootloader (e.g.Luftboot,KroozSD)

This bootloader must be upload first, so paparazzi center can use stm32_mem.py to upload code to the MCU.
This bootloader is available for LisaM/Lia (Luftboot) and Krooz/kroozSD (KroozSD) boards.

Airframe configuration

This will be set as default at the appropriate makefile of the board.
Set Flash_Mode=DFU

stm32_mem.py

stm32_mem.py will be used to upload the code.
To get a list of possible options, run:

sw/tools/dfu/stm32_mem.py --help

Native DFU bootloader (embedded in ROM)

This bootloader is already embedded in the ROM of the MCU.
The MCU will not go automatically in DFU mode.
To trigger DFU mode, connect pin BOOT0 with 3V and connect BOOT1 with GND, Reset MCU, disconnect BOOT0 and BOOT1.
In most cases BOOT1 is not needed.

For further information, look at the STM's Application note

Airframe configuration

This will be set as default at the appropriate makefile of the board.
Set Flash_Mode=DFU
Set DFU_UTIL=y

Needed software

dfu-util packet is needed for this bootloader.

sudo apt-get install dfu-util

More information about dfu-util can be found at their Homepage http://dfu-util.gnumonks.org