Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Windows, create the libusb1 backend explicitly by specifying the installed location of libusb-1.0.dll #101

Merged

Conversation

antoinevg
Copy link
Member

On Windows the usb1 Python package installs the libusb1 dll within the usb1 module directory but can not locate it to create a backend unless the module directory is added to the system PATH environment variable.

This PR modifies the ApolloDebugger._find_device() static method to, on Windows, obtain the backend by passing the location of the installed libusb-1.0.dll to libusb1.get_backend() and then passing that backend to usb.core.find().

This PR also modifies the other usage of usb.core.find() in FlashBridgeConnectionto use ApolloDebugger._find_device() instead.

It's important to note that, for future work on Apollo, the usb.core.find() method should no longer be used if Windows compatibility is to be maintained!

This is a companion PR to the one in Cynthion: greatscottgadgets/cynthion#129

Copy link
Member

@mossmann mossmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, and I've tested on Linux. I'd like to see a test on Windows from @martinling before merging.

@mossmann mossmann merged commit 87e0fe7 into greatscottgadgets:main Jul 9, 2024
11 checks passed
@mossmann mossmann mentioned this pull request Jul 9, 2024
2 tasks
@antoinevg antoinevg deleted the antoinevg/fix-windows-libusb1 branch July 10, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants