-
Notifications
You must be signed in to change notification settings - Fork 486
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
Probe wch.cn WCH-Link (2a86:8011) support #1395
Comments
Here is also another Chinese adapter based on CH549F MCU. |
Related issues: |
It looks like |
pyOCD is not relying on VID:PID to detect probes. pyOCD is relying on product string and also interface string when needed. The problem with WCH-Link is that it is not fully compliant to USB standard. It fails to report properly to get-string-descriptor requests in some condition. The workaround introduced in #1122 seems only effective with MacOS . |
Assuming you are using Linux environment, you may try the following. Edit this line of pyocd/probe/pydapaccess/interface/hidapi_backend.py to if ("CMSIS-DAP" not in product_name and "WCH-Link" not in product_name): and use it with specifying backend like this. You may also need to uninstall hid and install hidapi. |
Hi all! Thanks @elfmimi for helping out! 😄 There have actually been some changes related to this on Certainly there's an argument that matching by device name is more reliable/maintainable than matching by VID/PID pair. @eugene-bright I'll leave it up to you to decide. … More suggestions back on the PR #1399 so they are co-located with the code review… |
@eugene-bright Would you mind running Pyocd should find "CMSIS-DAP" if it's in the interface name string, as it is for the 1a86:8011 version of the WCH-Link (see the related issues you linked above). It would be nice to know if the same is true for this 2a86:8011 variant. Unfortunately, hidapi does not provide access to the USB interface name strings. But if you're on Linux, the pyusb backend should be used by default, and that can access interface names. Back story (partially copied from #1399)… The WCH-Link variant in this issue has a USB VID of 0x2a86. The one references in the links above has a VID of 0x1a86. The most recent USB-IF VID owners list shows that 0x1a86 is registered to Nanjing Qinheng Microelectronics Co., Ltd., aka WCH-IC. While 0x2a86 is registered to Kitrin AG. So either someone made a stupid typo in the code? Or something more nefarious is going on. 🤨 Is this 0x2a86 variant a clone of the real WCH-Link? |
Here it is
|
Tip for myself
In python this is equivalent to the
and raises |
The MCU chip marking of my |
Thanks! All very interesting. 😄 So it does indeed have "CMSIS-DAP" in the interface name. But the CDC control interface also has the name "QYF CMSIS-DAP". I wonder if that could be causing trouble? Like pyocd sees a "CMSIS-DAP" interface, but it has the wrong endpoints. Btw, do you have udev configured to allow access to the device? Presumably so, since your PR worked, but should asked. (And we might want to update the included udev rules.) hidapi might have worked around this; I've not used hidapi on Linux so I'm not sure exactly how it behaves with regards to permissions. |
The main issue is fixed in #1399 for the hidapi USB backend. |
I gave a try to a cheap
QYF2 CMSIS DAPLink
.pyOCD can't find the debugger.
It looks to be ordinary DAP-CMSIS with exotic VID and PID.
I can successfully access the chip with it using openocd this way:
The text was updated successfully, but these errors were encountered: