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

Windows11: OpenOCD from MSDK cannot initialize the MAX32625PICO CMSIS-DAP #1251

Open
rhempel opened this issue Nov 4, 2024 · 5 comments
Open

Comments

@rhempel
Copy link

rhempel commented Nov 4, 2024

On my corporate managed Windows11 laptop, the OpenOCD from the MSDK installer will not open the MAX32625PICO CMSIS-DAP device.

On the same laptop, a VirtualBox VM that we attach the same PICO to as a USB device will work under OpenOCD and PyOCD

At this point I'm not sure if it's a general Windows 11 issue, or if it has to do with the corporate management of USB devices - long story short is I can't do any work with the MAX32690FTHR board until this is working.

I can work around it using a Linux laptop but ideally I would like to use a standard (if somewhat locked down) Windows11 device.

Debug: 87 298 semihosting_common.c:109 semihosting_common_init(): Debug: 88 345 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x2109:0x0813: Operation not supported or unimplemented on this platform Debug: 89 345 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x27c6:0x63ac: Access denied (insufficient permissions) Debug: 90 345 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x8087:0x0033: Operation not supported or unimplemented on this platform Debug: 91 361 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x8086:0x51ed: Operation not supported or unimplemented on this platform Debug: 92 361 cmsis_dap_usb_bulk.c:150 cmsis_dap_usb_open(): found product string of 0x0d28:0x0204 'DAPLink CMSIS-DAP' Debug: 93 371 cmsis_dap_usb_bulk.c:170 cmsis_dap_usb_open(): enumerating interfaces of 0x0d28:0x0204 Debug: 94 377 cmsis_dap_usb_bulk.c:237 cmsis_dap_usb_open(): skipping interface 0, endpoint[0] is not bulk out Debug: 95 377 cmsis_dap_usb_bulk.c:230 cmsis_dap_usb_open(): skipping interface 1, has only 1 endpoints Debug: 96 377 cmsis_dap_usb_bulk.c:276 cmsis_dap_usb_open(): skipping interface 2, class 10 subclass 0 protocol 0 Debug: 97 377 cmsis_dap_usb_bulk.c:217 cmsis_dap_usb_open(): found interface 3 string 'CMSIS-DAP v1' Debug: 98 393 cmsis_dap_usb_bulk.c:237 cmsis_dap_usb_open(): skipping interface 3, endpoint[0] is not bulk out Debug: 99 393 cmsis_dap_usb_bulk.c:217 cmsis_dap_usb_open(): found interface 4 string 'WebUSB: CMSIS-DAP' Debug: 100 393 cmsis_dap_usb_bulk.c:230 cmsis_dap_usb_open(): skipping interface 4, has only 0 endpoints Debug: 101 393 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x0c45:0x6d1f: Entity not found Debug: 102 408 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x8086:0x461e: Operation not supported or unimplemented on this platform Debug: 103 408 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x2109:0x2813: Operation not supported or unimplemented on this platform Debug: 104 408 cmsis_dap_usb_bulk.c:105 cmsis_dap_usb_open(): could not open device 0x0b95:0x1790: Operation not supported or unimplemented on this platform Error: 105 424 cmsis_dap.c:293 cmsis_dap_open(): unable to find a matching CMSIS-DAP device Debug: 106 424 command.c:544 run_command(): Command 'init' failed with error code -4

@rhempel rhempel changed the title OpenOCD from MSDK cannot initialize the MAX32625PICO CMSIS-DAP Windows11: OpenOCD from MSDK cannot initialize the MAX32625PICO CMSIS-DAP Nov 4, 2024
@Jake-Carter
Copy link
Contributor

@rhempel I can confirm that our toolchain should work on Windows 11. I have been using on my home machine successfully.

The error log seems like permission issues on the USB port. You will need USB read/write access on the machine to connect to the PICO. I suspect IT has locked this on your managed machine. If you can write a file to a USB drive you should have equivalent permissions to connect to the PICO.

The "could not open device" messages are standard as OpenOCD iterates across all the USB devices it can find. The device ID for the PICO is 0x0d28:0x0204, which it is finding successfully during the scan. I've attached a log from my W11 machine for reference.

win11_connect_log.zip

They key errors in your log are

  • could not open device 0x27c6:0x63ac: Access denied (insufficient permissions) - indicating permission issues on a different USB device
  • Error: 105 424 cmsis_dap.c:293 cmsis_dap_open(): unable to find a matching CMSIS-DAP device - indicating OpenOCD failed to open the device. This is the same message thrown if there's no PICO connected to your machine either. Since the scan chain is at least iterating across the end-points I think this further confirms a USB permissions issue.

@rhempel
Copy link
Author

rhempel commented Nov 6, 2024

Thanks for the reply @Jake-Carter - I believe it does have something to do with permissions, but it's not read/write permissions on the USB drive. I have an IT-exception for this on my machine, and I can confirm that I am able to create, read, and modify files on the exposed USB drive for both the DAPLINK and MAINTENANCE modes of the PICO.

I understand how the enumeration scan works for OpenOCD and have looked at the AD fork of the source.

Is there a possibility of adding some additional diagnostic output for the -v option when OpenOCD tries an operation on the 0x0d28:0x0204 device? The enumeration works so there is some other operation failing when it tries to add it to the list of valid CMSIS-DAP devices.

By the way, the command line I am using to open the device is:

C:\MaximSDK\Tools\OpenOCD\openocd.exe -f interface\cmsis-dap.cfg -f target\max32690.cfg -d

I can see in your log that cmsis_dap.c functions are getting called, and that's missing on my side.

Is there an additional driver/dll that OpenOCD needs to work on Windows11?

@Jake-Carter
Copy link
Contributor

Jake-Carter commented Nov 8, 2024

Hmm, generally if you can write to a USB drive you shouldn't have any issue with the PICO.

Here are my driver details (Device Manager -> View -> Devices by container -> DAPLink CMSIS-DSP)

Key drivers to check are DAPLINK and WebUSB: CMSIS-DAP. Do these match?

image

image

image

image

image

@rhempel
Copy link
Author

rhempel commented Nov 11, 2024

The main difference is that I am missing:

  • HID compliant vendor-defined device
  • USB Input Device

The WebUSB driver I have is slightly different:

WebUSB Driver

The Details.txt contents on my PICO are:

# DAPLink Firmware - see https://daplink.io
Build ID: v0257-51-gdb95667d (armcc)
Unique ID: 04161701d5b7c84700000000000000000000000097969906
HIC ID: 97969906
Auto Reset: 1
Automation allowed: 1
Overflow detection: 1
Incompatible image detection: 0
Page erasing: 1
Daplink Mode: Interface
Interface Version: 0259
Git SHA: db95667ddf740f77536239782e7b4273c90878cf
Local Mods: 0
USB Interfaces: MSD, CDC, HID, WebUSB
Interface CRC: 0x8ecdbe53
Remount count: 0
URL: http://www.analog.com/max32625pico

@rhempel
Copy link
Author

rhempel commented Nov 11, 2024

I have opened a ticket with our IT provider - there are some posts on the web that indicate CrowdStrike may be interfering with some USB endpoint devices. This kind of makes sense, so I'll follow up on this when I hear back ...

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

2 participants