Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2818

OpenOCD: unable to find a matching CMSIS-DAP device in WSL

$
0
0

I am trying to connect GDB in WSL to an Atmel SAMV71 Xplained Ultra board. I am getting stuck trying to get OpenOCD to connect to the board.

I am using the following OpenOCD config file:

atmel_samv71_xplained_ultra_edbg.cfg

source [find interface/cmsis-dap.cfg]source [find board/atmel_samv71_xplained_ultra.cfg]source [find target/atsamv.cfg]

Using OpenOCD in Windows, I can connect without an issue:

...Debug: 62 214 target.c:1657 handle_target_init_command(): Initializing targets...Debug: 63 216 semihosting_common.c:109 semihosting_common_init():...Debug: 70 333 cmsis_dap_usb_bulk.c:151 cmsis_dap_usb_open(): found product string of 0x03eb:0x2111 'EDBG CMSIS-DAP'Debug: 71 337 cmsis_dap_usb_bulk.c:171 cmsis_dap_usb_open(): enumerating interfaces of 0x03eb:0x2111Debug: 72 340 cmsis_dap_usb_bulk.c:218 cmsis_dap_usb_open(): found interface 0 string 'EDBG CMSIS-DAP'Debug: 73 343 cmsis_dap_usb_bulk.c:238 cmsis_dap_usb_open(): skipping interface 0, endpoint[0] is not bulk outDebug: 74 347 cmsis_dap_usb_bulk.c:231 cmsis_dap_usb_open(): skipping interface 1, has only 1 endpointsDebug: 75 350 cmsis_dap_usb_bulk.c:238 cmsis_dap_usb_open(): skipping interface 2, endpoint[0] is not bulk outDebug: 76 353 cmsis_dap_usb_bulk.c:238 cmsis_dap_usb_open(): skipping interface 3, endpoint[0] is not bulk out...Info : 84 483 cmsis_dap.c:1027 cmsis_dap_get_caps_info(): CMSIS-DAP: SWD supportedInfo : 85 486 cmsis_dap.c:1004 cmsis_dap_get_version_info(): CMSIS-DAP: FW Version = 03.25.01B6Info : 86 489 cmsis_dap.c:989 cmsis_dap_get_serial_info(): CMSIS-DAP: Serial# = ATML2407161800006103Info : 87 492 cmsis_dap.c:1156 cmsis_dap_swd_open(): CMSIS-DAP: Interface Initialised (SWD)Debug: 88 496 cmsis_dap.c:1238 cmsis_dap_init(): CMSIS-DAP: Packet Count = 4Debug: 89 498 cmsis_dap.c:1241 cmsis_dap_init(): Allocating FIFO for 3 pending packetsInfo : 90 501 cmsis_dap.c:1066 cmsis_dap_get_status(): SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1Info : 91 506 cmsis_dap.c:1292 cmsis_dap_init(): CMSIS-DAP: Interface ready...

The project I'm working on requires many Linux tools to build easily so I am attempting to connect through WSL. I have followed the instructions to use USBIPD.

I'm using Windows 11 so I didn't think I needed a custom kernel:

$ uname -aLinux DESKTOP-U0P8IUP 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Here are my udev rules that I have loaded (checked and tested with udevadm) and I have ensured that I am a member of plugdev:

60-openocd.rules

ACTION!="add|change", GOTO="openocd_rules_end"SUBSYSTEM=="gpio", MODE="0660", GROUP="plugdev", TAG+="uaccess"SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"...# Atmel SAMV71 Xplained UltraATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2111", MODE="660", GROUP="plugdev", TAG+="uaccess"...# CMSIS-DAP compatible adaptersATTRS{product}=="*CMSIS-DAP*", MODE="660", GROUP="plugdev", TAG+="uaccess"...

And the device attaches okay:

