Commit Graph

1328 Commits

Author SHA1 Message Date
Rene Liebscher 274c518121 patch #7165 Add support for bitbanging GPIO lines using the Linux sysf GPIO interface
* doc/avrdude.texi,avrdude.1: added doc for linuxgpio 
	* avrdude.conf.in: added template for linuxgpio programmer
	* config_gram.y: pin numbers restricted to [PIN_MIN, PIN_MAX]
	* pindefs.h: added PIN_MIN, PIN_MAX, removed unused LED_ON/OFF
	* configure.ac: configure option enable-linuxgpio, print of enabled options
	* linuxgpio.[ch]: new source for linuxgpio programmer
	* Makefile.am: added linuxgpio to sources list
	* pgm_type.c: added linuxgpio to programmer types list

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1132 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-09 19:23:30 +00:00
Joerg Wunsch 76df1b5b6e 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 3f74b4f7d4 Fix a minor typo.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1130 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-02 20:31:13 +00:00
Joerg Wunsch cc65b4adab * 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 87e413cc03 Annual ChangeLog rotation time.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1128 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-02 10:13:26 +00:00
Joerg Wunsch 915b8c89df Annual ChangeLog rotation time.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1127 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-02 10:12:41 +00:00
Joerg Wunsch e94286da18 * usbdefs.h (USBDEV_BULK_EP_WRITE_STK600)
(USBDEV_BULK_EP_READ_STK600): new define values
* stk500v2.c (stk600_open): use the STK600 EP values,
as they are different from AVRISPmkII



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1126 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-18 10:45:23 +00:00
Joerg Wunsch 93d4697961 bug #37942: Latest SVN can't program in dragon_jtag mode
* jtagmkII.c (jtagmkII_initialize): For Xmega devices, and
firmware >= 7.x, don't trigger a RESET, in order to work around a
firmware bug that appears to be present in at least firmware 7.24
for the Dragon.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1125 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-18 09:20:06 +00:00
Joerg Wunsch 34a01cf0ac * 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 1daf387df5 * 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
Rene Liebscher e61690b142 * pickit2.c: reordered #includes for non-usb configuration
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1122 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-03 20:50:11 +00:00
Joerg Wunsch 62f798bc54 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 a0fb4bdb3f 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 2c540d02b6 * 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 1acbb2fb64 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 c5df7c5284 * 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 bc23715902 * 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 1948e4ff3f * 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 3d50edc3a7 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 457a35eb73 * avrdude.conf.in: Remove "has_jtag" from Xmega A4 and D4
devices, as they only have PDI.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1113 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-29 14:23:18 +00:00
Joerg Wunsch 89d6d2d982 bug #37265: wrong page sizes for XMega64xx in avrdude.conf
* avrdude.conf.in: Fix page sizes for all Xmega devices,
by cross-checking against Atmel Studio's device XML files




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1112 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-29 14:12:41 +00:00
Joerg Wunsch 2abf90726e * 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 f884583e40 Add device support for the recently released ATmega*RFR2 family.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1110 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-29 09:32:27 +00:00
Joerg Wunsch 7a9db49e7c 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
Joerg Wunsch 1af820c0b9 Change all the USB details (endpoint numbers, max transfer size etc.)
to a per-programmer adjustable value.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1108 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-26 16:24:56 +00:00
Joerg Wunsch 147137a218 Replace outdated FSF postal address by a reference to
the GPL info on their website.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1107 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-20 14:03:50 +00:00
Rene Liebscher 3823e9c405 bug #35186 inverting pins with "~" doesn't work for pin lists (i.e. vcc)
bug #37727 Add support for LM3S811 dev board as a programmer
* lexer.l,config_gram.y: accepting inverted pins at pin lists 
	        syntax: ~num or ~(num,num,...)
