Eric Wetzel
2011-07-06 14:02:18 UTC
I'm having a pile of bad times here getting J-Link to work with
OpenOCD under Windows 7 for use on the AM1808 EVM. I've learned a few
lessons; at least, I hope they're lessons, or I may have done many
things very wrong.
1. In Windows 7, I had to set the LibUSB-Win32-0.1 installer to run in
Windows XP compatibility mode or it would completely disable my USB
ports: mouse, keyboard, all non-functional.
2. I have an aversion to depending on cygwin1.dll, but when Cygwin 1.7
was released, the -mno-cygwin flag didn't work. mingw-gcc-core is a
gcc4 compiler that can make non-Cygwin executables. (Maybe this is old
news, but it's news to me)
3. I copied the installed LibUSB-Win32-0.1 usb.h and libusb.a to
include and lib, respectively, under /usr/i686-pc-mingw32/sys-root.
4. The configure options I used were: --enable-maintainer-mode
--enable-dummy --enable-jlink --enable-ft2232_ftd2xx
--with-ftd2xx-win32-zipdir=$HOME/local/src/ftd2xx --prefix=$HOME/local
CC="i686-pc-mingw32-gcc"
note 4a: I'd rather be using libftdi, but I didn't want to fight with
it in Windows
note 4b: I also wanted Bus Pirate support, but it requires termios.h
which the MinGW-targeted gcc didn't provide
This built cleanly, and I got an openocd.exe that doesn't segfault
immediately and ldd says doesn't depend on cygwin1.dll. Those seem
like positive things. The trouble comes when I try to use it. I'm
using the target/omapl138.cfg because they're comparable chips (the
OMAP-L138 is an AM1808 with a sequencer and a DSP), and I need
something to get ICEpick to enable the debug ports. The same thing
happens with no target specified and J-Link disconnected from the
board.
openocd.exe -c "source [find interface/jlink.cfg]" -c "source [find
target/omapl138.cfg]"
Open On-Chip Debugger 0.5.0-dev-00941-gff640f1 (2011-06-28-10:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it
allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
RCLK - adaptive
fast memory access is enabled
dcc downloads are enabled
force hard breakpoints
use of EmbeddedICE dbgrq instead of breakpoint for target halt enabled
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled Apr 27 2011 20:42:35
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 80000
Info : J-Link hw type J-Link
Info : J-Link max mem block 8384
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0x0
Info : Vref = 3.319 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
Info : RCLK (adaptive clock speed)
Error: usb_bulk_read failed (requested=1, result=0)
Error: jlink_tap_execute, wrong result -107 (expected 1)
Error: usb_bulk_read failed (requested=1, result=0)
Error: jlink_tap_execute, wrong result -107 (expected 1)
in procedure 'transport'
in procedure 'init'
It's clearly able to communicate with the J-Link to get the hardware
information, version string, pin states (including Vref on the
target). But then some USB reads fail. Afterwards, the J-Link becomes
unresponsive for about 2 minutes; its LED is off, but it is still
present in Device Manager, and repeated openocd attempts fail to get
J-Link info:
openocd.exe -c "source [find interface/jlink.cfg]" -c "source [find
target/omapl138.cfg]"
Open On-Chip Debugger 0.5.0-dev-00941-gff640f1 (2011-06-28-10:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it
allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
RCLK - adaptive
fast memory access is enabled
dcc downloads are enabled
force hard breakpoints
use of EmbeddedICE dbgrq instead of breakpoint for target halt enabled
Info : J-Link initialization started / target CPU reset initiated
Error: J-Link command 0x01 failed (-116)
Error: J-Link command EMU_CMD_VERSION failed (0)
Info : J-Link JTAG Interface ready
Info : RCLK (adaptive clock speed)
Error: J-Link command 0xdf failed (-116)
Error: usb_bulk_write failed (requested=6, result=-116)
Error: jlink_tap_execute, wrong result -107 (expected 1)
Error: usb_bulk_write failed (requested=6, result=-116)
Error: jlink_tap_execute, wrong result -107 (expected 1)
in procedure 'transport'
in procedure 'init'
Is anyone else having problems with J-Link under Windows 7? Or just
Windows 7? Or just J-Link?
Thanks,
~Eric
OpenOCD under Windows 7 for use on the AM1808 EVM. I've learned a few
lessons; at least, I hope they're lessons, or I may have done many
things very wrong.
1. In Windows 7, I had to set the LibUSB-Win32-0.1 installer to run in
Windows XP compatibility mode or it would completely disable my USB
ports: mouse, keyboard, all non-functional.
2. I have an aversion to depending on cygwin1.dll, but when Cygwin 1.7
was released, the -mno-cygwin flag didn't work. mingw-gcc-core is a
gcc4 compiler that can make non-Cygwin executables. (Maybe this is old
news, but it's news to me)
3. I copied the installed LibUSB-Win32-0.1 usb.h and libusb.a to
include and lib, respectively, under /usr/i686-pc-mingw32/sys-root.
4. The configure options I used were: --enable-maintainer-mode
--enable-dummy --enable-jlink --enable-ft2232_ftd2xx
--with-ftd2xx-win32-zipdir=$HOME/local/src/ftd2xx --prefix=$HOME/local
CC="i686-pc-mingw32-gcc"
note 4a: I'd rather be using libftdi, but I didn't want to fight with
it in Windows
note 4b: I also wanted Bus Pirate support, but it requires termios.h
which the MinGW-targeted gcc didn't provide
This built cleanly, and I got an openocd.exe that doesn't segfault
immediately and ldd says doesn't depend on cygwin1.dll. Those seem
like positive things. The trouble comes when I try to use it. I'm
using the target/omapl138.cfg because they're comparable chips (the
OMAP-L138 is an AM1808 with a sequencer and a DSP), and I need
something to get ICEpick to enable the debug ports. The same thing
happens with no target specified and J-Link disconnected from the
board.
openocd.exe -c "source [find interface/jlink.cfg]" -c "source [find
target/omapl138.cfg]"
Open On-Chip Debugger 0.5.0-dev-00941-gff640f1 (2011-06-28-10:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it
allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
RCLK - adaptive
fast memory access is enabled
dcc downloads are enabled
force hard breakpoints
use of EmbeddedICE dbgrq instead of breakpoint for target halt enabled
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled Apr 27 2011 20:42:35
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 80000
Info : J-Link hw type J-Link
Info : J-Link max mem block 8384
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0x0
Info : Vref = 3.319 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
Info : RCLK (adaptive clock speed)
Error: usb_bulk_read failed (requested=1, result=0)
Error: jlink_tap_execute, wrong result -107 (expected 1)
Error: usb_bulk_read failed (requested=1, result=0)
Error: jlink_tap_execute, wrong result -107 (expected 1)
in procedure 'transport'
in procedure 'init'
It's clearly able to communicate with the J-Link to get the hardware
information, version string, pin states (including Vref on the
target). But then some USB reads fail. Afterwards, the J-Link becomes
unresponsive for about 2 minutes; its LED is off, but it is still
present in Device Manager, and repeated openocd attempts fail to get
J-Link info:
openocd.exe -c "source [find interface/jlink.cfg]" -c "source [find
target/omapl138.cfg]"
Open On-Chip Debugger 0.5.0-dev-00941-gff640f1 (2011-06-28-10:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it
allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
RCLK - adaptive
fast memory access is enabled
dcc downloads are enabled
force hard breakpoints
use of EmbeddedICE dbgrq instead of breakpoint for target halt enabled
Info : J-Link initialization started / target CPU reset initiated
Error: J-Link command 0x01 failed (-116)
Error: J-Link command EMU_CMD_VERSION failed (0)
Info : J-Link JTAG Interface ready
Info : RCLK (adaptive clock speed)
Error: J-Link command 0xdf failed (-116)
Error: usb_bulk_write failed (requested=6, result=-116)
Error: jlink_tap_execute, wrong result -107 (expected 1)
Error: usb_bulk_write failed (requested=6, result=-116)
Error: jlink_tap_execute, wrong result -107 (expected 1)
in procedure 'transport'
in procedure 'init'
Is anyone else having problems with J-Link under Windows 7? Or just
Windows 7? Or just J-Link?
Thanks,
~Eric