Commit Graph

684 Commits

Author SHA1 Message Date
Joerg Wunsch 73f657ac41 Add the "stk500generic" programmer that auto-probes for STK500
either firmware version 1 or 2.
* Makefile.am (avrdude_SOURCES): add the new files
stk500generic.c and stk500generic.h.
* avrdude.conf.in: Add the stk500generic programmer type, and
change the "stk500" entry to point to this programmer.
* config_gram.y: Add the stk500generic keyword.
* lexer.l: (Ditto.)
* stk500.c: Change the stk500v1 code to not call exit()
prematurely when failing to open the programmer, but instead
return an error status.
* stk500generic.c: (New file.) Stub programmer implementation.
Probe for either stk500v1 or stk500v2, and adjust the current pgm
appropriately.
* stk500generic.h: (New file.) Declare the public interface(s)
of stk500generic.c.
* doc/avrdude.texi: Document the changed behaviour of stk500.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@663 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-19 22:27:30 +00:00
Joerg Wunsch 2e86c833ce Various fixes for ancient processors and their capabilities. For the
AT90S1200 and the AT90S8515, fuse bit handling via ISP, and lock bit
reading via ISP are not supported at all.  For the AT90S4414 (small
brother of the AT90S8515), add the ability to write the lock bits, and
add a definition for the fuse bits (usable for HV programming).  For
the AT90S2313, add the "fuse" memory range, so it's available for HV
programming.

Resolves bug #17796: avrdude will not program or verify lockbits with
Atmel STK protocol programmers


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@662 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-18 21:48:36 +00:00
Joerg Wunsch f3dfeb6ecf Submitted by Thomas Fischl:
* usbasp.c: Check for USBasp with new as well as old VID/PID
pair, warn the user about upgrading the firmware in case an
old one has been found.
* usbasp.h: Add new VID/PID.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@661 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-17 20:35:36 +00:00
Joerg Wunsch 8e5f9c7e1b Fix some mistakes for the ATtinyX61 family:
. high fuse has 8 bits
. there is an extended fuse (just one bit)
. the calibration area is only 1 byte


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@660 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-15 21:41:29 +00:00
Joerg Wunsch af4f648cf5 More texinfo incompatibilities to avoid: replace @headitem by @item
and @strong{}


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@659 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-14 20:07:14 +00:00
Joerg Wunsch 4f9cd863b8 Not all texinfo versions understand indicateurl{}, so resort to url{}.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@658 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-14 20:00:55 +00:00
Joerg Wunsch 84ed521326 Convert some of the tables to multitables
in order to beautify the result.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@657 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-12 12:01:34 +00:00
Joerg Wunsch c788c75014 Contributed by Thomas Fischl: add support for USBasp.
patch #4686: Add support for USBasp, a simple USB programmer
* usbasp.c: New file, implement the USBasp driver.
* usbasp.h: New file, interface declarations for USBasp.
* Makefile.am: Wire the new files into the build.
* avrdude.conf.in: Add the usbasp programmer entry.
* config_gram.y: Add the usbasp token.
* lexer.l: (Ditto.)
* avrdude.1: Document the USBasp programmer.
* doc/avrdude.texi: (Ditto.)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@656 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-10 20:41:00 +00:00
Joerg Wunsch c4e4fa62c3 Implement -U filename as a shorthand for -U flash:w:filename:a.
This has once been suggested by Brian Dean.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@655 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-08 21:52:45 +00:00
Joerg Wunsch 16c7a11538 Implement numerical output formats for decimal, hexadecimal, octal,
and binary numbers.

Closes bug #16129: more output formats for fuse bits (avrdude
enhancement request)

* fileio.c: Implement fileio_num() and the itoa_simple() helper function.
* fileio.h: Add new file formats to FILEFMT.
* main.c: Parse the new file formats.
* avrdude.1: Document all this.
* doc/avrdude.texi: (Ditto.)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@654 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-08 21:28:24 +00:00
Joerg Wunsch ac7bf0624c Hide two debug/trace statements behind "verbose".
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@653 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-08 21:10:05 +00:00
Joerg Wunsch 6e45624477 CPP statements start in column #1.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@652 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-08 19:46:45 +00:00
Joerg Wunsch 4bc635da8c Describe how to disable the DWEN fuse.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@651 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-07 20:42:01 +00:00
Joerg Wunsch 3318df48ed Translate numerical response codes to strings.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@650 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-07 19:57:59 +00:00
Joerg Wunsch f615f8cbad Fix a broken indentation.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@649 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-07 19:37:41 +00:00
Joerg Wunsch 3b69ebd4e9 The avr109 programmer type no longer chokes on a wrong avr910 device
ID, so remove that description.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@648 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-07 19:34:17 +00:00
Joerg Wunsch 9a2971fb35 When failing to start in ISP mode, try debugWire instead. This
requires the user to eventually restart AVRDUE from scratch then.

