Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DFU mode: improve programming robustness.
The ctrl_transfer in dfu.get_status() might return usb.core.USBError with errno == EPIPE, seen when called in quick succession. This is the case when called from dfu.block_on_state(). The next call usually works. This change tries to catch this specific error and just re-tries up to two times in case it happens. Without this change, the error (and programming abort) might get undetected, as 'click' catches IOerror/EPIPE silently. This has significant potential to brick a device if you don't check the output and return code of 'solo' closely enough.
- Loading branch information