* par.c: par_set_many_bits is now usable with inverted pins
* avrftdi.c: fixed wrong index in ftdi_pin_name
* avrdude.conf.in: added programmer lm3s811

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1106 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-13 21:34:02 +00:00
Rene Liebscher 673f43f37d * lexer.l,config_gram.y,config.[hc]: changed reading of numbers to integers except of default_bitclock which is the only real number.
No signs are allowed as negative values do not make sense for current config values.
* buspirate.c: include own header file buspirate.h
* doc/.cvsignore: add programmers.texi to ignore list

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1105 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-04 17:18:59 +00:00
Joerg Wunsch dd3ce5f0e1 Add EXTRA_DIST, replace $(srcdir) by
$(builddir) for generated files, so "make distcheck"
works again.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1104 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-09-06 15:33:09 +00:00
Rene Liebscher 4a33bc5c82 fixed doc/Makefile.am for use with BSD make
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1103 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-09-05 20:52:40 +00:00
Rene Liebscher b704e9e89f patch #7184 Support for PICKit2 programmer
* Makefile.am: add pickit2 files
	* pickit2.[ch]: new programmer implementation
	* pgm_type.c: add pickit to list
	* avrdude.1: documentation for pickit2
	* doc/avrdude.texi: documentation for pickit2
	* avrdude.conf.in: add pickit2 programmer entry

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1102 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-08-15 18:34:53 +00:00
Rene Liebscher 926269f39f bug #30559 Ft232 bit-bang support, see comment #30
* ft245r.c: added semaphore workaround for MacOS X,
	            added pthread_testcancel in reader thread

* configure.ac: added check for TYPE_232H in libftdi (not in libftdi < 0.20)
* avrftdi.c: do not use TYPE_232H if not declared

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1101 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-08-15 17:31:11 +00:00
Hannes Weisbach 15ab375553 Fixes 'label at end of compound statement' error introdcued in r1099
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1100 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-08-13 19:31:38 +00:00
Hannes Weisbach cee2c0cd39 Fixes pin_limit error in avrftdic.
-Error was a result of a mixup between 2232C/D and 2232H


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1099 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-08-13 19:03:41 +00:00
Hannes Weisbach bcd3ba87f3 Adds bugfixes and maintenance for avrftdi
Bugfixes:
-remove ftdi_usb_purge_buffers(), since it does not flush, but clear buffers
-fix bad polling in avrftdi_flash_write() where it was possible to poll a 0xff
 value. 

Maintenance:
-use #defines from libftdi for MPSSE commands where applicable
-reformat E() and E_VOID() macros
-remove TYPE_* macros
-clean up private structure (remove pin_inversion, type and ftype)
-adds ftdi_pin_name() to turn a (FTDI) pin number to a human readable string
-adds avrftdi_print to encapsulate "if(verbose > c) fprintf()"-idiom
-nicer / better understandable (I hope) output
-removes pin_limit() and adds a member in the private data structure.
 TYPE_* macros can be removed; decision is made from (struct ftdi_context).type
-add_pin(s)() functions reworked. parameters are validated first, if everything 
 is alright, pin_value is modified. pin_inversion mask is not needed; use
 PIN_INVERTED instead
-change set_pin(s)(), so that it gets the pin value used by avrdude (and not a
 bit mask). This way, PIN_INVERTED is usable and pin_inversion is not needed.
 Plus, the interface is consistent with the add_pin() signature. Also move
 parameter validation to the start of the function. I also commented out the
 warning, that a pin is not defined, because it is annoying.
-clean up avrftdi_open(): first parameter validation, then USB lookup, interface
 initialization then pin setup
