Commit Graph

473 Commits

Author SHA1 Message Date
bdean f96a7a09c1 I thought I had already committed this but I don't see it in CVS.
This fixes EEPROM access using the STK500V2 programmer, partially
undoing part of a previous general fixup commit.  Choose the correct
read/write operations with the stk500v2 program function - the correct
one depends on the memory type.  EEPROM is byte addressable so uses
read/write.  FLASH is word addressable and so uses read_lo/write_lo.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@501 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-16 21:23:14 +00:00
joerg_wunsch 61f6a06038 avrdude.1: document the memtypes for -U
doc/avrdude.texi: (Ditto.)
Closes bug #13501: <memtype> should be listed in the man page


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@500 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-16 20:38:29 +00:00
joerg_wunsch 8ae17ae42a * doc/Makefile.am: add logic to detect the misf^H^H^H^H
gratitous API change in recent versions of texi2html where
the output directory has changed names.
Fix for:
bug #13026: The build fails with texi2html 1.76
bug #12715: make issues during install
patch #3091: commandline fix for latest version of texi2html


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@499 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-16 20:18:37 +00:00
joerg_wunsch cc09dd7878 * jtagmkII.c (jtagmkII_paged_load): return the number of bytes read.
This makes EEPROM block reads work again.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@498 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-16 15:52:28 +00:00
joerg_wunsch cf046b8f9d * usb_libusb.c (usbdev_drain): actually implement draining to aid
synchronizing against a JTAG ICE in weird state.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@497 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-16 15:01:52 +00:00
joerg_wunsch 29310a6f20 Improve the initializion sequence of the butterfly so it is more likely
to synchronize with the device.

bug #9787 overview: avrdude 4.4.0 correct butterfly interface


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@496 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-16 14:54:55 +00:00
joerg_wunsch f3c545ffc3 Make "jtag2" an alias for "jtag2fast", people will certainly love it
that way. ;-)  For those who want the 19200 Bd one, add "jtag2slow".


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@495 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-14 19:49:27 +00:00
bdean 88da9ed79e Change bit 0 of the ATmega169 efuse 'write' opcode from 'x' (ignore)
to 'i' (input).  Even though this bit should be ignored, it should not
be changed.  The 'x' setting sets the bit to zero which programs it
and could cause undefined behaviour.  Setting to 'i' enables it to be
rewritten to its old value.

A better solution might be to read the fuse byte, apply the new value
while leaving the 'x' bit alone, then writing the value back.  The
current fix is a workaround which allows the developer to change the
bit.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@494 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-14 02:11:49 +00:00
joerg_wunsch 2b42f59641 Add Brian's ChangeLog entry for the warning cleanup.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@493 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-08-30 04:47:23 +00:00
joerg_wunsch 0f725dd0b0 Consitently use unsigned char for buffers to avoid warnings.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@492 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-08-30 04:44:29 +00:00
bdean 20f3be439c Eliminate compiler warnings. GCC 4.x elicits many signedness warnings
when passing unsigned char * when char * is in the prototype and vice
versa.  Clean these up along with a few others.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@491 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-08-30 01:30:05 +00:00
bdean 89e890aacd This is patch # 4338, obsoletes patch #4327, provides fixes for bugs
#13693, #13871, and #14212.

This provides bug fixes to the STK500V2 programmer type.  From the
patch information:

    - incorrect token used from avrdude.conf.in

    - wrong command sent to programmer, hence no write to eeprom.

    - programmer was said to start writing at 0x0000 and continue page
      by page and was not repositionned when a gap was found in the
      hex file, or when the hex file start address was not
      0x0000. Hence the verify procedure was correct, not the write
      procedure.

    - speed up of flash write to skip empty pages (full of 0xFF) by
      re-enabling a dedicated function for that task.

    - stk500v2_paged_load() was not returning the number of byte read,
      so empty hex files were generated when reading memory.

Submitted by:  Bernard Fouch <bernard.fouche@kuantic.com>


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@490 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-08-28 22:23:35 +00:00
joerg_wunsch 4bd79b2880 Add support for the ATtiny25/45/85. Note that only the ATtiny45
appears to have a complete XML description right now.

Document all the recently added new devices: AT90PWM2/3,
ATmega164/324/644, ATmega329x/649x, ATtiny25/45/85.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@489 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-08-28 19:37:59 +00:00
joerg_wunsch a43322176d Fix the EEPROM sizes for the ATmega329x/649x devices. I somehow got them
twice initially.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@488 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-08-17 19:40:21 +00:00
joerg_wunsch 82854b3ec2 Add support for the AT90PWM2/3. The XML files don't appear to list
all the details right now, so some of the parameters are guessed.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@487 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-08-16 19:34:56 +00:00
joerg_wunsch eed121e91f Extend the butterfly code to fully support AVR109 boot loaders. Notable
changes to butterfly.c include:

. do not exit for unsupported devices but return -1 from the init function
  instead; that way the -F option can be used to continue anyway

. honor the -b option as arbitrary bootloaders could be implemented with
  any baud rate, not just the fixed 19200 Bd used by the butterfly

. implement functionality to read the fuse and lock bits, and write the
  (boot) lock bits, resp.

. fix the signature byte order

The remaining files document the new functionality.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@486 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-07-28 16:06:35 +00:00
bdean 6773b66a8d Note my last few changes.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@485 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-07-26 05:04:12 +00:00
bdean ce1835ded4 Remove some debug code accidentally left in.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@484 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-07-26 04:59:50 +00:00
bdean c844bd1236 Don't call exit() directly here - set the exit value and jump to the
main_exit: label to ensure the programmer is released correctly.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@483 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-07-26 04:13:34 +00:00
bdean 301eaff2d6 The stk500v2_getsync() function was improperly checking for success,
thus it was falsely reporting that it failed when it was actually
working correctly.  Fixed.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@482 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-07-26 02:56:29 +00:00
joerg_wunsch 4c60d60f86 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 aa61cc4b61 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 888273589d 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 2d236ed812 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 efc820b82d 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 9049b590bd 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 57c42005c6 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 2bf1b6b9f4 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 ce34239c67 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 09d754b9fd 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 3b22cb93c0 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
bdean 9f765f7456 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
bdean 2beb8a519e 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
bdean c37cefab01 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
bdean e457898255 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 060f870bfe 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 eeb81df4ff 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 cac225a77b 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 69aff1ca91 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 6ba0f493b4 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 d2825e00fd 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 e44b866716 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 f827a94c0f 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 bc4ae31394 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 bfa4540470 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 549f513be8 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 c2ff04d554 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 9839579e66 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 6a9cf16c41 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 b49dc8f645 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