Commit Graph

603 Commits

Author SHA1 Message Date
Joerg Wunsch 258eb700d7 On one of my systems (a not-too-current FreeBSD 5.x), libusb appears
to have problems sending a control message (returns an "I/O error").
At least try to recover gracefully in the bening case where the user
did not request a particular serial number, so we could continue
anyway without knowing it.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@481 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-07-25 19:52:20 +00:00
Joerg Wunsch 556eb032ef Change the check for libusb from using usb_open() to
usb_get_string_simple() as the latter is only found in recent enough
versions of libusb.  That way, silently build without USB support
unless a recent version is available.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@480 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-20 18:15:13 +00:00
Joerg Wunsch 899ef71424 Remove the check for the root dev. The required functionality is only
available in recent versions of libusb, and the check isn't really
needed anyway (as the check for vendor and product ID will cover that
as well).


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@479 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-20 18:12:04 +00:00
Joerg Wunsch f5882fc781 Implement and document a libusb-based USB transport for the JTAG ICE
mkII.

The serial transport methods have been moved out into a record of
function pointers for that purpose, defaulting to the actual serial
connection that natively applies to the hosting system.  Iff inside
the JTAG ICE mkII handler a port name starting with "usb" has been
detected, the record of function pointers is switched to USB.
Optionally, a serial number might be specified, so only the JTAG ICE
mkII matching the given serial number will be opened.  The match is
done right-to-left, so only the least significant bytes of the serial
number need to be given.

In order to make the change as least intrusive to existing drivers as
possible, the entire naming scheme of the serial_foo() function entry
points has been maintained as access macros that encapsulate these
into the respective indirect function calls via serdev->foo().


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@478 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-19 21:38:03 +00:00
Joerg Wunsch fcd9cf2e09 According to the part description XML file, set AllowFullPageBitStream for
the AT90CAN128 to "no".


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@477 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-15 04:46:12 +00:00
Joerg Wunsch 8a91d9afec Add "efuse" sections to the ATmega164/324/644 definitions.
Iff enter_progmode failed with RSP_ILLEGAL_JTAG_ID, give the user a
hint that their JTAGEN fuse might be unset.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@476 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-14 21:44:34 +00:00
Joerg Wunsch b35ab14409 Add support for the ATmega164/324/644.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@475 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-14 20:18:42 +00:00
Joerg Wunsch d16ca35686 Fix broken page/intrapage address bit assignments for the ATmega649x.
Now loading flash works on these devices even for simple parallel ISP
adapters.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@474 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-13 21:24:06 +00:00
Joerg Wunsch 79994f82b7 Add support for the ATmega329x/649x chips. Note that STK500v1 is not
officially supported for this device.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@473 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-11 21:27:09 +00:00
Joerg Wunsch 2be5a10ed8 Fix a signedness bug when shifting bits; this caused the length field
of the packet to occasionally been misinterpreted as a negative
number.

When discarding a packet for being overly long, restart the state
machine instead of attempting to drop a preposterous amount of data.
It is unlikely in that case that preposterous amount of data would
ever arrive, so rather attempt to re-align the reading algorithm
(supposedly resulting in a timeout and retransmit).


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@472 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-27 12:15:28 +00:00
Joerg Wunsch e7df01c555 Document that the JTAG ICE mkII code currently cannot write to flash
one byte at a time.  Also mention the bug tracker interface on
savannah.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@471 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-19 04:49:46 +00:00
Brian S. Dean 2578ff829a Update version after tagging the beta release.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@470 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 15:53:00 +00:00
Brian S. Dean 6e8b78eccc Catch up on my updates.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@468 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 15:22:31 +00:00
Brian S. Dean 33da1ebf09 Update version and copyright message.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@467 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 14:56:00 +00:00
Brian S. Dean d1e25a6921 Change the default port to 'serial' for the newly added serial
programmers stk500v2 and jtagmkii.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@466 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 14:49:39 +00:00
Joerg Wunsch d8dbc1e4d8 Umm, add the new programmer types to the texinfo documentation as well.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@465 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 08:06:18 +00:00
Joerg Wunsch afe6e3ffaf Add a ChangeLog entry for all the STK500v2 and JTAG ICE mkII modifications.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@464 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 07:57:58 +00:00
Joerg Wunsch 5b7a7a5711 Add an "jtag2fast" programmer that connects to the JTAG ICE at 115200 Bd.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@463 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 07:57:24 +00:00
Joerg Wunsch 97926d510f Rename the BAUD_xxx baud rate defines to PAR_BAUD_xxx to avoid a name
clash with the Win32 API names for baud rates.