jtagmkII_reset() had to get a second parameter in order to record
the reset mode.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@647 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-06 22:37:30 +00:00
Joerg Wunsch 66fa9f0689 In stk500v2_jtagmkII_open(), when the ICE synchronization failed,
still call the close method so we sign off correctly from the ICE:


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@646 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-06 22:33:59 +00:00
Joerg Wunsch 1abf521ee3 jtagmkII_open() is not needed externally.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@645 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-06 22:30:00 +00:00
Joerg Wunsch 8962bec663 Fix the maxsize comparision in stk500v2_jtagmkII_recv(), it was off
by one.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@644 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-06 22:29:27 +00:00
Joerg Wunsch d973ae28e3 Add support for the JTAG ICE mkII in ISP mode.
* avrdude.conf.in (jtag2isp): New programmer entry.
* config_gram.y: Add K_JTAG_MKII_ISP.
* jtagmkII.c: Restructure and export some more functions.
* jtagmkII.h: Declare exported functions.
* jtagmkII_private.h: Prepare file to be included in stk500v2.c.
* lexer.l: Add jtagmkii_isp token.
* stk500v2.c: Implement glue to jtagmkII.c.
* stk500v2.h: Declare stk500v2_jtagmkII_initpgm().
* avrdude.1: Document the new programmer support.
* doc/avrdude.texi: (Ditto.)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@643 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-06 20:06:07 +00:00
Joerg Wunsch 4074a28682 Add date and time of compilation to the verbose greeting message.
Idea taken from patch #3172: Adds date and time of compile to usage
message


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@642 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-01 21:15:03 +00:00
Joerg Wunsch cba56a46fe Contributed by <avrdude@zevv.nl> as
patch #4372: Better synchronization for stk500

Sync three times, and drop any noise inbetween.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@641 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-01 21:00:36 +00:00
Joerg Wunsch 82a9e3cd60 Add entries for the ATtiny261/461/861 devices.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@640 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-01 20:48:04 +00:00
Joerg Wunsch 74f8cf9dd5 Remove unused variable.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@639 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-01 10:06:53 +00:00
Joerg Wunsch 1c121a456a * butterfly.c: Remove the device support decision based on
the old AVR910 device codes; we've got signature verification
now so better rely on that.

* avr910.c: Revert the signature bytes returned, as it already
happened in butterfly.c.  This closes bug #14998: Signature Bytes
read in wrong order (avr910 mode)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@638 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-01 10:03:12 +00:00
Joerg Wunsch c71e4d3674 Submitted by Wim Lewis.
Improve error handling.

patch #4923: Better error reporting for serial-bitbang programmers


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@637 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-31 22:07:39 +00:00
Joerg Wunsch 54b633cace Introduce a "stk500v1" entry, so we can switch the default "stk500" to
"stk500v2" some day.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@636 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-31 21:19:58 +00:00
Joerg Wunsch 6eeab88fd4 The major part of this change has been contributed by
<andyw@pobox.com>.

Implements patch #4635: Add support for terminal/console servers for
serial programmers

* ser_posix.c: Add net_open(), and divert to it for net:host:port.
* ser_win32.c: Recognize net:host:port, and bail out.
* avrdude.1: Document the net:host:port connection option.
* doc/avrdude.texi: (Ditto.)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@635 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-31 20:52:47 +00:00
Joerg Wunsch fc87fe433a Fix for bug #16627: Butterfly programmer does not reset after programming
Wait for the device's response after sending an "E" command.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@634 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-31 11:02:25 +00:00
Joerg Wunsch 5dbc32c73e Tentative fix for bug #16156: Problem with Si-Prog
Disable reset before closing.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@633 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-31 10:55:20 +00:00
Joerg Wunsch fa5465b63f Rewrite the serbb code so the pin numbering matches the
DB9 connector, and fix some related bugs in serbb_posix.c.

Closes bug #16265: dasa2 does not work under posix

* avrdude.conf.in: New serbb pin numbering; added "siprog"
as an alias for "ponyser".
* serbb_posix.c: New pin numbering, fix some confusion.
* serbb_win32.c: New pin numbering.

The generic and Posix-related parts of these changes have
been contributed by Hanns-Konrad Unger


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@632 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-30 14:09:58 +00:00
Joerg Wunsch 6460235802 Rewrite the serbb code so the pin numbering matches the
DB9 connector, and fix some related bugs in serbb_posix.c.
Closes bug #16265: dasa2 does not work under posix

* avrdude.conf.in: New serbb pin numbering; added "siprog"
as an alias for "ponyser".
* serbb_posix.c: New pin numbering, fix some confusion.
* serbb_win32.c: New pin numbering.

The generic and Posix-related parts of these changes have
been contributed by Hanns-Konrad Unger


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@631 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-30 14:08:37 +00:00
Joerg Wunsch 4b97ebc9ad Contributed by the anonymous developer of patch #5096:
Add an entry for the Altera byteblaster.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@630 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-30 05:13:15 +00:00
Joerg Wunsch 00791df09d Rework the exit specs so they actually work again. It should be
possible to extend them for other programmers than PPI now (serbb,
stk500*).

