Commit Graph

689 Commits

Author SHA1 Message Date
joerg_wunsch 07c1079415 Major code cleanup.
- Make all internal functions "static".
- Make sure each module's header and implementation file match.
- Remove all library-like functionality from main.c, so only
  the actual frontend remains in main.c.
- Add C++ brackets to all header files.

That effectively leaves the various module C files as something like
an "avrdude library", with main.c being the currently only frontend
program for that library.  In theory, it should be possible to write
different frontends using the same library backend functions though.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@722 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-24 22:43:46 +00:00
joerg_wunsch 1cae809b9b Something I always wanted to do: replace all those private "extern"
declarations in each file by a central header file "avrdude.h".


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@721 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-24 21:07:54 +00:00
joerg_wunsch 2c6b2309d5 ATmega8: Bump the delay values for flash
and EEPROM, based on the current Atmel XML file.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@720 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-13 22:57:14 +00:00
joerg_wunsch dfdd8c0ea5 * configure.ac: Improve the detection of the Win32 HID library,
and the presence of the header ddk/hidsdi.h.  It now works
correctly under Cygwin and several flavours of MinGW.

* Makefile.am: Add new LIBHID pattern.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@719 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-12 22:41:05 +00:00
joerg_wunsch b991041fe3 * butterfly.c (butterfly_initialize): when sending the 'T'
command (which is ignored by current AVR109 bootloaders),
send the first reply from the list of supported device
codes back rather than using avrdude.conf's idea about
an AVR910 device code.  Apparently, this solves disagreements
between different versions of at least the ATmega8 AVR910
device code.

Closes bug #18727: Writing flash failed


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@718 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-11 20:20:25 +00:00
joerg_wunsch ebad612f9a Reported by Till Harbaum:
Change HVSP reset timing for ATtiny25/45/85 from
500 microseconds to 1 ms, matching the most recent Atmel XML
specs.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@717 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-07 22:36:45 +00:00
joerg_wunsch 065eaa9bda ChangeLog rotation.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@716 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-07 22:34:21 +00:00
joerg_wunsch 159be5f675 We are post-release (again).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@715 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-22 23:21:53 +00:00
joerg_wunsch cb7646c7b6 Actually bump version to 5.3.1 now.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@713 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-22 22:55:33 +00:00
joerg_wunsch 1ad3f961f1 * configure.ac (AC_INIT): Bump version to 5.3.1.
* avrdude.conf.in (frank-stk200): Fix syntax error.
* ser_avrdoper.c: Make #ifdef for Win32/libhid
consistent with the initial check: use the HID driver
only iff found, otherwise use libusb.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@712 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-22 22:52:34 +00:00
joerg_wunsch 857c1ba558 We are now post release 5.3.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@711 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 22:48:14 +00:00
joerg_wunsch 2fc6741f06 Cosmetic: mention the current changes are now for 5.3.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@709 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 22:40:06 +00:00
joerg_wunsch 8f04e0fd1c Mention frank-stk200 in the docs.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@708 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 22:05:56 +00:00
joerg_wunsch 6dad64ee01 Bump version to 5.3, ready to release.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@707 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 22:01:30 +00:00
joerg_wunsch ff1fcf6c5d Submitted by Vince VG:
* avrdude.conf.in (frank-stk200): New programmer added.
Closes patch #5502: one other programmer


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@706 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 21:44:14 +00:00
joerg_wunsch 6523398ca8 In usbOpenDevice(), clear the error code when returning successfully.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@705 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 21:21:14 +00:00
joerg_wunsch 26e8bc656a Submitted by Christian Starkjohann:
patch #5507: Support for AVR-Doper USB programmer in HID mode

