Commit Graph

1129 Commits

Author SHA1 Message Date
joerg_wunsch 9e321a0ead Submitted by "Malte" and John McCorquodale:
patch #7876 JTAGICE mkII fails to connect to attiny if debugwire
is enabled AND target has a very slow clock
* jtagmkII.c (jtagmkII_getsync): When leaving debugWIRE mode
temporarily, immediately retry with ISP, rather than leaving.
* stk500v2 (stk500v2_program_enable): Implemented similar logic
for the JTAGICE3.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1183 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-17 16:23:55 +00:00
joerg_wunsch 6cee055fa6 Wrap long lines.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1182 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-17 16:09:55 +00:00
joerg_wunsch 85c663617b Try various compiler names until one succeeds.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1181 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-17 14:02:45 +00:00
rliebscher 65892fa344 * configure.ac: reactivate check for TYPE_232H, which does not exist in libftdi < 0.20
* avrftdi*.*: changed include check for libftdi/libusb, deactivate 232H if not available
* ft245r.c: changed include check for libftdi/libusb

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1180 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-16 17:11:35 +00:00
joerg_wunsch a305ac0143 Add option -l logfile to redirect diagnostic messages to a logfile rather
than stderr.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1179 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-16 09:11:32 +00:00
joerg_wunsch 4a1d97ff2a Break long lines.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1178 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-16 08:11:19 +00:00
rliebscher b538ca9636 * avrftdi*.*: accept also old libftdi (0.20 still works with it), added powerup to initialize
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1177 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-15 20:05:02 +00:00
rliebscher d8f4ea7ad6 removed some debug code from file ft245r.c
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1176 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-15 19:03:58 +00:00
rliebscher e087b21200 * configure.ac: if both found libftdi and libftdi1 use only libftdi1
* avrdude.conf.in: fixed buff pins of avrftdi programmers (low active buffer need now inverted numbers)
	* avrftdi*.*: accept also old libftdi (0.20 still works with it), added powerup to initialize
	* ft245r.c: accept libftdi1, code cleanup and make it more similar to avrfdti (os they might be merged someday)

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1175 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-15 18:55:19 +00:00
joerg_wunsch 4698866283 Add a small script to cross-compile a Win32 binary under Unix.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1174 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-14 20:35:41 +00:00
joerg_wunsch e95ffee0c2 Bump version to 6.0rc1.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1173 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-08 17:35:28 +00:00
joerg_wunsch 7cefa401b4 Add forgotten avrftdi_private.h.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1172 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-08 17:34:00 +00:00
hweisbach 3f3ba207da avrftdi: add pgm->power[up|down], fix pgm->enable|disable
avrftdi.c: add pgm->power[up|down] functions and fill
pgm->enable|disable with proper functionality, as suggested by
rliebscher.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1171 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-07 08:50:13 +00:00
hweisbach eee1ae3973 avrftdi: apply patch by rliebscher.
Use pin_checklist[] of size N_PINS instead N_PINS - 1, to avoid future
problems. Also remove pins_check from set_pin; instead use mask[0] == 0
to check wether to do something or not.

avrftdi_private.h: Change size of pin_checklist[] to N_PINS.
avrftdi.c: Adapt code to new size of pin_checklist. Remove pins_check
from set_pin.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1170 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-07 08:50:06 +00:00
rliebscher 0e18b3fb3d * pindefs.h: use unsigned int if stdint.h is not available and UINT_MAX is 0xffffffff
otherwise use unsinged long
* ft245r.c: added support for more pin functions led, vcc, buff

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1169 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-06 19:21:38 +00:00
hweisbach fc7b83a267 avrftdi_tpi.[c|h]: integrate avr_tpi_[program_enable,chip_erase]()
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1168 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-06 12:50:42 +00:00
hweisbach b1eab6f93c avr.c: Adds avr_tpi_program_enable
Generic function enabling external programming on TPI devices. This
function sets the required guard time (which is passed in as parameter),
checks the TPI identification register, writes SKEY command + SKEY, and
finally polls the NVMEN bit in TPISR.

