Sans IO core library (traits and tools) for DFU.
-
no_std
compatible - async and sync compatible
- write a firmware into a device (DFU download)
- read a firmware from a device (DFU upload)
- minimal dependencies
- uses a state machine to ensure the implementations are correctly done
trait DfuIo
: a trait that can be made into an object that provides the IO to this library logic.struct DfuSansIo
: a struct that allows the developer to do the DFU logic using a state machine (can be async or sync).struct DfuSync
: a basic sync implementation that uses aDfuIo
provided in argument during runtime.type MemoryPage
andtype mem
: primitives representing the memory layout of the device (likechar
andstr
).struct MemoryLayout
: (requires featuresstd
) an allocated representation of the memory layout (likeString
) that can parse a memory layout from a string.FunctionalDescriptor
: can read the extra bytes of a USB functional descriptor to provide information for the DFU logic.
This crate has been made based on the following specifications:
- DFU 1.1 (Aug 5 2004): https://www.usb.org/sites/default/files/DFU_1.1.pdf
- STM32/DfuSe extensions: https://www.st.com/content/ccc/resource/technical/document/user_manual/cc/6d/c3/43/ea/29/4b/eb/CD00135281.pdf/files/CD00135281.pdf/jcr:content/translations/en.CD00135281.pdf
MIT OR Apache-2.0