Skip to content

pyocd stuck forever when first connect to device #2009

Description

@Hoohaha

on windows, hidapi backend, seems no read timeout for read operations so the pyocd process get stuck and cannot exit forever.

pyocd cmd -vvvv -u 02260000070b4a3f00000000000000000000000097969905 -L**=debug
0000487 D setting log level debug for ['pyocd.utility.progress', 'pyocd.utility', 'pyocd', 'pyocd.flash.builder', 'pyocd.flash', 'pyocd.flash.loader', 'pyocd.utility.cmdline', 'pyocd.utility.server', 'pyocd.trace.swv', 'pyocd.trace', 'pyocd.flash.eraser', 'pyocd.core.core_registers', 'pyocd.core', 'pyocd.coresight.cortex_m_core_registers', 'pyocd.coresight', 'pyocd.cache.memory', 'pyocd.cache', 'pyocd.cache.register', 'pyocd.debug.elf.decoder', 'pyocd.debug.elf', 'pyocd.debug', 'pyocd.debug.elf.elf_reader', 'pyocd.utility.sequencer', 'pyocd.core.soc_target', 'pyocd.utility.notification', 'pyocd.utility.notification.trace', 'pyocd.core.options_manager', 'pyocd.probe.swj', 'pyocd.probe', 'pyocd.coresight.ap', 'pyocd.coresight.ap.trace', 'pyocd.coresight.dap', 'pyocd.coresight.dap.trace', 'pyocd.coresight.fpb', 'pyocd.coresight.dwt', 'pyocd.debug.breakpoints.manager', 'pyocd.debug.breakpoints', 'pyocd.debug.breakpoints.software', 'pyocd.coresight.cortex_m', 'pyocd.coresight.cortex_m_v8m', 'pyocd.coresight.sdc600', 'pyocd.coresight.funnel', 'pyocd.coresight.rom_table', 'pyocd.coresight.discovery', 'pyocd.debug.svd.loader', 'pyocd.debug.svd', 'pyocd.target.pack.flash_algo', 'pyocd.target.pack', 'pyocd.target', 'pyocd.target.pack.flm_region_builder', 'pyocd.coresight.coresight_target', 'pyocd.target.family.target_imxrt', 'pyocd.target.family', 'pyocd.target.family.target_kinetis', 'pyocd.target.family.target_lpc5500', 'pyocd.target.family.target_nRF52', 'pyocd.flash.file_programmer', 'pyocd.commands.base', 'pyocd.commands', 'pyocd.commands.execution_context', 'pyocd.target.family.target_nRF54L', 'pyocd.target.family.target_nRF91', 'pyocd.target.family.target_rp2', 'pyocd.flash.flash', 'pyocd.flash.flash.trace', 'pyocd.target.builtin.target_MIMXRT1052xxxxB', 'pyocd.target.builtin', 'pyocd.target.builtin.target_MIMXRT1176xxxxx', 'pyocd.target.family.flash_kinetis', 'pyocd.target.builtin.target_MKL28Z512xxx7', 'pyocd.target.builtin.target_MK22FN1M0Axxx12', 'pyocd.target.builtin.target_K32W042S1M2xxx', 'pyocd.target.builtin.target_LPC1768', 'pyocd.target.builtin.target_nRF51822_xxAA', 'pyocd.target.builtin.target_STM32F767xx', 'pyocd.target.builtin.target_MAX32600', 'pyocd.target.builtin.target_s5js100', 'pyocd.target.builtin.target_CC3220SF', 'pyocd.coresight.generic_mem_ap', 'pyocd.target.family.target_psoc6', 'pyocd.target.family.flash_psoc6', 'pyocd.target.builtin.cypress.target_CY8C6xxA', 'pyocd.target.builtin.cypress', 'pyocd.target.builtin.cypress.target_CY8C6xx7', 'pyocd.target.builtin.cypress.target_CY8C6xx5', 'pyocd.target.builtin.cypress.target_CY8C64xx', 'pyocd.target.builtin.cypress.target_CY8C64xA', 'pyocd.target.builtin.cypress.target_CY8C64x5', 'pyocd.target.builtin.target_musca_b1', 'pyocd.target.builtin.target_musca_s1', 'pyocd.target.builtin.target_STM32H723xx', 'pyocd.target.builtin.target_STM32H743xx', 'pyocd.target.builtin.target_STM32H750xx', 'pyocd.target.family.target_ama3b', 'pyocd.target.builtin.target_AMA3B1KK', 'lark', 'pyocd.debug.sequences.scope', 'pyocd.debug.sequences', 'pyocd.debug.sequences.scope.trace', 'pyocd.debug.sequences.sequences', 'pyocd.debug.sequences.sequences.trace', 'pyocd.debug.sequences.delegates', 'pyocd.debug.sequences.functions', 'pyocd.flash.flash_dsq', 'pyocd.flash.flash_dsq.trace', 'pyocd.debug.sequences.default_sequences', 'pyocd.target.pack.cbuild_run', 'pyocd.core.session', 'pyocd.utility.stdio', 'pyocd.utility.rtt_server', 'pyocd.debug.semihost', 'pyocd.debug.semihost.trace', 'pyocd.gdbserver.context_facade', 'pyocd.gdbserver', 'pyocd.rtos.provider', 'pyocd.rtos', 'pyocd.rtos.common', 'pyocd.core.plugin', 'pyocd.rtos.argon', 'pyocd.rtos.freertos', 'pyocd.rtos.zephyr', 'pyocd.rtos.rtx5', 'pyocd.rtos.threadx', 'pyocd.gdbserver.packet_io', 'pyocd.gdbserver.packet_io.trace.ack', 'pyocd.gdbserver.packet_io.trace', 'pyocd.gdbserver.packet_io.trace.packet', 'usb', 'usb.core', 'pyocd.probe.pydapaccess.interface.hidapi_backend', 'pyocd.probe.pydapaccess.interface', 'pyocd.probe.pydapaccess', 'pyocd.probe.pydapaccess.interface.hidapi_backend.trace', 'pyocd.probe.pydapaccess.interface.pyusb_backend', 'pyocd.probe.pydapaccess.interface.pyusb_backend.trace', 'pyocd.probe.common', 'pyocd.probe.pydapaccess.interface.pyusb_v2_backend', 'pyocd.probe.pydapaccess.interface.pyusb_v2_backend.trace', 'pyocd.probe.pydapaccess.interface.pywinusb_backend', 'pyocd.probe.pydapaccess.interface.pywinusb_backend.trace', 'pyocd.probe.pydapaccess.dap_access_cmsis_dap', 'pyocd.probe.pydapaccess.dap_access_cmsis_dap.trace', 'pyocd.target.pack.cmsis_pack', 'pyocd.target.pack.pack_target', 'pyocd.board.board', 'pyocd.board', 'pyocd.board.mbed_board', 'pyocd.probe.cmsis_dap_probe', 'pyocd.probe.cmsis_dap_probe.trace', 'pylink.jlink', 'pylink', 'pyocd.probe.jlink_probe', 'pyocd.probe.jlink_probe.trace', 'pyocd.probe.picoprobe', 'pyocd.probe.tcp_client_probe', 'pyocd.probe.tcp_client_probe.trace', 'pyocd.probe.stlink.usb', 'pyocd.probe.stlink', 'pyocd.probe.stlink.usb.trace', 'pyocd.probe.stlink.stlink', 'pyocd.probe.stlink.detect.base', 'pyocd.probe.stlink.detect', 'pyocd.probe.shared_probe_proxy', 'pyocd.commands.repl', 'pyocd.commands.commander', 'pyocd.gdbserver.gdbserver_commands', 'pyocd.gdbserver.gdbserver', 'pyocd.gdbserver.gdbserver.trace.mem', 'pyocd.gdbserver.gdbserver.trace', 'pyocd.subcommands.erase_cmd', 'pyocd.subcommands', 'pyocd.probe.tcp_probe_server', 'pyocd.probe.tcp_probe_server.trace', 'pyocd.subcommands.gdbserver_cmd', 'pyocd.subcommands.json_cmd', 'pyocd.subcommands.list_cmd', 'pyocd.subcommands.load_cmd', 'pyocd.subcommands.pack_cmd', 'pyocd.subcommands.reset_cmd', 'pyocd.subcommands.server_cmd', 'pyocd.subcommands.rtt_cmd', 'pyocd.utility.systemview', 'pyocd.utility.rtt_manager', 'pyocd.subcommands.run_cmd', 'pyocd.tool'] [__main__]
0001785 D Project directory: C:\Dpc [session]
0001785 D [cmd:0] New _Command [dap_access_cmsis_dap]
0001785 D Not sending notification because no subscribers: event=connect_mode [notification]
0001786 D Project directory: C:\Dpc [session]
0001786 D Not sending notification because no subscribers: event=auto_unlock [notification]
0001786 D Not sending notification because no subscribers: event=resume_on_disconnect [notification]
0001786 D Not sending notification because no subscribers: event=debug.traceback [notification]
0001787 D   USB OUT> (2) 00 fe [hidapi_backend]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions