On Tue, Jul 7, 2009 at 5:04 PM, Spencer Oliver<s...@spen-soft.co.uk> wrote: > >> > >> > For info this breaks my v5 and v6 jlinks (tested stm32). >> > Not sure if any one else is having trouble? >> >> How does it break? >> > > All read/writes fail as the usb handle is invalid after the usb_reset is > performed. > Perhaps the win32 libusb does a reset whereas the linux one does not? >
Are you saying you have problems under Windows but not Linux? I agree with you that the 2nd part of the patch does not seem to be correct. But somehow it does not seem to cause problem under Linux. For example, here is the log of using a V6 J-Link with STM3210E-Eval mc...@ubuntu904:~/Desktop/build/openocd/jlinkv7$ cat stm3210e_eval.cfg # This is an STM32 eval board with a single STM32F103ZET6 chip on it. source [find target/stm32.cfg] source [find interface/jlink.cfg] #----------- Daemon Configuration telnet_port 4444 gdb_port 3333 tcl_port 6666 # Tell gdb that you can use us to program the device (requires GDB >=6.7 and libexapt) gdb_memory_map enable gdb_flash_program enable mc...@ubuntu904:~/Desktop/build/openocd/jlinkv7$ openocd -f stm3210e_eval.cfg Open On-Chip Debugger 0.2.0-in-development (2009-07-07-07:38) svn:2484 $URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $ For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS 1000 kHz jtag_nsrst_delay: 100 jtag_ntrst_delay: 100 Info : J-Link initialization started / target CPU reset initiated Info : J-Link ARM V6 compiled Apr 1 2009 11:56:10 Info : JLink caps 0x19ff7bbf Info : JLink hw version 60000 Info : JLink max mem block 8832 Info : Vref = 3.248 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0 Info : J-Link JTAG Interface ready Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3) Info : JTAG Tap/device matched Info : JTAG tap: stm32.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0) Info : JTAG Tap/device matched Info : accepting 'telnet' connection from 0 Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3) Info : JTAG Tap/device matched Info : JTAG tap: stm32.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0) Info : JTAG Tap/device matched target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x0800ead4 target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x080019ca target state: halted target halted due to single-step, current mode: Thread xPSR: 0x41000000 pc: 0x080019cc ^C mc...@ubuntu904:~$ telnet localhost 4444 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Open On-Chip Debugger > reset halt JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3) JTAG Tap/device matched JTAG tap: stm32.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0) JTAG Tap/device matched target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x0800ead4 > resume > halt target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x080019ca > step target state: halted target halted due to single-step, current mode: Thread xPSR: 0x41000000 pc: 0x080019cc > Connection closed by foreign host. I can see from dmesg that the device really gets reset. [ 2098.648029] usb 2-2: new full speed USB device using ohci_hcd and address 7 [ 2098.863464] usb 2-2: configuration #1 chosen from 1 choice [ 2210.480027] usb 2-2: reset full speed USB device using ohci_hcd and address 7 [ 2603.840030] usb 2-2: reset full speed USB device using ohci_hcd and address 7 I run the OpenOCD twice and there are two resets of J-Link in dmesg. mc...@ubuntu904:~$ lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 007: ID 1366:0101 (Note by Xiaofan: this is J-Link) Bus 002 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC Bus 002 Device 005: ID 046d:c054 Logitech, Inc. Bus 002 Device 004: ID ffff:0005 Bus 002 Device 002: ID 058f:9360 Alcor Micro Corp. 8-in-1 Media Card Reader Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub -- Xiaofan http://mcuee.blogspot.com _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development