Skip to content

Commit

Permalink
Merge pull request #63 from mndza/fix-handoff-windows
Browse files Browse the repository at this point in the history
apollo_fpga: fix handing off USB port to Apollo under Windows
  • Loading branch information
mossmann authored May 20, 2024
2 parents 79f1a9c + bd0c541 commit f9d2d11
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apollo_fpga/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import time
import usb.core
import platform

from .jtag import JTAGChain
from .spi import DebugSPIConnection
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f9d2d11

Please sign in to comment.