$ lsusb -v...Bus 001 Device 003: ID 03eb:2111 Atmel Corp. Xplained Pro board debugger and programmerDevice Descriptor:  bLength                18  bDescriptorType         1  bcdUSB               2.00  bDeviceClass          239 Miscellaneous Device  bDeviceSubClass         2   bDeviceProtocol         1 Interface Association  bMaxPacketSize0        64  idVendor           0x03eb Atmel Corp.  idProduct          0x2111 Xplained Pro board debugger and programmer  bcdDevice            1.01  iManufacturer           1 Atmel Corp.  iProduct                2 EDBG CMSIS-DAP  iSerial                 3 ATML2407161800006103  bNumConfigurations      1  Configuration Descriptor:    bLength                 9    bDescriptorType         2    wTotalLength       0x0082    bNumInterfaces          4    bConfigurationValue     1    iConfiguration          0     bmAttributes         0x80      (Bus Powered)    MaxPower              500mA    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        0      bAlternateSetting       0      bNumEndpoints           2      bInterfaceClass         3 Human Interface Device      bInterfaceSubClass      0       bInterfaceProtocol      0       iInterface              4 EDBG CMSIS-DAP        HID Device Descriptor:          bLength                 9          bDescriptorType        33          bcdHID               1.11          bCountryCode            0 Not supported          bNumDescriptors         1          bDescriptorType        34 Report          wDescriptorLength      35         Report Descriptors:            ** UNAVAILABLE **      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x01  EP 1 OUT        bmAttributes            3          Transfer Type            Interrupt          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0200  1x 512 bytes        bInterval               1      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x82  EP 2 IN        bmAttributes            3          Transfer Type            Interrupt          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0200  1x 512 bytes        bInterval               1    Interface Association:      bLength                 8      bDescriptorType        11      bFirstInterface         1      bInterfaceCount         2      bFunctionClass          2 Communications      bFunctionSubClass       2 Abstract (modem)      bFunctionProtocol       1 AT-commands (v.25ter)      iFunction               6 EDBG Virtual COM Port    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        1      bAlternateSetting       0      bNumEndpoints           1      bInterfaceClass         2 Communications      bInterfaceSubClass      2 Abstract (modem)      bInterfaceProtocol      1 AT-commands (v.25ter)      iInterface              0       CDC Header:        bcdCDC               1.10      CDC ACM:        bmCapabilities       0x06          sends break          line coding and serial state      CDC Union:        bMasterInterface        1        bSlaveInterface         2       CDC Call Management:        bmCapabilities       0x03          call management          use DataInterface        bDataInterface          2      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x83  EP 3 IN        bmAttributes            3          Transfer Type            Interrupt          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0040  1x 64 bytes        bInterval               8    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        2      bAlternateSetting       0      bNumEndpoints           2      bInterfaceClass        10 CDC Data      bInterfaceSubClass      0       bInterfaceProtocol      0       iInterface              0       Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x84  EP 4 IN        bmAttributes            2          Transfer Type            Bulk          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0040  1x 64 bytes        bInterval               0      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x05  EP 5 OUT        bmAttributes            2          Transfer Type            Bulk          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0040  1x 64 bytes        bInterval               0    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        3      bAlternateSetting       0      bNumEndpoints           2      bInterfaceClass       255 Vendor Specific Class      bInterfaceSubClass    255 Vendor Specific Subclass      bInterfaceProtocol    255 Vendor Specific Protocol      iInterface              5 EDBG Data Gateway      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x87  EP 7 IN        bmAttributes            2          Transfer Type            Bulk          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0200  1x 512 bytes        bInterval             255      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x06  EP 6 OUT        bmAttributes            2          Transfer Type            Bulk          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0200  1x 512 bytes        bInterval             255Device Qualifier (for other device speed):  bLength                10  bDescriptorType         6  bcdUSB               2.00  bDeviceClass          239 Miscellaneous Device  bDeviceSubClass         2   bDeviceProtocol         1 Interface Association  bMaxPacketSize0        64  bNumConfigurations      1Device Status:     0x0000  (Bus Powered)...

But trying to connect with OpenOCD results in the following:

...Debug: 71 5 target.c:1639 handle_target_init_command(): Initializing targets...Debug: 72 5 semihosting_common.c:99 semihosting_common_init():  ...Debug: 74 11 cmsis_dap_usb_bulk.c:156 cmsis_dap_usb_open(): found product string of 0x03eb:0x2111 'EDBG CMSIS-DAP'Debug: 75 11 cmsis_dap_usb_bulk.c:176 cmsis_dap_usb_open(): enumerating interfaces of 0x03eb:0x2111Debug: 76 12 cmsis_dap_usb_bulk.c:223 cmsis_dap_usb_open(): found interface 0 string 'EDBG CMSIS-DAP'Debug: 77 12 cmsis_dap_usb_bulk.c:243 cmsis_dap_usb_open(): skipping interface 0, endpoint[0] is not bulk outDebug: 78 12 cmsis_dap_usb_bulk.c:236 cmsis_dap_usb_open(): skipping interface 1, has only 1 endpointsDebug: 79 12 cmsis_dap_usb_bulk.c:243 cmsis_dap_usb_open(): skipping interface 2, endpoint[0] is not bulk outDebug: 80 13 cmsis_dap_usb_bulk.c:243 cmsis_dap_usb_open(): skipping interface 3, endpoint[0] is not bulk out...Error: 82 13 cmsis_dap.c:259 cmsis_dap_open(): unable to find a matching CMSIS-DAP deviceDebug: 83 13 command.c:628 run_command(): Command 'init' failed with error code -4...

After finding this post, I checked to see that I was getting the same error in dmesg:

$ dmesg| grep -i hid                                                                                                                                                    ⏎[    0.348324] usbcore: registered new interface driver usbhid[    0.348507] usbhid: USB HID core driver[   48.383257] hid-generic 0003:03EB:2111.0001: device has no listeners, quitting

I compiled a custom kernel with CONFIG_USB_HIDDEV tuned on and ensured that it was running:

$ dmesg| grep -i hid[    0.000000] Linux version 5.15.133.1-microsoft-standard-WSL2-with-HIDDEV+ (kyle@DESKTOP-U0P8IUP) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP Tue Dec 5 13:09:53 EST 2023[    0.369619] usb usb1: Manufacturer: Linux 5.15.133.1-microsoft-standard-WSL2-with-HIDDEV+ vhci_hcd[    0.372640] usb usb2: Manufacturer: Linux 5.15.133.1-microsoft-standard-WSL2-with-HIDDEV+ vhci_hcd[    0.376862] usbcore: registered new interface driver usbhid[    0.377012] usbhid: USB HID core driver[   92.238687] hid-generic 0003:03EB:2111.0001: hiddev96: USB HID v1.11 Device [Atmel Corp. EDBG CMSIS-DAP] on usb-vhci_hcd.0-1/input0

But I am receiving the same error from OpenOCD.

What else am I missing? There are many other configuration options related to USB HID devices in the WSL kernel. Are there others that are needed? Are there other udev rules that are needed? Has anyone else successfully connected to this board using WSL?


Viewing all articles
Browse latest Browse all 2818

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>