* configure.ac: Add hooks to detect the Win32 HID library,
as well as the existence of <ddk/hidsdi.h>.
* Makefile.am: Add new files.
* my_ddk_hidsdi.h: (New file.)
* ser_avrdoper.c: (New file.)
* serial.h: Add declaration for avrdoper_serdev.
* stk500v2.c: Add hook to divert to the AVR Doper code.
* avrdude.1: Document the AVR Doper support.
* doc/avrdude.texi: (Ditto.)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@704 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-20 23:43:34 +00:00
joerg_wunsch 97e45d71bb Submitted by ivanv at netman.ru
Fix length for single-byte write operations.
Closes bug #18527 JTAG ICE: fuse bits have been writen incorrectly


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@703 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-15 15:42:44 +00:00
joerg_wunsch 4652c6428a In jtagmkII_paged_write(), remove a debugging
usleep(1000000) that accidentally crept in in rev 1.19.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@702 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 16:48:52 +00:00
joerg_wunsch ee0dcf32bc In ser_open(), do fill in fdp->ifd before already
using it in ser_setspeed().


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@701 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 16:02:45 +00:00
joerg_wunsch 863e3f6c92 Sigh, fix yet another printf() format warning (on 64-bit architectures).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@700 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 15:33:19 +00:00
joerg_wunsch dd48976e55 In jtagmkI_close(), revert baud rate to the initial
value in case we had changed it.

Fixes bug #18262: JTAGMKI/JTAG1 Reset Bug


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@699 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 15:15:50 +00:00
c_oflynn b4807ef7da Colin O'Flynn <coflynn@newae.com>
* safemode.c: Stop ignoring return values!
      Closes bug #18339


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@698 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 14:41:59 +00:00
joerg_wunsch 5b53108e63 Submitted by Nick Lott:
Fix signature for ATmega8515.

Closes bug #18348: ATMEGA8515 Signature is wrong in avrdude.conf


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@697 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 14:23:46 +00:00
joerg_wunsch 6cd309f1c0 Actually return the number of bytes read or written in avr_read() or
avr_write(), respectively, in case the paged_load()/paged_write()
methods succeeded, rather than only 0.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@696 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 14:06:52 +00:00
joerg_wunsch 4beee5ff79 Fix a bug introduced in rev. 1.69, when implementing the
fallback from each programmer's paged_load() or paged_write()
method, respectively.  The return value needs to be checked for
being greater or equal than 0 rather equal to 0 in order to
assume the operation has been successful.

Fixes bug #18489: avrdude is too slow (20 byte/s)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@695 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 14:01:54 +00:00
joerg_wunsch 31fa98b708 Make the code compile warning-free:
- declare a dummy "struct timezone" for some Win32 systems (MinGW)
- fix a few printf() argument types
- get rid off the prevailing "all filedescriptors are of type int"
  attitude

The last item required a large sweep across the code, in order to
replace all "int fd"s by "struct filedescriptor *fd"s, and pass
pointers (as we cannot pass a union directly).  In return, the
code is now supposed to be fully 64-bit safe, rather than relying
on a 64-bit pointer being converted to a (32-bit) int and back
to a pointer as we did previously.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@694 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 12:47:35 +00:00
joerg_wunsch 8bd117dccf Implement EEPROM access through debugWire.
* jtagmkII.c: Extend the jtagmkII_read_byte() and
jtagmkII_write_byte() methods to handle EEPROM through
debugWire.

* avrpart.h: Implement the "flash instruction" parameter.
* config_gram.y: (Ditto.)
* lexer.l: (Ditto.)
* avrdude.conf.in: (Ditto.)

* avrdude.1: Document the EEPROM access through dW.
* doc/avrdude.texi: (Ditto.)

* tools/get-dw-params.xsl: Extend to extract the flash
instruction field.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@693 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-23 07:07:06 +00:00
joerg_wunsch aef8e953ab In avr_read() and avr_write(), if the paged access returns a
failure, fall back to byte access.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@692 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-23 07:02:22 +00:00
joerg_wunsch 4bbd40415d In jtagmkII_read_byte() and jtagmkII_write_byte(), return an error
upon failure now that the upper layers won't fall back to the cmd()
method anymore in that case.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@691 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-21 16:13:08 +00:00
joerg_wunsch 134947dc7f Add debugWire entries for all devices where dW is known to exist
(according to the XML files).

Add an XSL stylesheet to extract the dW
parameters from the XML files.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@690 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-21 11:56:26 +00:00
joerg_wunsch 098a6c6bea Mention our debugWire support.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@689 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-21 11:19:10 +00:00
joerg_wunsch 8ed8377442 Implement debugWire programming support. Several limitations are
imposed by debugWire itself, so effectively, only flash ROM can be
read and written.

