Commit Graph

24 Commits

Author SHA1 Message Date
joerg_wunsch 7999eaa25a Turn the usbpid parameter of the programmer into a list of PIDs. Make
the JTAGICE3 programmer handle a list of PIDs, by trying each of them
in sequence.  Use a single, central jtag3_open_common() function to
handle the common code of all jtag3_open_* functions.  Centralize all
USB VID/PID definitions in usbdevs.h.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1283 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-02-27 13:06:03 +00:00
joerg_wunsch b1c64fbe92 Implement the Atmel EDBG/CMSIS-DAP driver protocol for JTAGICE3
(running firmware 3.x) and XplainedPro boards.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1278 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-02-26 17:54:32 +00:00
joerg_wunsch 66e2a16c9c Change the second parameter of the ser_open method from "baud" into a
"union pinfo", so the USB parameters can be passed without hacks.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1276 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-02-21 13:44:11 +00:00
joerg_wunsch 7023e2345c * jtag3.c (jtag3_initialize): Fix a buffer overflow by limiting
the flash page cache size to at most "readsize".  For Xmegas with
a page size of 512 bytes, the maximum USB packet size was
overflowed, and subsequently, a memmove copied beyond the end of
the allocated buffer.
* jtag3.c (jtag3_read_byte): Add the correct offset also for the
various flash regions, so reading the apptable or boot regions
yields the correct data.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1237 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-17 15:06:35 +00:00
joerg_wunsch 3fcf8a6067 * jtag3.c (jtag3_write_byte): Do not attempt to start the paged
algorithm for EEPROM when being connected through debugWIRE.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1210 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-07 20:40:29 +00:00
joerg_wunsch 038807958e Extend the single-byte algorithm to all devices, both flash and
EEPROM.  (Flash cells must have been erased before though.)
* jtag3.c (jtag3_initialize): OCDEN no longer needs to be
considered; a session with "programming" purpose is sufficient
* jtag3.c (jtag3_write_byte): Use the paged algorithm for all
flash and EEPROM areas, not just Xmega.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1209 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-06 07:06:13 +00:00
joerg_wunsch 8daa7cecd4 Fix single-byte EEPROM updates on Xmega:
* jtag3_private.h (MTYPE_EEPROM_XMEGA): New define.
* jtag3.c (jtag3_write_byte): When updating flash or
EEPROM on Xmega devices, resort to jtag3_paged_write()
after filling and modifying the page cache.
* jtag3.c (jtag3_paged_write): use MTYPE_EEPROM_XMEGA
where appropriate.
* jtag3.c (jtag3_initialize): Open with debugging intent
for Xmega devices, so single-byte EEPROM updates will
work.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1208 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-05 21:18:01 +00:00
joerg_wunsch d3934de629 bug #39691 Buffer overrun when reading EEPROM byte with JTAGICE3
* jtag3.c (jtag3_initialize): initialize the eeprom_pagesize
private attribute so the page cache will actually be usable



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1202 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-03 11:58:31 +00:00
joerg_wunsch ce90fe7b74 bug #38580 Current svn head, xmega and fuses, all fuses tied to fuse0
* jtag3.c (jtag3_read_byte, jtag3_write_byte): Correctly apply the
relevant part of mem->offset as the address to operate on.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1201 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-03 11:32:47 +00:00
joerg_wunsch 12de7132f3 bug #39794: warnings when building avrdude 6.0rc1 under CentOS 6.4
* pickit.c (usb_open_device): Use %p rather than %X to print "handle"
which is a pointer
* jtag3.c (jtag3_initialize): Initialize "flashsize" to be sure it
proceeds with a valid value.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1197 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-02 20:30:09 +00:00
joerg_wunsch 1b8fc9897d Replace some stray calls to putchar() by putc(..., stderr).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1131 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-08 21:02:01 +00:00
joerg_wunsch ac8b2858ad * usb_libusb.c (usbdev_open): Downgrade the max transfer size for
the main data endpoints when being forced so by the USB; this can
happen when attaching the JTAGICE3 to a USB 1.1 connection
* jtag3.c (jtag3_initialize): When detecting a downgraded max
transfer size on the JTAGICE3 (presumably, due to being connected
to USB 1.1 only), bail out as its firmware cannot properly handle
this (by now)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1129 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-02 10:16:37 +00:00
joerg_wunsch 05fd0beac1 * config_gram.y: Implement the "ocdrev" keyword
* avrpart.c: (Dito)
* avrpart.h: (Dito)
* lexer.l: (Dito)
* avrdude.conf.in: Add "ocdrev" key/value pairs, based
on the AS6 XML file information.
* jtag3.c: Use the ocdrev in the parameter block.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1124 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-04 13:59:37 +00:00
joerg_wunsch 1f7b134420 * jtag3.c: Make jtag3_command() public
* jtag3.h: (Dito.)
* jtag3_private.h: Add two new commands
* stk500v2.c: Implement the "MonCon disable" hack that
allows temporarily falling back to ISP when trying to
talk to a part that has debugWIRE enabled



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1123 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-03 21:03:06 +00:00
joerg_wunsch 3024312901 Enable interactive adjustment of the various
clock frequencies (JTAG Xmega, JTAG megaAVR, PDI Xmega)
through the set_sck_period() callback.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1121 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-03 16:52:23 +00:00
joerg_wunsch 707ddd2de9 Remove unused code that was left over from
cloning the jtagmkII.c implementation



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1120 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-03 16:09:34 +00:00
joerg_wunsch 97357595b6 * pgm_type.c: Add "jtagice3_isp" programmer hook
* avrdude.conf.in: Add "jtag3isp" programmer
* jtag3.c: jtag3_setparm() is now public
* jtag3.h: (Dito)
* stk500v2_private.h: Command 0x1D is CMD_SPI_MULTI only
for STK500v2, AVRISPmkII, and JTAGICEmkII; for JTAGICE3,
it's CMD_SET_SCK now; also add CMD_GET_SCK
* avrpart.c (avr_get_output_index): New function
* avrpart.h: (Dito)
* stk500v2.c: Implement the pasthrough programmer glue logic
for JTAGICE3 in ISP mode
* stk500v2.h: (Dito)
* avrdude.1: Document the JTAGICE3 support.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1119 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-03 15:52:38 +00:00
joerg_wunsch de55b22e86 Add a failure code for debugWIRE communication failures I
happened to run into.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1118 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-30 22:18:34 +00:00
joerg_wunsch 4e0801803f * jtag3.c (jtag3_read_byte, jtag3_write_byte): Remove the
m->offset from addr, JTAGICE3 doesn't need it anymore (similar
to JTAGICEmkII with 7+ firmware)
* jtag3.c (jtag3_read_byte): Allow for full-page reads of
EEPROM also for Xmega and debugWIRE, allow for signature
read in debugWIRE




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1117 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-30 12:51:07 +00:00
joerg_wunsch d8ad0fdb28 * jtag3_private.h: Add two more error detail codes I stumbled
across during development
* jtag3.c: (Dito.)
* usb_libusb.c: Reduce timeouts from 100 to 10 s, still long
enough, but not getting cold feet when something goes wrong.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1116 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-30 12:36:00 +00:00
joerg_wunsch fa86937e91 * jtag3.c: Handle events returned by the ICE
* usbdevs.h: Add defines that mark an event in return
from usb_recv_frame().
* usb_libusb.c: (Dito.)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1115 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-29 21:43:54 +00:00
joerg_wunsch fca08c90ab Implement page erase functionality.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1114 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-29 16:20:48 +00:00
joerg_wunsch 8d9a00ddc5 * jtag3.c: Fill in the missing pieces for Xmega support (both,
PDI and JTAG).
* jtagmkII.c (jtagmkII_set_xmega_params): Use "fuse1" rather
than "fuse0" memory space to fill in the NVM offset from, as
there is no "fuse0" on some Xmega devices.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1111 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-29 13:31:11 +00:00
joerg_wunsch ed3033e396 First support for Atmel JTAGICE3. Guessed from USB sniffer
traces made by Knut Schwichtenberg, and by similarity to
JTAGICEmkII.

Still quite incomplete, just megaAVR/JTAG is done by now.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1109 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-28 22:39:01 +00:00