avr.h: Add prototype definitions of avr_tpi_program_enable() and
avr_tpi_chip_erase().
avrftdi_tpi.c: Removes tpi_skey_cmd array, containing the SKEY command
and the SKEY bytes.
tpi.h: Adds tpi_skey_cmd array, containing the SKEY command and the SKEY
bytes, but in the reverse order of tpi_skey.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1167 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-06 12:49:26 +00:00
hweisbach d46b2e880c avr.c: Add generic TPI chip erase function
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1166 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-06 12:43:47 +00:00
hweisbach a9e1e819c1 avrftdi.c: Fail on wrong pin configuration
also change error return value of set_pin from 1 to -1.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1165 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-06 12:05:27 +00:00
hweisbach ec6278b5a8 avrftdi: Change to new 0-based pin definitions
avrdude.conf.in: Change all programmers' pin definitions to 0-based
avrftdi.c: incorporate new 0-based pindef infrastructure
avrftdi_private.h: Add pin_checklist_t to avrftdi_t for runtime pin
checking in pgm->setpin.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1164 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-06 11:48:15 +00:00
hweisbach c8d3302128 avrftdi: Use pgm->setpin instead of pgm->cookie->set_pin
avrftdi.c: remove set_pin init, add pgm->setpin init
avrftdi_private.h: remove avrftdi_t->set_pin member
avrftdi_tpi.c: change avrftdi_t->set_pin calls to pgm->setpin.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1163 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-06 11:48:08 +00:00
joerg_wunsch 0e59564519 Include "ac_cfg.h" before testing for HAVE_* macros.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1162 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-06 09:54:27 +00:00
rliebscher e5b9551631 * main.c: revert to rev 1159 (doing pgm_display after pgm_open)
* avrpart.[ch]: moved avr_pin_name to pindefs.[ch]
* pgm.c: moved pins_to_str to pindefs.[ch], added initialization of 
          new pin definitions in pgm_new()
* pindefs.[ch]: added moved functions from other files, added a lot of 
          documentation, reformatted files using astyle to have consistent spacing,
          added a new generic check function for pins
