I just added native USB support for the JTAG ICE mkII, done via
libusb. Find the CVS commit message below.
I saw on SourceForge, there's also a Win32 implementation of libusb,
so perhaps this would even help the Win32 users. Inclusion of USB
support is being auto-configured, provided usb_open() could be found
in an existing instance of libusb. Alternatively, someone
understanding USB on Win32 might clone my libusb implementation, and
come up with a different Win32 implementation as well.
Note for *BSD users: the current port of libusb contains an error for
control transfers that causes a short reply to be ignored.
Consequently, the serial number matching won't work there as the
serial number is a string attribute that needs to be fetched from the
ICE by means of a control transfer. Find a patch attached (already
supplied to the maintainer of the FreeBSD port).
It takes me about 13 seconds to read the full flash area of an
ATmega128 via USB.
CVS log message:
Implement and document a libusb-based USB transport for the JTAG ICE
The serial transport methods have been moved out into a record of
function pointers for that purpose, defaulting to the actual serial
connection that natively applies to the hosting system. Iff inside
the JTAG ICE mkII handler a port name starting with "usb" has been
detected, the record of function pointers is switched to USB.
Optionally, a serial number might be specified, so only the JTAG ICE
mkII matching the given serial number will be opened. The match is
done right-to-left, so only the least significant bytes of the serial
number need to be given.
In order to make the change as least intrusive to existing drivers as
possible, the entire naming scheme of the serial_foo() function entry
points has been maintained as access macros that encapsulate these
into the respective indirect function calls via serdev->foo().
> I just added native USB support for the JTAG ICE mkII, done via
> libusb. Find the CVS commit message below.
I've tried it on Linux today (kernel 2.6.18 or such, machine arch is
AMD64, some SuSE distribution). I have removed the check for the root
device as it appears to be only available in very recent versions of
libusb, and is not strictly needed anyway (checking for the vendor and
product ID suffices). So the only requirement is the availability of
usb_get_string_simple() in the version of libusb used, thus I've now
based the autoconf decision for using USB on the availability of that
Anyway, a quick test on Linux yielded me some system error when trying
to perform a bulk write to the JTAG ICE (i.e. when sending the first
ICE command). Can anyone else also try that? I've got no idea why
that error would happen, given that libusb is supposed to offer a
uniform API across all supported platforms, and given that it works on
my FreeBSD machine.
Re: Re: Native USB support for JTAG ICE mkII added
On Mon, 2005-06-20 at 20:22 +0200, Joerg Wunsch wrote:
> As Joerg Wunsch wrote:
> > I just added native USB support for the JTAG ICE mkII, done via
> > libusb. Find the CVS commit message below.
> Anyway, a quick test on Linux yielded me some system error when trying
> to perform a bulk write to the JTAG ICE (i.e. when sending the first
> ICE command). Can anyone else also try that? I've got no idea why
> that error would happen, given that libusb is supposed to offer a
> uniform API across all supported platforms, and given that it works on
> my FreeBSD machine.
I finally got around to trying the new USB support (using avrdude
sources from CVS on July 7, 2005) on my Linux computer (Fedora Core 3)
and everything seems to work wonderfully! I flashed and verified a 30
Kbyte program in about 5 seconds. Many many thanks for the USB