-avrftdi_eeprom_read/write() and avrftdi_flash_read/write(): convert to new
 calling scheme, where every paged_* function is called once for every page



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1098 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-07-29 12:29:39 +00:00
Hannes Weisbach 777c9117c8 Adds ChangeLog entry for Rev 1095
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1097 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-07-25 16:36:17 +00:00
Joerg Wunsch be820748f2 Return MTYPE_FLASH from jtagmkII_memtype() rather than
MTYPE_SPM for non-Xmega flash regions.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1096 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-07-25 14:56:39 +00:00
Hannes Weisbach 534f635763 Adds avr_pin_name()
Renames pin_name() from avrpart.c to avr_pin_name() and adds a
(globally visible)declaration in avrpart.h
The function takes an integer argument from the pin-enum in pindefs.h and
converts it to a string. The returned string corresponds to the pin names used
in avrdude.conf.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1095 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-07-20 20:05:30 +00:00
Joerg Wunsch 5379f36061 Add ChangeLogs for 2010 and 2011 to distribution.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1094 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-07-18 13:59:02 +00:00
Joerg Wunsch a8b5742512 Test for libelf.h in subdirectory libelf, too, and inlude it from there if test
was positive.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1093 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-07-18 12:42:47 +00:00
Joerg Wunsch d486a0a1cd Submitted by Rene Liebscher:
* configure.ac: Check for presence of <pthread.h>
* ft245r.c: Depend on HAVE_PTHREAD_H
* Makefile.am: Add -lpthread if needed.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1092 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-06-13 20:45:22 +00:00
Joerg Wunsch bde3c841e5 * usbtiny.c (usbtiny_paged_load, usbtiny_paged_write):
fix breakage introduced by the recent page handling reorg;
it used to cause an infinite loop



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1091 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-06-07 14:07:17 +00:00
Joerg Wunsch ffeb38cf3e Xmega page erase implementation for XPROG (AVRISPmkII, STK600)
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1090 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-05-04 15:47:26 +00:00
Joerg Wunsch b9a38193a0 Xmega page erase implementation for JTAGICEmkII
* jtagmkII.c: Handle flash pages sizes > 256 bytes, implement
page_erase() method
* avrdude.conf.in: Change flash pagesize for all Xmega devices
to 512 bytes
* avr.c: Implement auto_erase, using page_erase if available
* avr.h: Remove unused parameters from avr_read(), replace
unused parameter in avr_write)() by auto_erase
* stk500v2.c: Handle flash page sizes > 256 bytes
* update.c (do_op): Handle new updateflags parameter
* main.c: Implement auto_erase as page_erase if possible
* update.h (enum updateflags): New enum
* pgm.h (struct programmer_t): Add page_erase method



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1089 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-05-04 10:02:30 +00:00
Joerg Wunsch 36ca4dce5c Fix for previous fix: add memtype for "flash".
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1088 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-04-26 11:01:19 +00:00
Joerg Wunsch f2f59a2d2e * jtagmkII.c (jtagmkII_paged_load, jtagmkII_paged_write): fix bug
in memory type calculation for Xmega "boot" memory region.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1087 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-04-26 10:57:09 +00:00
Joerg Wunsch c4bcc20e07 * update.c (parse_op): do not assume default memtype here
* main.c: after locating the part information, determine default
memtype for all update options that didn't have a memtype
specified; this is "application" for Xmega parts, and "flash" for
everything else.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1086 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-04-25 16:32:23 +00:00
Joerg Wunsch 0bda6f26d1 * fileio.c: Rework the way ELF file sections are considered: while
scanning the program header table, the offsets from a program
header entry must never be used directly when checking the bounds
of the current AVR memory region.  Instead, they must always be
checked based on the corresponding section's entry.  That way,
Xmega devices now properly take into account whether the segment
fits into any of the application/apptable/boot memory region.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1085 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-04-24 15:41:02 +00:00
Joerg Wunsch 2343e419d3 bug #30756: When setting SUT to 64ms on XMEGA, avrdude doesn't
read device signature
* main.c: When reading the signature yields 0x000000 or 0xffffff,
retry (up to twice) after some progressive delay.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1084 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-04-20 12:33:15 +00:00
Joerg Wunsch 973e615dbe * avrdude.conf.in (ATxmega16D4, ATxmega32D4, ATxmega64D4,
ATxmega128D4): New devices.  As Xmega D doesn't feature a fuse0
memory cell, move that one out from the generic .xmega part into
the individual Xmega A parts.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1083 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-04-20 11:03:51 +00:00