diff --git a/apollo_fpga/__init__.py b/apollo_fpga/__init__.py index a84612a..07ba0be 100644 --- a/apollo_fpga/__init__.py +++ b/apollo_fpga/__init__.py @@ -7,6 +7,7 @@ import os import time import usb.core +import platform from .jtag import JTAGChain from .spi import DebugSPIConnection @@ -129,6 +130,10 @@ def _request_handoff(cls, device): if stub_if is None: raise DebuggerNotFound("No Apollo stub interface found") + # In Windows, we first need to claim the target interface. + if platform.system() == "Windows": + usb.util.claim_interface(device, stub_if) + # Send the request intf_number = stub_if.bInterfaceNumber REQUEST_APOLLO_ADV_STOP = 0xF0