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

rusty-probe enumerates two USB devices #20

Closed
igiona opened this issue Sep 9, 2024 · 12 comments
Closed

rusty-probe enumerates two USB devices #20

igiona opened this issue Sep 9, 2024 · 12 comments

Comments

@igiona
Copy link

igiona commented Sep 9, 2024

At least on windows (I did not test other OSs yet), the rusty-probe enumerates as two devices with the same serial number.
For this reason, probe-rs requires additional parameters --probe 1209:4853 even though I actually have only one probe connected.
When developing and working via command-line it's quite annoying.

Is there a way to avoid this double-enumeration?
Why it's there in the first place? I don't see for me a way to select "the other" probe, since PID and VID are the same...

@Yatekii
Copy link
Member

Yatekii commented Sep 9, 2024

cc @korken89

@igiona
Copy link
Author

igiona commented Sep 9, 2024

Additional information, this is the output of probe-rs list :

$ probe-rs list
The following debug probes were found:
[0]: Rusty Probe with CMSIS-DAP v1/v2 Support (VID: 1209, PID: 4853, Serial: DC645020138A1122EF4014, CmsisDap)
[1]: HS-Probe CMSIS-DAP v1 Interface (VID: 1209, PID: 4853, Serial: dc645020138a1122ef4014, CmsisDap)

@jannic
Copy link

jannic commented Oct 1, 2024

A similar thing has been mentioned on matrix a while ago: https://matrix.to/#/!vhKMWjizPZBgKeknOo:matrix.org/$9MlglhlFheOzD1NGEnnf1jRZrPQokowR8M-SNUTeMJY?via=matrix.org&via=chat.berline.rs&via=tchncs.de

Dirbaio diagnosed it as probably caused by kevinmehall/nusb#22

@korken89
Copy link
Collaborator

korken89 commented Oct 4, 2024

That's odd, how do you get this to happen? I was not able to reproduce on any of my computers, but it seems like two interfaces have different descriptions.
I'll look into it during my update of the HAL.

@igiona
Copy link
Author

igiona commented Oct 6, 2024

That's odd, how do you get this to happen? I was not able to reproduce on any of my computers, but it seems like two interfaces have different descriptions.
I'll look into it during my update of the HAL.

Nothing special to be honest.
I'm using a USB HUB, hard to believe but maybe it's because of that?
My PC has WSL enabled, maybe the USB drivers get messed up?
I'll try on other machines as well and let you know.

@korken89
Copy link
Collaborator

korken89 commented Oct 6, 2024

Ah sorry, I did not know you ran on Windows.
I'll dig up a Windows computer to test on :)

@abelREK
Copy link

abelREK commented Nov 5, 2024

I can confirm that this also happens on windows for me.

@korken89
Copy link
Collaborator

I've checked now and we only register one device, however it has multiple interfaces. Not sure why that would be a problem. To me it seems like an nusb issue on Windows, has anyone opened an issue at probe-rs? The interface logic seems like it needs special handling in Windows or maybe nusb needs some looking into. 😅

@igiona
Copy link
Author

igiona commented Nov 10, 2024

I've checked now and we only register one device, however it has multiple interfaces. Not sure why that would be a problem. To me it seems like an nusb issue on Windows, has anyone opened an issue at probe-rs? The interface logic seems like it needs special handling in Windows or maybe nusb needs some looking into. 😅

Thank you for looking into it @korken89 .
If it would be an USB driver issue, other probes would suffer from the same issue no?
I have a AK-CMSIS-DAP here, and it enumerates only once...

$ probe-rs.exe list
The following debug probes were found:
[0]: Rusty Probe with CMSIS-DAP v1/v2 Support (VID: 1209, PID: 4853, Serial: DC645020138A1122EF4014, CmsisDap)
[1]: AK-CMSIS-DAP (VID: 10c4, PID: 8b54, Serial: AKA5130B, CmsisDap)
[2]: HS-Probe CMSIS-DAP v1 Interface (VID: 1209, PID: 4853, Serial: dc645020138a1122ef4014, CmsisDap)

@korken89
Copy link
Collaborator

Ah no, I see the confusion, but the difference is that the probe is one device with two interfaces. It exposes a CMSIS-DAP v1 and v2 at the same time so both old and new tooling can use it. The issue though is that probe-rs, AFAIK, hides redundant interfaces of probes and only shows the v2. And in here lies the issue because on Windows, for some reason, the interfaces don't get the same serial ID. Hence why it can be fixed in probe-rs by doing comparison that is not case sensitive, or in nusb to fix the serial ID output.

In your case though I would just remove the V1 interface, it would be the easiest solution. Maybe it's worth adding a feature gate to enable the dual interface that's enabled by default? It would make it easier.

@igiona
Copy link
Author

igiona commented Nov 10, 2024

Ah no, I see the confusion, but the difference is that the probe is one device with two interfaces. It exposes a CMSIS-DAP v1 and v2 at the same time so both old and new tooling can use it. The issue though is that probe-rs, AFAIK, hides redundant interfaces of probes and only shows the v2. And in here lies the issue because on Windows, for some reason, the interfaces don't get the same serial ID. Hence why it can be fixed in probe-rs by doing comparison that is not case sensitive, or in nusb to fix the serial ID output.

They actuall have the same serial, but a different case.
Likely probe-rs does a full string match on the serial number, relaxing the check could solve the issue I guess.
I'll open an issue on probe-rs soon.

In your case though I would just remove the V1 interface, it would be the easiest solution. Maybe it's worth adding a feature gate to enable the dual interface that's enabled by default? It would make it easier

With this you mean "customizing" the FW of the rusty probe, right?

@korken89
Copy link
Collaborator

With this you mean "customizing" the FW of the rusty probe, right?

Correct. It's a small change to perform.

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

5 participants