Currently, the required changes to avrdude.conf.in are only present
for the ATtiny44.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@688 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 23:23:37 +00:00
joerg_wunsch 46e0286657 jtagmkI_close(): remove two unused variables.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@687 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 22:07:25 +00:00
joerg_wunsch 80d0bb3ee7 Fix date of last changelog entry (copy&paste-o).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@686 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 21:35:26 +00:00
joerg_wunsch c0b3f461fd Add the default read_byte() and write_byte() methods here, too. Forgot
to commit these files in previous commit.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@685 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 15:08:13 +00:00
joerg_wunsch 351f329ec8 Replace the fallback of avr_read_byte() and avr_write_byte() to
avr_read_byte_default() and avr_write_byte_default (resp.) by directly
calling the latter functions from within all programmers that don't
implement their own read_byte()/write_byte() methods.  In turn, make the
read_byte() and write_byte() methods mandatory, and the cmd() method
(direct ISP command) optional instead (it's effectively mandatory for
any programmer using avr_read_byte_default()/avr_write_byte_default()
though).  Remove all the pointless cmd() method stubs from those programmers
that don't need it.

Eliminate avr_read_byte() as it was now completely identical to
pgm->read_byte().


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@684 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 15:04:09 +00:00
joerg_wunsch f330e73b79 Avoid sending a CMD_RESET when leaving programming mode, and CMD_GO
when closing the connection.  They cause the activity LED on the ICE
to continue to flicker, and are not necessary anyway (the target
starts to run by itself when leaving programmng mode).

This is a partial fix for bug #18262: JTAGMKI/JTAG1 Reset Bug


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@683 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-13 21:14:28 +00:00
c_oflynn 7d601905e4 * avrdude.conf.in: Add read support for lockbits on Tiny2313 device.
Applies patch #5538


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@682 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-12 16:11:55 +00:00
joerg_wunsch 8749d4562f Add signatures for ATmega325/3250/645/6450.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@681 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-09 23:06:55 +00:00
joerg_wunsch 1ef6c7ab77 Preserve ${LDFLAGS} inherited from environment for Win32 environments.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@680 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-08 12:37:05 +00:00
joerg_wunsch a304b7e0e3 Don't pretend --enable-doc were the default.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@679 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-07 20:32:41 +00:00
joerg_wunsch 8f24c5b181 Fix the width of the efuse memory area for a number of AVRs.
Closes bug #18182: Wrong setting of eFuse configuration for
mega640/1280/1281/2560/2561 in avrdude 5.2


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@678 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-02 21:02:41 +00:00
joerg_wunsch c35b4481dc Implement and document HVSP and PP modes for the AVR Dragon.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@677 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-01 21:47:25 +00:00
joerg_wunsch 0e4819c0e7 Implement a flags field in struct serdev, and populate it with a flag
that indicates whether the underlying communication can dynamically
change its speed or not.  This flag is set for true serial
communication but clear for USB communication.  Don't try to adjust
the speed when talking over a communication channel that doesn't
support it.  (The Dragon does not even support the respective
parameter.)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@676 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-27 08:45:47 +00:00
joerg_wunsch 2f798223d1 Add support for the AVR Dragon (JTAG and ISP mode).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@675 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-26 21:14:10 +00:00
joerg_wunsch c41831dd90 This is post-release 5.2 now.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@674 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-09 14:57:18 +00:00
joerg_wunsch cc389a88b8 Bump version for release 5.2.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@672 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-09 14:47:29 +00:00
joerg_wunsch 319d25efc4 Submitted by John Voltz: add AVR053 oscillator calibration.
* main.c: Add the -O option.
* pgm.c: Add the hook for the perform_osccal() method.
* pgm.h: (Ditto.)
* stk500v2.c: Implement perform_osccal().
* avrdude.1: Document the -O option.
* doc/avrdude.texi: (Ditto.)
Partially closes bug #17487: AVR RC oscillator calibration
routine not supported (feature request)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@671 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-09 14:34:24 +00:00
joerg_wunsch bed6aab084 Submitted by freckle@sf.net:
* stk500.c (stk500_paged_write): Send the command and the data
payload within a single write().
patch #5025: Improve stk500.c robustness

Submitted by Matthias Ringwald:
* stk500.c (stk500_open): do not flush the serial line after
getting in sync with the programmer.
patch #5293: stk500.c: no drain after sync (-> allow BTnode
Bootloader to work on cygwin)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@670 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-09 09:56:10 +00:00