* ft245r.c: used new generic pin check function

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1161 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-05 13:35:35 +00:00
rliebscher 22158cd03a Create new pin definition data structures to support 0-based pin numbers, and mixed inverse/non-inverse pin lists.
* avrftdi.c,buspirate.c,linuxgpio.c,par.c,serbb_*.c: added function call 
          to fill old pinno entries from new pin definitions.
	* pindefs.[hc]: added data struct and helper functions for new pin definitions
	* avrdude.conf.in: pins in entries using ftdi_syncbb are now 0-based
	* config_gram.y: allow combinations of inverted and non-inverted pins in pin lists
	* ft245r.c: reworked to work directly with the new pin definitions,
          pins are now 0-based, inverse pins are supported, buff is supported
	* pgm.[ch]: added new pin definitions field to programmer structure, 
          adapted pin display functions

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1160 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-03 22:35:00 +00:00
hweisbach a2ab9c6039 avrftdi_tpi.c: Remove set_pin() to set MOSI high
This is not necessary any more, because the "frame" ends in logic 1, so
the pin is high anyway and the MPSSE keeps the pin value as long as it
is idle. Setting the pin low would cause the TPI physical layer in the
AVR part to detect a collision.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1159 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-03 13:01:20 +00:00
hweisbach 779538b9af avrftdi_tpi.c: Update I/O to pgm->cmd_tpi
All I/O of avrftdi_tpi is done in terms of pgm->cmd_tpi() calls instead
of calling avrftdi_tpi_[read,write]_byte() functions directly.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1158 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-03 12:58:15 +00:00
hweisbach ff0edb786a avrftdi_private.h: Update forward declaration
avrftdi_print() is now avrftdi_log

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1157 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-03 12:55:24 +00:00
hweisbach 3067b2c8de avrftdi: move logging defines to avrftdi_private.h
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1156 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:07:37 +00:00
hweisbach 9c6c6d2f59 avr.c: Fix avr_tpi_poll_nvmbsy() polling returned data instead return
code

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1155 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:07:30 +00:00
hweisbach 7e1778019a Updates NEWS file with avrftdi's TPI support
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1154 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:07:22 +00:00
hweisbach 7cc2b783a3 avrftdi_private.h: Fix header include order in windows
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1153 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:07:16 +00:00
hweisbach d753dc6905 avrftdi.c: Fix wrong loop invariant in write_flush()
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1152 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:07:07 +00:00
hweisbach 12ff2d6a20 Adds TPI-support for FTDI-based programmers with MPSSE
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1151 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:07:00 +00:00
hweisbach 8b4c54e37f avrftdi: Set guard time to fixed 2 bits.
avrftdi_private.h, avrftdi.c: remove pdata->guard_bits refernces, since
they are no longer needed
avrftdi_tpi.c: Use fixed guard time of 2 bits, this gives 16 bits per
frame. tpi_byte2frame() and tpi_frame2byte() functions are now
symmetrical and extraction of received data in avrftdi_read_byte is less
complicted. Write the new guard time to the TPI in
avrftdi_tpi_program_enable().

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1150 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:06:52 +00:00
hweisbach d61242c19c avrftdi_tpi.c: Adds avrftdi_tpi_disable()
In this function the NVM enable bit in TPISR is written to zero, like
described in AVR918. The reset line is released in avrftdi_close().

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1149 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:06:45 +00:00
hweisbach f949c94465 avrftdi_tpi.c: Simplify break command by sending 16 zero bits
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1148 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:06:37 +00:00
hweisbach 0d9c0c5e9e tpi.h: Adds definition of TPI Identification code
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1147 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:06:30 +00:00
hweisbach fc58b5286b avrftdi_tpi.c: Move to new avrftdi log infrastructure
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1146 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:06:22 +00:00
hweisbach a29fc23148 Adds initial avrftdi TPI support.
Device identification is possible tested under OS X 10.6.8 with an
FT4232H and ATtiny10.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1145 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:06:15 +00:00
hweisbach 57b5e76065 avrftdi.c: rename constant ERROR to ERR
ERROR is already defined as a preprocessor macro in wingdi.h.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1144 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-04-28 19:35:36 +00:00
hweisbach fc709f2a84 Rework of textual output of avrftdi.
Messages are divided by severity and printed accordingly to verbosity, as
specified by the user. The provided severity level are (ERROR, WARN, INFO,
DEBUG, TRACE). Where "ERROR" messages are always printed. Shortcut-macros
including function, from which the output was generated, and line number were
also added. Some log messages were updated and other code warnings removed.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1143 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-04-28 19:35:26 +00:00
hweisbach a6f4aac8b1 Fixes bugs #38659 and #38831
Apparently, doing too large read/write I/O on the MPSSE fills up the RX Buffer
of the chip, resulting in STALL/NAK of additional transactions of an OUT request.
Since the OUT request is issued synchronously, an appropriate IN request cannot
be issued, resulting in a deadlock.
This problem is handled by submitting small enough OUT requests, that will not
fill up the RX buffer and interleaving them with IN requests.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1142 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-04-27 21:49:27 +00:00
hweisbach 2a3ecd0672 Updates avrftdi to use libftdi1
This includes adding libftdi1 to configure.ac and Makefile.am.
avrftdi code is changed to use libftdi1. At the same time device
discovery is moved to libftdi1. Some error and debug messages in
avrftdi are corrected and/or updated. avrftdi_print is updated,
to print all messages whose verbosity level is less or equal to
the global verbosity level, so that messages with level 0 are always
printed.
This change is tested on OS X 10.6.8, Ubuntu 12.04.2 and Win7 x86_64.
The Win7 version was cross-compiled on OS X 10.6.8.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1141 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-04-27 20:52:01 +00:00
joerg_wunsch 31618cb6df Replaces the old AM_CONFIG_HEADER by AC_CONFIG_HEADERS; automake 1.13+
barfs.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1140 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-04-25 20:14:44 +00:00
joerg_wunsch 9ad7888bc0 Add new devices: ATmega2564RFR2, ATmega1284RFR2, ATmega644RFR2
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1139 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-03-12 10:07:56 +00:00
rliebscher a8c3a0973a patch #7724 Add TPI support for Bus Pirate using bitbang mode
* buspirate.[ch]: added support for BusPirate Bitbanging
	* avrdude.conf.in: added entry for buspirate_bb
	* pgm_type.c: added entry for buspirate_bb


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1138 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-30 21:15:39 +00:00
rliebscher 825c570746 patch #7936 Patch to support BusPirate AVR Extended Commands mode
* buspirate.c: added support for BusPirate AVR Extended Commands mode
	* avrdude.1: added doc for nopagedread parameter
	* doc/avrdude.texi: added doc for nopagedread parameter


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1137 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-30 18:56:31 +00:00
rliebscher f33873b1ba patch #7723 Bus Pirate “raw-wire” mode which can run down to 5 kHz
* buspirate.c: added raw wire mode
	* avrdude.1: added doc for rawfreq parameter
	* doc/avrdude.texi: added doc for rawfreq parameter

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1136 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-30 17:58:48 +00:00
rliebscher a4dbfc95fa bug #37977 Support for Openmoko Debug Board
* avrdude.conf.in: added openmoko entry

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1135 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-30 16:46:31 +00:00
rliebscher 707e6634c1 patch #7932 Read USBtiny VID and PID from avrdude.conf if provided.
* avrdude.conf.in: added usbpid, usbvid to usbtiny
	* usbtiny.[ch]: use usbpid, usbpid if provided in config file

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1134 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-29 18:33:34 +00:00