Commit Graph

504 Commits

Author SHA1 Message Date
Joerg Wunsch 749c20d5d1 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@481 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-07-25 19:52:20 +00:00
Joerg Wunsch 21b946baa5 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@480 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-20 18:15:13 +00:00
Joerg Wunsch 069e3d4a2b 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@479 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-20 18:12:04 +00:00
Joerg Wunsch 4d9e862ef0 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@478 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-19 21:38:03 +00:00
Joerg Wunsch 7dea3d5801 According to the part description XML file, set AllowFullPageBitStream for
the AT90CAN128 to "no".


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@477 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-15 04:46:12 +00:00
Joerg Wunsch f6b3053f39 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@476 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-14 21:44:34 +00:00
Joerg Wunsch f83a8bb29d Add support for the ATmega164/324/644.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@475 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-14 20:18:42 +00:00
Joerg Wunsch 615054330b 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@474 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-13 21:24:06 +00:00
Joerg Wunsch e889417afb 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@473 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-06-11 21:27:09 +00:00
Joerg Wunsch 949a24ec44 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@472 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-27 12:15:28 +00:00
Joerg Wunsch c51374cfe2 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@471 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-19 04:49:46 +00:00
Brian S. Dean 8387b93696 Update version after tagging the beta release.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@470 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 15:53:00 +00:00
Brian S. Dean 143ee7d79d Catch up on my updates.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@468 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 15:22:31 +00:00
Brian S. Dean 3e222a978a Update version and copyright message.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@467 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 14:56:00 +00:00
Brian S. Dean e7ee18fa4b 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@466 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 14:49:39 +00:00
Joerg Wunsch b141abc41f Umm, add the new programmer types to the texinfo documentation as well.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@465 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 08:06:18 +00:00
Joerg Wunsch b6d759569a Add a ChangeLog entry for all the STK500v2 and JTAG ICE mkII modifications.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@464 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 07:57:58 +00:00
Joerg Wunsch 025e464387 Add an "jtag2fast" programmer that connects to the JTAG ICE at 115200 Bd.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@463 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-14 07:57:24 +00:00
Joerg Wunsch e10928ada9 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@462 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 20:48:05 +00:00
Joerg Wunsch 039fe615c0 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@461 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 20:06:23 +00:00
Joerg Wunsch 6757ebee57 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@460 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 17:09:22 +00:00
Joerg Wunsch 5cc4ed40bd 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@459 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 17:00:11 +00:00
Joerg Wunsch 6af6fe9b3a 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@458 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 16:58:12 +00:00
Joerg Wunsch 6d05dfda8c 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@457 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 21:06:44 +00:00
Joerg Wunsch df37b7faf5 I missed to commit the allowfullpagebitstream attributes.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@456 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 21:04:55 +00:00
Joerg Wunsch 083406de7c Properly close commend in $ Id $.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@455 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 20:58:45 +00:00
Joerg Wunsch c136e38a1d serial_setattr() has been renamed to serial_setspeed().
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@454 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 20:57:52 +00:00
Joerg Wunsch da412d2274 Oops, more files I forgot to add during the last commit.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@453 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 19:53:56 +00:00
Joerg Wunsch 546761708d 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@452 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 19:43:44 +00:00
Joerg Wunsch 872f75d4fb 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@451 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-10 19:17:12 +00:00
Brian S. Dean c8b9561f1e 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@450 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-11 19:03:53 +00:00
Brian S. Dean 8a2d4aa7f2 Variable declarations must only appear at the beginning of a block.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@449 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-10 18:37:37 +00:00
Brian S. Dean e77bacaac6 Document -u option to disable safe mode.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@448 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-10 18:03:32 +00:00
Brian S. Dean 3ad88ee11c Style police: white space only change; consistent indentation, wrap
long lines to < 80 columns.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@447 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-10 16:34:55 +00:00
Brian S. Dean aa3b5ee436 doc/Makefile is now dependent on whether or not doc is enabled.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@446 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-10 15:39:42 +00:00
Brian S. Dean 978b2bfa3b 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@445 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-02-10 14:54:57 +00:00
Eric Weddington c3e97730b0 Entry for new Safe Mode feature.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@444 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-01-24 21:35:52 +00:00
Eric Weddington 4b5a5be064 Document new Safe Mode feature and switch.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@443 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-01-24 21:26:14 +00:00
Eric Weddington 9482eea8b6 New file. Safe Mode support.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@442 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-01-24 21:26:13 +00:00
Eric Weddington a11bc3dd8f Add new files, safemode.c, safemode.h
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@441 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-01-24 21:26:12 +00:00
Eric Weddington 27e53d7aac 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@440 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-01-24 21:26:11 +00:00
Brian S. Dean c5cfb14c31 Replace my e-mail address with my url when displaying copyright
information.


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


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@437 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-12-22 01:30:30 +00:00
Brian S. Dean 5f5919e607 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@436 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-12-22 01:24:39 +00:00
Theodore A. Roth 6bf083fdb3 * 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@435 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-19 22:09:09 +00:00
Theodore A. Roth fd510f0056 * 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@433 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-19 06:10:43 +00:00
Brian S. Dean d527d692f4 Make a note about now having MacOS X support.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@432 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-18 14:09:41 +00:00
Jan-Hinnerk Reichert 15ec4ccfa6 avrdude.1: Fixed obvious copy and paste error (Patch #3199 contributed by Galen Seitz)
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@431 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-17 15:41:36 +00:00
Theodore A. Roth 7fc5e2a7c2 * 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@430 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-15 17:29:35 +00:00