- RAM
- SF (serial flash)
- MTD (all MTD device: NAND, SPI-NOR, SPI-NAND,...)
+ - virtual
These DFU backends are also used by
- the dfutftp (see README.dfutftp)
- the thordown command (cmd/thordown.c and gadget/f_thor.c)
+ The "virtual" backend is a generic DFU backend to support a board specific
+ target (for example OTP), only based on the weak functions:
+ - dfu_write_medium_virt
+ - dfu_get_medium_size_virt
+ - dfu_read_medium_virt
+
Configuration Options:
CONFIG_DFU
CONFIG_DFU_OVER_USB
CONFIG_DFU_RAM
CONFIG_DFU_SF
CONFIG_DFU_SF_PART
+ CONFIG_DFU_TIMEOUT
+ CONFIG_DFU_VIRTUAL
CONFIG_CMD_DFU
Environment variables:
dfu <USB_controller> [<interface> <dev>] list
list the alternate device defined in "dfu_alt_info"
- dfu <USB_controller> [<interface> <dev>]
+ dfu <USB_controller> [<interface> <dev>] [<timeout>]
start the dfu stack on the USB instance with the selected medium
backend and use the "dfu_alt_info" variable to configure the
alternate setting and link each one with the medium
The dfu command continue until receive a ^C in console or
- a DFU detach transaction from HOST.
+ a DFU detach transaction from HOST. If CONFIG_DFU_TIMEOUT option
+ is enabled and <timeout> parameter is present in the command line,
+ the DFU operation will be aborted automatically after <timeout>
+ seconds of waiting remote to initiate DFU session.
The possible values of <interface> are :
(with <USB controller> = 0 in the dfu command example)
with <partid> is the MTD partition index
+ "virt"
+ cmd: dfu 0 virt <dev>
+ each element in "dfu_alt_info" =
+ <name>
+
<interface> and <dev> are absent:
the dfu command to use multiple devices
cmd: dfu 0 list
ram <dev>=<alt1>;....;<altN>
sf <dev>=<alt1>;....;<altN>
mtd <dev>=<alt1>;....;<altN>
+ virt <dev>=<alt1>;....;<altN>
+Callbacks:
+ The weak callback functions can be implemented to manage specific behavior
+ - dfu_initiated_callback : called when the DFU transaction is started,
+ used to initiase the device
+ - dfu_flush_callback : called at the end of the DFU write after DFU
+ manifestation, used to manage the device when
+ DFU transaction is closed
Host tools:
When U-Boot runs the dfu stack, the DFU host tools can be used
dev: MTD alt: 1 name: u-boot layout: RAW_ADDR
dev: MTD alt: 2 name: u-boot-env layout: RAW_ADDR
dev: MTD alt: 3 name: UBI layout: RAW_ADDR
+
+ Example 3: firmware located in SD Card (mmc) and virtual partition on
+ OTP and PMIC not volatile memory
+ - alternate 1 (alt=1) for scard
+ - alternate 2 (alt=2) for OTP (virtual)
+ - alternate 3 (alt=3) for PMIC NVM (virtual)
+
+ U-Boot> env set dfu_alt_info \
+ "mmc 0=sdcard raw 0 0x100000&"\
+ "virt 0=otp" \
+ "virt 1=pmic"
+
+ U-Boot> dfu 0 list
+ DFU alt settings list:
+ dev: eMMC alt: 0 name: sdcard layout: RAW_ADDR
+ dev: VIRT alt: 1 name: otp layout: RAW_ADDR
+ dev: VIRT alt: 2 name: pmic layout: RAW_ADDR