* pgm.h: Keep the exit specs in an abstract form inside struct
programmer_t.  (Should be moved out into some programmer-specific
structure.)  Rename the getexitspecs() method into
parseexitspecs().
* main.c: Move the exit specs stuff out to the programmer
implementation.
* par.c: Implement the new exit spec handling.  Everything is now
done using the generic abstraction layer.

Closes bug #16443: No disable Resetsignal at the end of
Programming Session

Obviates need for patch #5057: quick and dirty Hack to unset Reset
after Programming


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@629 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-29 23:12:15 +00:00
Joerg Wunsch 9473243b2c This patch has been contributed by an anonymous developer
via the patch tracking system.

patch #5096: Allow VCC and BUFF to be any pin in parallel mode

* config_gram.y: Release the restriction to PPIDATA pins.
* par.c: Rework the code to introduce a function par_setmany()
that builds on top of par_setpin(), and use that function for the
PPI_AVR_VCC and PPI_AVR_BUFF pin collections.  This also abstracts
the polarity of these signals appropriately.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@628 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-29 21:39:26 +00:00
Joerg Wunsch 8a833f921e Contributed by Ned Konz:
Open the serial port with O_NONBLOCK, and save and restore the port
state before exiting.

patch #5008: Patch for (5.1) ser_posix.c for O_NONBLOCK open and
restoring serial port state on close

Closes bug #12622: avrdude hangs on macosx/darwin with PL-2303
usb-to-serial and Butterfly


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@627 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-28 21:17:01 +00:00
Joerg Wunsch ca1ed48a5e Move the bitbang prerequisite checks out from
main() into their own bitbang_check_prerequisites().


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@626 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-23 21:06:28 +00:00
Joerg Wunsch d54f7a4fdb So finally, also ignore the Makefile.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@625 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-23 15:02:07 +00:00
Joerg Wunsch 879dd88de5 Two more things to ignore by CVS.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@624 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-23 15:01:04 +00:00
Joerg Wunsch 291c0515b9 Make CVS ignore all generated files.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@623 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-23 15:00:11 +00:00
Joerg Wunsch fc2bb33bb6 * avrdude.conf.in: Add page mode parameters for all "eeprom" memory
definitions that are organized in pages.

* avr.c (avr_write_byte_default): Consider using the loadpage
instructions only if the respective memory is marked "paged".

Closes bug #17199: EEPROM fails verification on ATmega645 with
pony-stk200 hardware
Closes bug #16849: EEPROM write fails for AT90USB1287 with mode 0x41
Closes bug #15146: stk500v2_paged_write: loadpage instruction not
defined for part


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@622 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-22 22:05:19 +00:00
Joerg Wunsch 1ac704aa18 Change "avrispmk2" into "avrisp2" (in the description of the -d
option) as that is the programmer actually supported by
avrdude.conf.in.

Closes bug #15677: documentation mentions wrong programmer-id "avrispmk2"


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@621 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-22 20:01:25 +00:00
Joerg Wunsch 7c00e9ce8d Fix various AVR910 device codes. Add the code tables from both,
AVR910 and AVR109.  Change avr910_devcode of the ATtiny2313 to 0x5e
(ATtiny26).

Closes bug #16671: Tiny2313 avr910_devcode is bad
Closes bug #15826: avr910 device type for ATmega8 wrong


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@620 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-21 21:00:45 +00:00
Joerg Wunsch 1066d7cbb2 Add (rather conservative) write delay timing values to the *fuse and
lock memory spaces of all devices where they have been missing.  Add
the lock memory space to the ATmega48 section.

Closes bug #14920: tiny2313 fuses and AVRDUDE 5.0
Closes bug #15751: atmega48: no lock bits defined


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@619 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-21 20:19:35 +00:00
Joerg Wunsch 656a37122e Fix the size of the calibration memory space for ATtiny13, ATmega64,
ATmega16, ATmega32, ATmega8535, ATtiny25, ATtiny45, ATtiny85.

Closes bug #17383: Wrong calibration section in avrdude.conf...


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@618 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-21 19:43:05 +00:00
Joerg Wunsch c4770ee293 Correct the pagesize of the ATmega324 from 256 to 128.
This closes bug #16410: ATMega164/324/644 cannot be programmed


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@617 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-21 19:09:32 +00:00
Joerg Wunsch 13ae062376 * configure.ac: Check for gettimeofday().
* ppiwin.c (gettimeofday): Define gettimeofday() replacement
only if !defined(HAVE_GETTIMEOFDAY); use correct protype.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@616 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-20 06:49:11 +00:00
Joerg Wunsch fafd64f35d Some more STK500 vs. AVRISP cleanup: don't announce STK500-only
parameters on AVRISPs.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@615 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-19 21:02:45 +00:00
Joerg Wunsch 3f6708683a Minor cosmetic changes: STK500 firmware version numbers are M.NN, so
always display the minor number as two digits.  Examine the response
to the sign-on command to see which programmer hardware we are talking
to, and then restrict the STK500 topcard display to devices detected
as STK500.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@614 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-18 21:23:34 +00:00