Reported by: Eric


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@462 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 20:48:05 +00:00
Joerg Wunsch a5a700f7a1 Quite some cleanup of the JTAG ICE mkII stuff.
. Implement the new EECRAddress field in the device descriptor that is
  required by the 4.x firmware; make an uneducated guess about what
  firmware requires what length of device descriptor -- perhaps Atmel
  can be convinced to publish an official matrix for that.

. Specify EECR in the config file where required.  Obviously, only
  locations that differ from the 0x3c default are mentioned in the
  XML files, so by now, this only affects the AT90CAN128 for us.

. After clarification with Atmel, EnablePageProgramming should really
  default to 1, and only cleared if specified by an XML parameter.  So
  far, only the XML files for the ATmega256x and ATmega406 do specify
  it at all, and they specify a 1, too.

. Drop the entire OCDEN fuse heuristic.  If OCDEN is unprogrammed at
  startup, issue a warning that single-byte EEPROM updates won't be
  possible.  Leave it to the user to program the fuse if desired.
  That way, we won't run into any issue of prematurely wearing out the
  hfuse EEPROM cell.  Interestingly enough, this also solved the
  problem of the target not restarting from scratch upon sign-off.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@461 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 20:06:23 +00:00
Joerg Wunsch c2abd46745 Revert the serial_recv() timeout handling as it used to be before my
yesterday's changes (i.e. before rev. 1.10 of ser_posix.c), that is,
exit(1) in case of a timeout.  Previously, the upper layers didn't see
the timeout at all.

Quite possible that some of these drivers could handle a timeout more
intelligently though.  At least for the rather sophisticated STK500v2
protocol, I think it should be possible to retry the request.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@460 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 17:09:22 +00:00
Joerg Wunsch d3a6434d79 Try reading/writing more than one byte at a time, to improve overall
performance.

Note that many consumers still read one byte at a time though.

This patch has once been submitted to me by Bernd Walter
<ticso@cicely.de>, minor tweak by me (mainly to get it running under
Linux, too).


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@459 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 17:00:11 +00:00
Joerg Wunsch 566a0ec0e6 Make the retrier in case of rx timeouts more robust, by increasing
the receive timeout once a timeout happened.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@458 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 16:58:12 +00:00
Joerg Wunsch 245743ac5c Sorry, I accidentally spammed a local modification over the repository.
Backout rev 1.8 of bootstrap.h.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@457 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 21:06:44 +00:00
Joerg Wunsch bf8d7260df I missed to commit the allowfullpagebitstream attributes.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@456 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 21:04:55 +00:00
Joerg Wunsch 89b8ceb5d0 Properly close commend in $ Id $.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@455 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 20:58:45 +00:00
Joerg Wunsch 5973c5f7d4 serial_setattr() has been renamed to serial_setspeed().
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@454 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 20:57:52 +00:00
Joerg Wunsch 43b0ed2142 Oops, more files I forgot to add during the last commit.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@453 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 19:53:56 +00:00
Joerg Wunsch 3a3118953b I forgot to add these files in the previous commit. They are
basically obtained from Atmel's appnote AVR067.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@452 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 19:43:44 +00:00
Joerg Wunsch 04831af970 Mega-commit to bring in both, the STK500v2 support from Erik
Walthinsen, as well as JTAG ICE mkII support (by me).

Erik's submission has been cleaned up a little bit, mostly to add his
name and the current year to the copyright of the new file, remove
trailing white space before importing the files, and fix the minor
syntax errors in his avrdude.conf.in additions (missing semicolons).

The JTAG ICE mkII support should be considered alpha to beta quality
at this point.  Few things are still to be done, like defering the
hfuse (OCDEN) tweaks until they are really required.  Also, for
reasons not yet known, the target MCU doesn't start to run after
signing off from the ICE, it needs a power-cycle first (at least on my
STK500).

