PebbleOS v4.47.0-757-g12b6c531f
Loading...
Searching...
No Matches
USB firmware upgrade

Device Firmware Upgrade 1.1, in DFU mode: a host downloads an image to a flash partition and uploads it back, as with dfu-util. More...

Data Structures

struct  pbl_usb_dfu_region
 A flash partition the host can download to and upload from. More...
 

Macros

#define PBL_USB_DFU_REGION_DEFINE(_name, _part)
 Define a region of the function.
 

Detailed Description

Device Firmware Upgrade 1.1, in DFU mode: a host downloads an image to a flash partition and uploads it back, as with dfu-util.

The function takes the interface after the serial port's, or interface 0 without it, and only endpoint 0. The partition it writes is a region the application defines with PBL_USB_DFU_REGION_DEFINE(): the function erases its subsectors as the download reaches them, and never writes outside it. A download starts at the beginning of the region, an upload reads it whole, ending with a short block. The flash work runs on the system work queue, while the host polls the status.

PBL_USB_DFU_REGION_DEFINE(image, PART_DFU);
#define PBL_USB_DFU_REGION_DEFINE(_name, _part)
Define a region of the function.
Definition dfu.h:44
int pbl_usbd_enable(void)
Connect the device to the bus, once: the controller first, if it is not up yet.

Data Structure Documentation

◆ pbl_usb_dfu_region

struct pbl_usb_dfu_region

A flash partition the host can download to and upload from.

Data Fields
struct pbl_flash_partition part Partition.

Macro Definition Documentation

◆ PBL_USB_DFU_REGION_DEFINE

#define PBL_USB_DFU_REGION_DEFINE (   _name,
  _part 
)
Value:
static const struct pbl_usb_dfu_region pbl_usb_dfu_region_##_name PBL_ITERABLE_SECTION( \
const struct pbl_usb_dfu_region, usb_dfu_regions, #_name) = { \
.part = {.offset = _part##_OFFSET, .size = _part##_SIZE}, \
}
uint32_t offset
Offset of the first byte in the flash.
Definition partition.h:37
#define PBL_ITERABLE_SECTION(type, tag, key)
Add the object to an iterable section, a table gathered at link time from any file.
Definition section.h:124
struct pbl_flash_partition part
Partition.
Definition dfu.h:33
A flash partition the host can download to and upload from.
Definition dfu.h:31

Define a region of the function.

Only one region is supported, alternate setting 0 of the interface.

Parameters
_nameName of the region.
_partPartition, as the prefix of its _OFFSET and _SIZE constants, e.g. PART_DFU.