USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
Loading...
Searching...
No Matches
DFU - Device Firmware Upgrade
+ Collaboration diagram for DFU - Device Firmware Upgrade:

Files

file  dfu.h
 USB DFU (Device Firmware Upgrade) device class, DFU 1.1.
 

Data Structures

struct  dfu_target
 One DFU target == one alternate setting == one app-supplied linear byte store. More...
 
struct  dfu_opts
 DFU configuration: the target table + DFU functional-descriptor parameters. More...
 

Typedefs

typedef struct dfu_iface dfu_iface
 One DFU interface: a single instance of the class on a device.
 

Enumerations

enum  dfu_status {
  DFU_STATUS_OK , DFU_STATUS_errTARGET , DFU_STATUS_errFILE , DFU_STATUS_errWRITE ,
  DFU_STATUS_errERASE , DFU_STATUS_errCHECK_ERASED , DFU_STATUS_errPROG , DFU_STATUS_errVERIFY ,
  DFU_STATUS_errADDRESS , DFU_STATUS_errNOTDONE , DFU_STATUS_errFIRMWARE , DFU_STATUS_errVENDOR ,
  DFU_STATUS_errUSBR , DFU_STATUS_errPOR , DFU_STATUS_errUNKNOWN , DFU_STATUS_errSTALLEDPKT
}
 DFU bStatus codes (DFU 1.1 Sec.6.1.2), reported to the host via DFU_GETSTATUS. More...
 

Functions

dfu_ifacedfu_add (usbip_device *dev, const dfu_opts *opts)
 Add a DFU interface to a device (one alternate setting per target).
 

Variables

const usbip_device_class usbip_device_dfu
 The DFU class, for usbip_device_add_class()
 

Detailed Description

Typedef Documentation

◆ dfu_iface

typedef struct dfu_iface dfu_iface

One DFU interface: a single instance of the class on a device.

Opaque - create one with dfu_add() and use the functions below. Distinct from the other classes' handles, so mixing them up is a compile error rather than a misread state block.

Enumeration Type Documentation

◆ dfu_status

enum dfu_status

DFU bStatus codes (DFU 1.1 Sec.6.1.2), reported to the host via DFU_GETSTATUS.

A target's write() returns DFU_STATUS_OK (0) on success, or one of these to make the device enter dfuERROR and report that status - pick the one that fits, or DFU_STATUS_errWRITE as a catch-all "couldn't store it".

Enumerator
DFU_STATUS_OK 

No error.

DFU_STATUS_errTARGET 

File is not for this device.

DFU_STATUS_errFILE 

File fails a vendor verification test.

DFU_STATUS_errWRITE 

Unable to write memory.

DFU_STATUS_errERASE 

Memory erase failed.

DFU_STATUS_errCHECK_ERASED 

Memory erase check failed.

DFU_STATUS_errPROG 

Program memory function failed.

DFU_STATUS_errVERIFY 

Programmed memory failed verification.

DFU_STATUS_errADDRESS 

Received address is out of range.

DFU_STATUS_errNOTDONE 

Zero-length DNLOAD but not all data received.

DFU_STATUS_errFIRMWARE 

Firmware corrupt; cannot return to run-time.

DFU_STATUS_errVENDOR 

Vendor-specific error (see iString)

DFU_STATUS_errUSBR 

Unexpected USB reset.

DFU_STATUS_errPOR 

Unexpected power-on reset.

DFU_STATUS_errUNKNOWN 

Something went wrong, cause unknown.

DFU_STATUS_errSTALLEDPKT 

Device stalled an unexpected request.

Function Documentation

◆ dfu_add()

dfu_iface * dfu_add ( usbip_device dev,
const dfu_opts opts 
)

Add a DFU interface to a device (one alternate setting per target).

Parameters
devthe device.
optsthe target table + DFU functional-descriptor parameters (see dfu_opts).
Returns
the DFU handle, or NULL on error.

Variable Documentation

◆ usbip_device_dfu

const usbip_device_class usbip_device_dfu
extern

The DFU class, for usbip_device_add_class()