DEBUG , OPENOCD LIBUSB_ERROR_TIMEOUT



  • 调试的时候出现LIBUSB_ERROR_TIMEOUT错误:

    (k210)ch@ch-H110M-TS:$ sudo ./bin/openocd -f tcl/new.cfg 
    Kendryte Open On-Chip Debugger For RISC-V v0.1.3 (20180912)
    Licensed under GNU GPL v2
    adapter speed: 3000 kHz
    Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
    Info : Hardware version: 8.00
    Info : VTarget = 1.831 V
    Warn : Failed to receive data from device: LIBUSB_ERROR_TIMEOUT.  <===HERE
    Warn : Failed to receive data from device: LIBUSB_ERROR_TIMEOUT.
    Error: Receiving data from device timed out.
    Error: transport_read() failed: timeout occurred.
    Error: jaylink_jtag_io() failed: timeout occurred.
    Warn : Last read operation left 2 bytes.
    Warn : Failed to receive data from device: LIBUSB_ERROR_TIMEOUT.
    Warn : Failed to receive data from device: LIBUSB_ERROR_TIMEOUT.
    Error: Receiving data from device timed out.
    Error: transport_read() failed: timeout occurred.
    Error: jaylink_get_speeds() failed: timeout occurred.
    
    Warn : Last read operation left 6 bytes.
    Error: Failed to receive data from device: LIBUSB_ERROR_IO.
    Error: transport_read() failed: unspecified error.
    Error: jaylink_unregister() failed: unspecified error.
    Error: Failed to release interface: LIBUSB_ERROR_NO_DEVICE.
    

    tcl/new.cfg 内容如下:

    # debug adapter
    interface jlink
    
    transport select jtag
    adapter_khz 3000
    
    # server port
    gdb_port 3333
    telnet_port 4444
    
    # add cpu target
    set _CHIPNAME riscv
    
    jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x04e4796b
    
    set _TARGETNAME $_CHIPNAME.cpu
    target create $_TARGETNAME riscv -chain-position $_TARGETNAME
    
    # command
    init
    halt
    
    

    这种情况怎么处理,求助~



  • 你好,JLink工作是正常的。
    同一个JLink,同一个系统,用Ubuntu官方源中的openocd可以正常连接STM32F4:

    ch@ch-H110M-TS:$ openocd -f interface/jlink.cfg -f target/stm32f4x.cfg
    Open On-Chip Debugger 0.9.0 (2015-09-02-10:42)
    Licensed under GNU GPL v2
    For bug reports, read
    	http://openocd.org/doc/doxygen/bugs.html
    Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
    adapter speed: 2000 kHz
    adapter_nsrst_delay: 100
    jtag_ntrst_delay: 100
    none separate
    cortex_m reset_config sysresetreq
    Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
    Info : J-Link caps 0xb9ff7bbf
    Info : J-Link hw version 80000
    Info : J-Link hw type J-Link
    Info : J-Link max mem block 9224
    Info : J-Link configuration
    Info : USB-Address: 0x0
    Info : Kickstart power on JTAG-pin 19: 0xffffffff
    Info : Vref = 3.300 TCK = 0 TDI = 1 TDO = 1 TMS = 1 SRST = 1 TRST = 1
    Info : J-Link JTAG Interface ready
    Info : clock speed 2000 kHz
    Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
    Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020, part: 0x6413, ver: 0x0)
    Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
    Info : accepting 'telnet' connection on tcp/4444
    Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
    Info : JTAG tap: stm32f4x.bs tap/device found: 0x06413041 (mfg: 0x020, part: 0x6413, ver: 0x0)
    

  • Staff

    确定你的JLINK设备是正常工作的吗