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

Unable to see device via --address flag on Windows #48

Closed
neilenns opened this issue Jan 23, 2022 · 8 comments
Closed

Unable to see device via --address flag on Windows #48

neilenns opened this issue Jan 23, 2022 · 8 comments

Comments

@neilenns
Copy link

neilenns commented Jan 23, 2022

Steps to reproduce:

  1. Plug in a RP2040 Pico to Windows 11 while holding down the BOOTSEL button
  2. Run picotool info

Result: device is found, reports no program information (correct)

  1. Run picotool info --address 5

Result: "No accessible RP2040 devices in BOOTSEL mode were found with address 5."
Expected result: device is found and reports no program information

I'm using WinUSB v6.1.760.16385 for the driver, installed via zadig. The device address comes from the device properties in Device Manager.

@neilenns
Copy link
Author

I've also tried with libusb-win32 (v1.2.6.0) just for fun but no change in behaviour.

@neilenns
Copy link
Author

It took a while but I was able to build the latest version of picotool locally. Running that with the device not in BOOTSEL mode got me output saying the device was at address 15, not 5. Using address 15 worked.

So I guess there's nothing wrong with picotool and it's just a matter of figuring out how to discover the address for the pico in device manager? I'll keep digging.

@lurch
Copy link
Contributor

lurch commented Jan 24, 2022

See also #26

@neilenns
Copy link
Author

@lurch I did see that as well. In my case I am trying to programmatically run picotool so I need some way to identify the boards beforehand then pass in the address of the board I want to reference.

For Arduinos this is done with the COM port, and that port is available in the Windows registry. I can enumerate the USB devices from the registry, find the COM port, then call avrdude accordingly.

I'm struggling to do the same with picotool because I can't find the address picotool is using in the registry (which shows 5 not 15 and a bus of 0 which picotool also doesn't think is valid).

@lurch
Copy link
Contributor

lurch commented Jan 24, 2022

Perhaps picotool is using some kind of "libusb addressing scheme" which is different to the Device-Manager addressing scheme? 🤷 (the fun thing about USB is how many different "layers" there are!)

And just in case it's not obvious - AFAIK it's only necessary to use the --address flag if you've got more than one Pico connected at once. With only a single Pico in use, picotool should just always correctly auto-detect it.

@neilenns
Copy link
Author

@lurch In my situation it's possible there will be many Picos connected at the same time so I need to be able to directly address them.

I agree, I think there's some sort of magic libusb addressing scheme going on. Unfortunately that's yet another layer down in the libusb code so I'm not sure how it's doing it :(

@kilograham
Copy link
Contributor

Yes, we are just relying on libusb - you may want to google to see if that is fabricating bus/addresses on Windows

@neilenns
Copy link
Author

I was able to get a sample app running using a .NET USB library (which I can integrate into my project) and enumerate the devices and see the address (15) and bus (2).

Closing this since it's obviously not a picotool problem.

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

No branches or pull requests

3 participants