Note that for the JTAG ICE, I did change a few things in the internal
API.  Notably I made the serial receive timeout configurable by the
backends via an exported variable (done in both the Posix and the
Win32 implementation), and I made the serial_recv() function return a
-1 instead of bailing out with exit(1) upon encountering a receive
timeout (currently only done in the Posix implementation).  Both
measures together allow me to receive a datastreem from the ICE at 115
kbps on a somewhat lossy PCI multi-UART card that occasionally drops a
character.  The JTAG ICE mkII protocol has enough of safety layers to
allow recovering from these events, but the previous code wasn't
prepared for any kind of recovery.  The Win32 change for this still
has to be done, and the traditional drivers need to be converted to
exit(1) upon encountering a timeout (as they're now getting a -1
returned they didn't see before in that case).


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@451 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 19:17:12 +00:00
Brian S. Dean bcd52759b1 Exit non-zero if safe-mode reverts fuse bits that were requested on
the command-line.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@450 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-11 19:03:53 +00:00
Brian S. Dean d3e4b0db14 Variable declarations must only appear at the beginning of a block.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@449 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-10 18:37:37 +00:00
Brian S. Dean 20e4d85bd9 Document -u option to disable safe mode.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@448 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-10 18:03:32 +00:00
Brian S. Dean 5ee1bc4c34 Style police: white space only change; consistent indentation, wrap
long lines to < 80 columns.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@447 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-10 16:34:55 +00:00
Brian S. Dean 94c0dd6377 doc/Makefile is now dependent on whether or not doc is enabled.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@446 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-10 15:39:42 +00:00
Brian S. Dean d0b33a875e Patch to disable the doc build by default; the tools needed to build
doc are either not available on all systems or are at best
inconvenient to build and install.  The doc can still be built, one
just needs to specify --enable-doc at configure time.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@445 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-10 14:54:57 +00:00
Eric Weddington 32fd29e8c1 Entry for new Safe Mode feature.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@444 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-01-24 21:35:52 +00:00
Eric Weddington c8f18db55e Document new Safe Mode feature and switch.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@443 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-01-24 21:26:14 +00:00
Eric Weddington 70db5c5e85 New file. Safe Mode support.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@442 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-01-24 21:26:13 +00:00
Eric Weddington b368e439c9 Add new files, safemode.c, safemode.h
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@441 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-01-24 21:26:12 +00:00
Eric Weddington ffbc10401f Add Safe Mode. Fuse settings will be restored at the end of a programming session unless the -u switch is specified.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@440 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-01-24 21:26:11 +00:00
Brian S. Dean fb99d19d96 Replace my e-mail address with my url when displaying copyright
information.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@439 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-12-22 02:06:13 +00:00
Brian S. Dean 6249f94515 Update code copyrights.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@438 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-12-22 01:52:45 +00:00
Brian S. Dean 9a0e4afb9a Add support for "Xilinx JTAG cable".
Contributed by: Tymm <tymm@booyaka.com>


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@437 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-12-22 01:30:30 +00:00
Brian S. Dean 15a0e05a7b Add support for the AT90CAN128. Not sure if all the instruction
encoding is correct, specifically the address bits don't exactly match
those of the preliminary datasheet that I have, but I don't see how
they could be right.  Tested with STK500 and it works there.
Instruction encodings have not been tested due to lack of a parallel
port on my Mac.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@436 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-12-22 01:24:39 +00:00
Theodore A. Roth 678d5c8248 * avrdude.1: Remove reference to ppi programmer schematic.
* configure.ac (AC_INIT): Set version to "4.4.0cvs".


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@435 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-19 22:09:09 +00:00
Theodore A. Roth bcf113ca8d * Makefile.am (EXTRA_DIST): Remove avrdude.pdf since it is no longer supplied.
* NEWS: Fix typo.
* bootstrap: Delete the autom4te.cache dir before running the autotools.
* configure.ac (AC_INIT): Set version to 4.4.0.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@433 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-19 06:10:43 +00:00
Brian S. Dean 7da7ada5ba Make a note about now having MacOS X support.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@432 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-18 14:09:41 +00:00
Jan-Hinnerk Reichert 2325a7e129 avrdude.1: Fixed obvious copy and paste error (Patch #3199 contributed by Galen Seitz)
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@431 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-17 15:41:36 +00:00
Theodore A. Roth 5b7f00e024 * main.c (main): Don't indent CPP directives.
When showing update progress in a no tty situation, use unbuffered IO
for all systems, not just win32 native.
Update copyright year when printing version.
Remove warning about native win32 being experimental.
Split a line string.
* ppiwin.c: Update copyright year.
Add cvs Id keyword.
(usleep): Cleanup debug CPP directives to improve readability.
* ser_win32.c: Include <stdio.h> to fix failing build.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@430 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-15 17:29:35 +00:00