Commit Graph

690 Commits

Author SHA1 Message Date
Joerg Wunsch 6897c7b4a5 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@722 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-24 22:43:46 +00:00
Joerg Wunsch 9436ea57d1 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@721 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-24 21:07:54 +00:00
Joerg Wunsch f2154ce2ea 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@720 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-13 22:57:14 +00:00
Joerg Wunsch 6aed88281a * 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@719 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-12 22:41:05 +00:00
Joerg Wunsch 2e7333d3cc * 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@718 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-11 20:20:25 +00:00
Joerg Wunsch 8daaa34ba8 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@717 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-07 22:36:45 +00:00
Joerg Wunsch 0058fff9d8 ChangeLog rotation.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@716 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-07 22:34:21 +00:00
Joerg Wunsch 37ecc60f24 We are post-release (again).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@715 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-22 23:21:53 +00:00
Joerg Wunsch 1fc0d26959 Actually bump version to 5.3.1 now.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@713 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-22 22:55:33 +00:00
Joerg Wunsch c59ed7097e * 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@712 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-22 22:52:34 +00:00
Joerg Wunsch ba82e4bb01 We are now post release 5.3.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@711 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 22:48:14 +00:00
Joerg Wunsch b2c5030890 Cosmetic: mention the current changes are now for 5.3.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@709 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 22:40:06 +00:00
Joerg Wunsch 1652c1b781 Mention frank-stk200 in the docs.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@708 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 22:05:56 +00:00
Joerg Wunsch 22fe8cd1e1 Bump version to 5.3, ready to release.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@707 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 22:01:30 +00:00
Joerg Wunsch 9749ffcd75 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@706 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 21:44:14 +00:00
Joerg Wunsch ac95d249d6 In usbOpenDevice(), clear the error code when returning successfully.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@705 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-21 21:21:14 +00:00
Joerg Wunsch f239ffa1d1 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@704 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-20 23:43:34 +00:00
Joerg Wunsch ef04ad29bf 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@703 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-15 15:42:44 +00:00
Joerg Wunsch a1afb8ea4a 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@702 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 16:48:52 +00:00
Joerg Wunsch 631f057984 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@701 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 16:02:45 +00:00
Joerg Wunsch dfe36d084b Sigh, fix yet another printf() format warning (on 64-bit architectures).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@700 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 15:33:19 +00:00
Joerg Wunsch 7abd4c5bb2 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@699 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 15:15:50 +00:00
Colin O Flynn f25cf95909 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@698 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 14:41:59 +00:00
Joerg Wunsch 10eb9c7f5c 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@697 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 14:23:46 +00:00
Joerg Wunsch 08f272851c 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@696 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 14:06:52 +00:00
Joerg Wunsch 35a87b9b6f 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@695 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 14:01:54 +00:00
Joerg Wunsch ab86a7d09b 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@694 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 12:47:35 +00:00
Joerg Wunsch fa205ce214 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@693 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-23 07:07:06 +00:00
Joerg Wunsch 7d1d5424d2 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@692 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-23 07:02:22 +00:00
Joerg Wunsch a473be7683 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@691 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-21 16:13:08 +00:00
Joerg Wunsch 84e401d795 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@690 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-21 11:56:26 +00:00
Joerg Wunsch 17ac6b9989 Mention our debugWire support.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@689 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-21 11:19:10 +00:00
Joerg Wunsch 4108e10380 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@688 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 23:23:37 +00:00
Joerg Wunsch 71cd3f3dd1 jtagmkI_close(): remove two unused variables.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@687 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 22:07:25 +00:00
Joerg Wunsch 47bc86120d Fix date of last changelog entry (copy&paste-o).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@686 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 21:35:26 +00:00
Joerg Wunsch 22879832f1 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@685 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 15:08:13 +00:00
Joerg Wunsch a4fa4ea9fc 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@684 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 15:04:09 +00:00
Joerg Wunsch 074b7a0868 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@683 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-13 21:14:28 +00:00
Colin O Flynn 1da689ac37 * avrdude.conf.in: Add read support for lockbits on Tiny2313 device.
Applies patch #5538


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@682 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-12 16:11:55 +00:00
Joerg Wunsch c02384d670 Add signatures for ATmega325/3250/645/6450.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@681 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-09 23:06:55 +00:00
Joerg Wunsch 45d7a727cd Preserve ${LDFLAGS} inherited from environment for Win32 environments.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@680 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-08 12:37:05 +00:00
Joerg Wunsch d11d70ea6c Don't pretend --enable-doc were the default.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@679 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-07 20:32:41 +00:00
Joerg Wunsch 885333687c 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@678 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-02 21:02:41 +00:00
Joerg Wunsch 197dc966e9 Implement and document HVSP and PP modes for the AVR Dragon.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@677 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-01 21:47:25 +00:00
Joerg Wunsch 25e7980b28 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@676 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-27 08:45:47 +00:00
Joerg Wunsch 38c5d278aa Add support for the AVR Dragon (JTAG and ISP mode).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@675 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-26 21:14:10 +00:00
Joerg Wunsch f2d7a52f51 This is post-release 5.2 now.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@674 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-09 14:57:18 +00:00
Joerg Wunsch 79ce8f34bf Bump version for release 5.2.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@672 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-09 14:47:29 +00:00
Joerg Wunsch 2ccc76a66d 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@671 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-09 14:34:24 +00:00
Joerg Wunsch 6b8fa85a0b 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@670 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-09 09:56:10 +00:00