Skip to content

CMSIS DAP V1 Initialisation issue on Windows #1825

@BogdanTheGeek

Description

@BogdanTheGeek

Hi, I'm working on a USB Low Speed CMSIS DAP V1 probe and I am seeing a strange traceback when trying to intitialise the probe:

Downloads\pyocd-windows-0.39.0>pyocd.exe cmd -vvvvv -t py32f002bx5 -c reset
0002249 D Project directory: C:\Users\REDACTED\Downloads\pyocd-windows-0.39.0 [session]
0002327 D Project directory: C:\Users\REDACTED\Downloads\pyocd-windows-0.39.0 [session]
0002749 D CMSIS-DAP v1 probe 1234: firmware version V1.2, protocol version 1.3.0 [dap_access_cmsis_dap]
0002874 D suppressing error from attempting to open device <pyocd.probe.pydapaccess.dap_access_cmsis_dap.DAPAccessCMSISDAP object at 0x00000200EFE7B310>: DAP_Info Packet Size 64 exceeds endpoint wMaxPacketSize 8 [cmsis_dap_probe]
0004564 I Target type is py32f002bx5 [board]
0004595 C Error: already open [__main__]
Traceback (most recent call last):
  File "pyocd\__main__.py", line 161, in run
    status = cmd.invoke()
             ^^^^^^^^^^^^
  File "pyocd\subcommands\commander_cmd.py", line 75, in invoke
    PyOCDCommander(self._args, cmds).run()
  File "pyocd\commands\commander.py", line 83, in run
    if do_connect and not self.connect():
                          ^^^^^^^^^^^^^^
  File "pyocd\commands\commander.py", line 224, in connect
    if not self._post_connect():
           ^^^^^^^^^^^^^^^^^^^^
  File "pyocd\commands\commander.py", line 251, in _post_connect
    self.session.open(init_board=not self.args.no_init)
  File "pyocd\core\session.py", line 549, in open
    self._probe.open()
  File "pyocd\probe\shared_probe_proxy.py", line 55, in open
    self._probe.open()
  File "pyocd\probe\cmsis_dap_probe.py", line 277, in open
    self._link.open()
  File "pyocd\utility\concurrency.py", line 29, in _locking
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 752, in open
    self._interface.open()
  File "pyocd\probe\pydapaccess\interface\hidapi_backend.py", line 144, in open
    self.device.open_path(self.device_info['path'])
  File "hid.pyx", line 155, in hid.device.open_path
RuntimeError: already open

Don't focus on the wMaxPacketSize error too much, this doesn't happen on macOS. I assume the _is_open property is not set correctly when encountering the size error, or the interface is not closed properly. I would also appreciate some pointers to where that packet size check is coming from, I don't believe it should be treated as an error, but a warning.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions