Skip to content

Commit

Permalink
dfu: Detach kernel driver first
Browse files Browse the repository at this point in the history
Set configuration after, not before attempting to detach kernel driver.
  • Loading branch information
mossmann committed Jul 18, 2024
1 parent f964ac1 commit 14de95e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fwup/dfu.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,15 @@ def __init__(self, index=0, detach=True, timeout=5000, *args, **kwargs):

# ... and ensure the relevant configuration is active.
try:
self.device.set_configuration(self.configuration)
self.device.detach_kernel_driver(self.interface)
except:
pass

try:
self.device.set_configuration(self.configuration)
except:
pass

# Read the device's download parameters.
self.__read_device_info()

Expand Down

0 comments on commit 14de95e

Please sign in to comment.