On Linux, because the BMPv3 processor is quite so fast and the bootloader too, often the board'll drop off the bus as part of manifestation before the DFU crate is really ready and expecting it. This results in unsightly error output such as the following:
Error: ------------[ ✂ cut here ✂ ]------------
Unhandled crash in bmputil-cli v1.1.0
0: Black Magic Probe device found disconnected
Caused by: device disconnected
1: device disconnected
Location:
src/bmp.rs:491
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Please include all lines down to this one from the cut here
marker, and report this issue to our issue tracker at
https://codeberg.org/blackmagic-debug/bmputil/issues
However, the update has actually succeeded! This is just the device being a touch too fast for the update logic.
This PR addresses that by implementing more state tracking for how far the update progress has progressed and if it completes, suppressing the disconnection, turning it into an all-okay result:
Found: Black Magic Probe 2.0.0-495-gf119f67d5-dirty
Serial: 6DA18568
Port: 7-5
Erasing flash...
Flashing...
100% |██████████████████████████████████████████████████| 157.58 KiB/157.58 KiB [33.34 KiB/s 5s] [2026年04月12日T22:49:23Z INFO bmputil::flasher] Flash complete!
Black Magic Probe successfully rebooted into firmware version 2.0.0-495-gf119f67d5-dirty