kiffieboot

Crates.iokiffieboot
lib.rskiffieboot
version0.1.0
sourcesrc
created_at2023-06-30 20:03:06.378074
updated_at2023-06-30 20:03:06.378074
descriptionRuntime support for Kiffieboot
homepage
repositoryhttps://github.com/kiffie/kiffieboot
max_upload_size
id904920
size6,601
Stephan (kiffie)

documentation

README

Runtime support for Kiffieboot kb3k bootloader including USB interface

Crates.io docs.rs

This crate can be used to start the bootloader or to provide an USB Device Firmware Upgrade (DFU) class interface. The DFU support is based on the usbd-dfu-rt crate.

Example (USB DFU interface)

let sysclock = 48_000_000_u32.hz();
let clock = Osc::new(pac.OSC, sysclock);
let mut timer = Delay::new(sysclock);
let usb_bus = UsbBus::new(pac.USB);
let mut dfu_runtime = DfuRuntimeClass::new(&usb_bus, Kiffieboot::default());
let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
    .manufacturer("Some company")
    .product("Some USB device")
    .build();
loop {
    usb_dev.poll(&mut [&mut dfu_runtime]);
    dfu_runtime.tick(1);
    timer.delay_ms(1);
}

Example (directly jump into the bootloader)

 Kiffieboot::start_bootloader();

Example (using dfu-util from a Linux shell)

dfu-util -R -D my_application.bin
Commit count: 5

cargo fmt