5
3
Fork
You've already forked bmputil
2

Fix: Linux BMPv3 disconnect suppression #81

Manually merged
dragonmux merged 2 commits from fix/linux-bmpv3-disconnect-suppression into main 2026年04月13日 03:10:36 +02:00

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
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 ```
bmp: Implemented a completion-based suppression for the disconnection errors that can be emitted in BmpDevice::try_download() even when the transfer has actually finished
All checks were successful
ci/woodpecker/manual/build-windows/2 Pipeline was successful
ci/woodpecker/manual/build-linux Pipeline was successful
ci/woodpecker/manual/build-windows/1 Pipeline was successful
ci/woodpecker/push/build-windows/2 Pipeline was successful
ci/woodpecker/push/build-linux Pipeline was successful
ci/woodpecker/push/build-windows/1 Pipeline was successful
f903aac3de
esden left a comment
Copy link

LGTM

LGTM
esden scheduled this pull request to auto merge when all checks succeed 2026年04月13日 01:09:56 +02:00
dragonmux canceled auto merging this pull request when all checks succeed 2026年04月13日 03:09:42 +02:00
dragonmux scheduled this pull request to auto merge when all checks succeed 2026年04月13日 03:09:56 +02:00
dragonmux manually merged commit f903aac3de into main 2026年04月13日 03:10:36 +02:00
dragonmux deleted branch fix/linux-bmpv3-disconnect-suppression 2026年04月13日 03:10:56 +02:00
Author
Owner
Copy link

Manually merged as CI wasn't going to come good due to that outage making the PR jobs fail to run - the manual run succeeded.

Manually merged as CI wasn't going to come good due to that outage making the PR jobs fail to run - the manual run succeeded.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
blackmagic-debug/bmputil!81
Reference in a new issue
blackmagic-debug/bmputil
No description provided.
Delete branch "fix/linux-bmpv3-disconnect-suppression"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?