ventosus.ch Open Music Kontrollers

dfuse_pack

A DfuSe packer (USB device firmware upgrade STMicroelectronics extension)

This command line utility lets you pack raw binary firmware images into a DfuSe image container to be downloaded by any compatible flasher. The ideal companion to extend your automated build and release infrastructure based on DfuSe containers.

Dependencies

Build / install

meson build
cd build
ninja -j4
sudo ninja install

Arguments

Usage

You need to provide at least one alternate setting with at least one image and an output for the program to succeed. Some command line arguments can occur multiple times ([-a], [-n], [-m], [-i]) and some must be given in the correct order: The memory target [-m] must precede its associated image file [-i]. The latter two and the target name [-n] must precede their associated alternate setting [-a].

A minimal working example using all the defaults for omitted arguments:

dfuse_pack \
    -o firmware.dfu \
        -i image.bin \
    -a 0

A more complex one based on two images for alternate setting 0 and a single image for alternate setting 1:

dfuse_pack \
    -f 0x0100 \
    -p 0xdf11 \
    -v 0x0483 \
    -o firmware.dfu \
        -n "INTERNAL FLASH of my awesome app v0.1.0" \
        -m 0x08000000 -i boot.bin \
        -m 0x08005000 -i code.bin \
    -a 0 \
        -n "OPTION BYTES of my awesome app v0.1.0" \
        -m 0x1ffff8000 -i options.bin \
    -a 1

References

DfuSe file specification: DfuSe USB device firmware upgrade STMicroelectronics extension

DfuSe compatible open source flasher: dfu-util

Source