Commit Graph

98 Commits

Author SHA1 Message Date
joerg_wunsch d32c587511 Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
patch #9507: Fix UPDI chip erase
* libavrdude.h (PROGRAMMER): add unlock method
* avr.c (avr_unlock): Generic unlock function
* jtag3.c: Implement unlock feature; avoid calling
jtag3_edbg_prepare() and jtag3_edbg_signoff() on XplainedMini
boards to work around a bug in early firmware versions;
implement "userrow" memory region
* main.c: Call avr_unlock() rather than avr_chip_erase() when
encountering a locked UPDI chip



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1417 81a1dc3b-b13d-400b-aceb-764788c761c2
2018-01-16 21:17:04 +00:00
joerg_wunsch dd7ee6507b Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
patch #9507: Fix UPDI chip erase
* lexer.l (family_id): New keyword.
* config_gram.y: (Ditto)
* doc/avrdude.texi: Document new keyword
* avrdude.conf.in: Add family_id for avr8x devices
* avr.c: Pass error code up.
* jtag3.c: Pass error code from memory read up; implement
jtag3_read_sib()
* libavrdude.h: Add new items.
* main.c: Implement different chip erase handling required
for UPDI devices.

Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
patch #9506: Script to create device configuration stub from Atmel ATDF files
* avrdude.conf.in (ATtiny202, ATtiny204, ATtiny402, ATtiny404)
(ATtiny406, ATtiny804, ATtiny806, ATtiny807, ATtiny1604)
(ATtiny1606, ATtiny1607, ATtiny212, ATtiny214, ATtiny412)
(ATTiny414, ATtiny416, ATtiny417, ATtiny814, ATtiny816)
(ATtiny1614, ATtiny1616, ATtiny3214, ATtiny3216, ATtiny3217)
(ATmega3208, ATmega3209, ATmega4808, ATmega4809): New devices




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1405 81a1dc3b-b13d-400b-aceb-764788c761c2
2018-01-09 23:29:31 +00:00
rliebscher cd14f1f2f5 bug #40142 Floating point exception on Ubuntu 10.04
* avr.c: avoid division by zero in report_progress(), eg. when 
  writing an empty eeprom file were total becomes 0

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1340 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-11-14 10:22:52 +00:00
awachtler bb48be1ac0 added verbose level in avrdude_message()
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1321 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-06-13 20:07:40 +00:00
joerg_wunsch 5c2c6eaa88 Join the former "public" header files (avr.h avrpart.h pindefs.h
serial.h fileio.h safemode.h update.h pgm_type.h config.h confwin.h
lists.h) into a single header that can be included by anyone wanting
to link against the library.

Adapt everything to cope with this situation.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1311 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-05-19 10:01:59 +00:00
awachtler 7b43620402 Exchange of fprintf(stderr, ...) with avrdude_message(...).
This change was made for the shared library, since library functions
should not write to std-streams directly. Instead avrdude_message()
has to be implemented by the library user. For the avrdude application
this function is implemented in main.c.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1305 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-05-18 08:41:46 +00:00
joerg_wunsch 8a8efb3f1d Fix counting pages for the non-verify read case. Previously,
yielded 0, resulting in a division by 0 in report_progress().


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1221 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-13 12:48:13 +00:00
joerg_wunsch 27389d23bf bug #35456 The progress bar for STK500V2 programmer is "wrong".
* avr.c (avr_read, avr_write): Change the progress reporting for
paged read/write from per-address to per-considered-page.  This
ought to give a realistic estimation about the time still to be
spent.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1220 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-13 09:42:47 +00:00
joerg_wunsch ad15b61b0b Remove the erase cycle counter (options -y / -Y).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1203 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-03 20:13:37 +00:00
joerg_wunsch 8426fe578c Fix all "unused variable" warnings that were encountered.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1200 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-03 11:05:13 +00:00
rliebscher ec5ea1e863 check more error codes, fixed some leftover parts which still used MPSSE even when using bitbanging, reduced blocksize to get a more stable behaviour of bitbanging
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1185 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-06-20 20:11:49 +00:00
hweisbach b1eab6f93c avr.c: Adds avr_tpi_program_enable
Generic function enabling external programming on TPI devices. This
function sets the required guard time (which is passed in as parameter),
checks the TPI identification register, writes SKEY command + SKEY, and
finally polls the NVMEN bit in TPISR.

avr.h: Add prototype definitions of avr_tpi_program_enable() and
avr_tpi_chip_erase().
avrftdi_tpi.c: Removes tpi_skey_cmd array, containing the SKEY command
and the SKEY bytes.
tpi.h: Adds tpi_skey_cmd array, containing the SKEY command and the SKEY
bytes, but in the reverse order of tpi_skey.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1167 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-06 12:49:26 +00:00
hweisbach d46b2e880c avr.c: Add generic TPI chip erase function
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1166 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-06 12:43:47 +00:00
hweisbach 9c6c6d2f59 avr.c: Fix avr_tpi_poll_nvmbsy() polling returned data instead return
code

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1155 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-02 11:07:30 +00:00
joerg_wunsch 8fdf4d4071 Replace outdated FSF postal address by a reference to
the GPL info on their website.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1107 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-20 14:03:50 +00:00
joerg_wunsch 3fbb7642d2 Xmega page erase implementation for JTAGICEmkII
* jtagmkII.c: Handle flash pages sizes > 256 bytes, implement
page_erase() method
* avrdude.conf.in: Change flash pagesize for all Xmega devices
to 512 bytes
* avr.c: Implement auto_erase, using page_erase if available
* avr.h: Remove unused parameters from avr_read(), replace
unused parameter in avr_write)() by auto_erase
* stk500v2.c: Handle flash page sizes > 256 bytes
* update.c (do_op): Handle new updateflags parameter
* main.c: Implement auto_erase as page_erase if possible
* update.h (enum updateflags): New enum
* pgm.h (struct programmer_t): Add page_erase method



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1089 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-05-04 10:02:30 +00:00
joerg_wunsch 069fb58779 bug #30451: Accessing some Xmega memory sections gives not
supported error
* stk500v2.c: Handle all Xmega memory sections (except
"prodsig" which is not documented in AVR079)
* fileio.c: Treat the "boot", "application", and "apptable"
regions (which are actually subregions of "flash") all as
being flash, i.e. suppress trailing 0xFF bytes when reading
them
* avr.c: (Dito.)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1075 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-03-29 14:32:18 +00:00
rliebscher d342905ecb * avr.c: Unsigned variable was used for return code of paged_write/load
functions. So a negative return code led never to a fallback to byte
  functions.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1042 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-01-19 20:06:52 +00:00
joerg_wunsch a8e82b7e49 * avr.c (avr_read, avr_write): Don't bail out on TPI parts if
their programmer doesn't provide a (low-level) cmd_tpi method;
instead, fall back to the normal programmer methods which are
supposed to handle the situation.
This fixes a regression where the recent bitbang-TPI implementation
broke TPI handling of STK600/AVRISPmkII.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1008 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-09-15 11:15:06 +00:00
joerg_wunsch 95a42e16d5 Mega-commit to bring in memory tagging.
Each memory image byte is now tagged as it's being read from a file.
Only bytes read from a file will be written or verified (modulo page
granularity requirements).



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1007 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-09-14 21:49:42 +00:00
joerg_wunsch a4c8ac47bb bug #34027: avrdude AT90S1200 Problem (part 1 - bitbang
programmers)
* config_gram.y: Introduce new keyword "is_at90s1200".
* lexer.l: (Ditto.)
* avrdude.conf.in: Applew new keyword to the AT90S1200 device.
* avrpart.h: Introduce new flag AVRPART_IS_AT90S1200, reflecting
the is_at90s1200 configuration keyword.
* bitbang.c (bitbang_initialize): Replace existing test for
AT90S1200 by AVRPART_IS_AT90S1200
* avr.c (avr_write_byte_default): Avoid the pre-write reading for
the AT90S1200, as this appears to sometimes corrupt the high byte
by pre-programming the low byte just written into it.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1002 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-08-29 09:25:04 +00:00
joerg_wunsch be5fe6bf70 Add Darell's email address, so it's consistent with the other authors.
Add the forgotten tpi.h file.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@978 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-08-24 07:40:48 +00:00
joerg_wunsch 6431eece98 Submitted by Darell Tan:
patch #7244: TPI bitbang implementation
* bitbang.c: Add TPI bitbang stuff.
* bitbang.h: (Ditto.)
* avr.c: (Ditto.)
* avr.h: (Ditto.)
* pgm.c: (Ditto.)
* pgm.h: (Ditto.)
* serbb_posix.c: Wire bitbang_cmd_tpi into the struct pgm.
* serbb_win32.c: (Ditto.)
* par.c: (Ditto.)
* doc/avrdude.texi: Document the TPI bitbang support.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@976 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-08-23 21:03:36 +00:00
joerg_wunsch 814ff25d79 Various fixes for Xmega devices.
* avrdude.conf.in: Correctly declare EEPROM page sizes for
all Xmega devices (0x20 instead of 0x100).
* avr.c: If a memory region has a page size declared, try
using the paged IO routines regardless of the target memory
name.  Xmega EEPROM requires to be written in paged mode.
Correctly use a long (rather than unsigned long) variable to
evaluate the success status of the paged mode write attempt.
* stk500v2.c: Don't apply TIF space offsets twice (bug #27995:
AVRDUDE 5.8svn fails to program and read XMEGA); use
stk500v2_loadaddr() prior to paged mode (EEPROM and flash) writes,
otherwise programming of flash areas will fail; while being there,
check the return value of stk500v2_loadaddr() everywhere; use the
correct write/erase mode bits (same as AVR Studio does).



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@907 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-12 15:42:40 +00:00
joerg_wunsch 366db1ab6e Contributed by Zoltan Laday:
patch #6825: xmega problems with JTAGICEmkII
* jtagmkII.c: Many fixes for Xmega devices.
* jtagmkII_private.h: Add various new constants required for
Xmega devices.
* avrdude.conf.in: New devices: ATXMEGA64A1, ATXMEGA192A1,
ATXMEGA256A1, ATXMEGA64A3, ATXMEGA128A3, ATXMEGA192A3,
ATXMEGA256A3, ATXMEGA256A3B, ATXMEGA16A4, ATXMEGA32A4,
ATXMEGA64A4, ATXMEGA128A4
* avr.c (avr_read, avr_write): Add more names for (Xmega)
memory areas that require paged operation.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@821 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-06-24 21:32:12 +00:00
joerg_wunsch 15fc8af421 First implementation of ATxmega support. By now, only the
PDI mode of the STK600 is supported.  Single-byte EEPROM
(and flash) updates do not work yet.
* avr.c: "boot" memory is a candidate memory region for paged
operations, besides "flash" and "eeprom".
* avrdude.conf.in: add ATxmega128A1 and ATxmega128A1revD
* avrpart.h: add the AVRPART_HAS_PDI flag (used to distinguish
ATxmega parts from classic AVRs), the nvm_base part field, and
the offset field for a memory region.
* config_gram.y: add "has_pdi", "nvm_base", and "offset"
* lexer.l: (Ditto.)
* main.c: disable auto_erase for ATxmega parts
* stk500v2.c: implement the XPROG functionality, and divert to
this for ATxmega parts
* avrdude.1: Document the changes.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@777 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-07-26 22:53:40 +00:00
joerg_wunsch 036bfc95b5 In avr_read() and avr_write(), only use the paged_load and
paged_write backend functions iff the memory area in question has
a page_size != 0.

This is supposed to fix bug #19234: avrdude-5.3.1 segfaults when
stk500v1 tries to program an ATtiny15


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@739 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-05-16 20:15:13 +00:00
joerg_wunsch 07c1079415 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/avrdude@722 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-24 22:43:46 +00:00
joerg_wunsch 1cae809b9b 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/avrdude@721 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-24 21:07:54 +00:00
joerg_wunsch 6cd309f1c0 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/avrdude@696 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 14:06:52 +00:00
joerg_wunsch 4beee5ff79 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/avrdude@695 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 14:01:54 +00:00
joerg_wunsch aef8e953ab 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/avrdude@692 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-23 07:02:22 +00:00
joerg_wunsch 351f329ec8 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/avrdude@684 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 15:04:09 +00:00
joerg_wunsch 3df4c5f888 * 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/avrdude@622 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-22 22:05:19 +00:00
joerg_wunsch ebdce5f3ef Start implementing support for ATmega256x;
jtag2 and bitbang programmers are working, stk500v2
still needs to be done.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@581 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-05-23 22:27:43 +00:00
bdean df27d4e06a All declarations need to be at the top of the block.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@520 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-21 01:26:54 +00:00
bdean d53e6d7b25 This is Colin O'Flynn's mega patch for updating safemode support:
* add support for parts with just 'fuse' memory

    * if any fuse memories are altered, reflect those changes in the
      post-programming safemode check so that safemode no longer
      complains about fuses which were intentionally altered; this
      eliminates the need to completely disable safemode using -u in
      order to program fuses.

    * provide -s option which will not ask to restore fuses, it will
      just do it

Submitted by: Colin O'Flynn <coflynn@newae.com>


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@519 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-21 00:20:32 +00:00
bdean e4f8608da4 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
hinni 10272c5a55 Removed unnecessary includes of config.h
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@426 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-05 15:04:19 +00:00
hinni 2a725d152f *main.c,avr.c,avr.h,par.c,stk500.c: Add function avr_chip_erase() to unify handling of cycle-count. Makes cycle-count work for avr910-programmers
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@394 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-01-03 18:04:54 +00:00
hinni c5d2aafb12 *avrpart.c,avr.c: Moved elementary functions on types OPCODE, AVRMEM and AVRPART from avr.c to new file avrpart.c
*avr.h: Removed prototypes for moved functions
*avrpart.h: Added prototypes for functions in avrpart.c
*Makefile.am: Added new file avrpart.c


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@388 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-11-30 16:42:10 +00:00
troth a8b0ee3820 * avr.c (avr_write_byte_default): Improve polling algorithm to speed up
programming of byte oriented parallel programmers.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@380 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-11-19 18:11:59 +00:00
troth 3827320f15 * avr.c (avr_read_byte): If pgm->read_byte method fails, retry with
avr_read_byte_default.
* avr.c (avr_write_byte): If pgm->write_byte method fails, retry with
avr_write_byte_default.
* avr910.c (avr910_cmd): Implement using universal command.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@364 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-09-05 16:40:55 +00:00
troth 5bf7290268 * avr.c:
* avr.h:
* avr910.c:
* main.c:
* stk500.c:
New progress reporting implementation.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@337 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-07-29 22:08:21 +00:00
bdean 945358b4b3 Optimize flash memory handling a little bit by ignoring 0xff data that
resides above the last non-0xff data value in the address space.  Only
do this for flash memory since writing a 0xff to flash is a no-op.
This has the affect of creating smaller output files when dumping
memory contents from flash if the program in flash does not consume
the whole memory space.  It also results in shorter programming times
when avrdude is asked to load a file into flash that has lots of 0xff
filled data past the last non-0xff data value.

I think this is basically where Alexey was going with his s-record
routine, but this should have a similar affect for all the I/O
routines.  The main difference is that Alexey's also optimized 0xff
from the beginning of the address space and was not limited to flash.

I think that these optimizations should be limited to the flash since
it is currently the only memory that treats 0xff as special.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@331 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-05-22 02:33:17 +00:00
troth 5e3a9fc279 * avr.c (avr_write): Add call to pgm->write_setup() before the write loop.
* avr910.c: Change all show_func_info() calls to no_show_func_info().
Add read/write to/from flash/eeprom memory functionality.
* pgm.c: Initialize pgm->write_setup.
* pgm.h: Add write_setup field to PROGRAMMER structure.
* ser_posix.c: Remove unneeded cast in verbosity code.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@299 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-03-24 07:09:16 +00:00
troth 3a85c3c92a * avr.c: Add avr_read_byte_default().
Have avr_read_byte() call pgm->read_byte() or avr_read_byte_default().
Add avr_write_byte_default().
Have avr_write_byte() call pgm->write_byte or avr_write_byte_default().
* pgm.c: Initialize pgm->write_byte and pgm->read_byte.
* pgm.h: Add write_byte and read_byte fields to struct programmer_t.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@296 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-03-23 23:22:50 +00:00
troth 58f2a417cb * avr.c (avr_read): Use pgm->read_sig_bytes to read signature bytes if
available.
* avr910.c (avr910_vfy_cmd_sent): New function.
(avr910_chip_erase): Add support for chip erase.
(avr910_enter_prog_mode): New function.
(avr910_leave_prog_mode): New function.
(avr910_initialize): Add code to select device type and enter prog mode.
(avr910_close): Leave programming mode before closing serial port.
(avr910_read_sig_bytes): New function.
(avr910_initpgm): Add avr910_read_sig_bytes method to pgm initializer.
* avrdude.conf.in: Add note about deprecating devicecode.
Change all occurences of devicecode to stk500_devcode.
Add avr910_devcode to a few parts for testing.
* avrpart.h (struct avrpart): Change devicecode field to stk500_devcode.
(struct avrpart): Add avr910_devcode field.
* config_gram.y: Add K_STK500_DEVCODE and K_AVR910_DEVCODE tokens.
Generate an error if devicecode is found in the config file.
Handle parsing of avr910_devcode and stk500_devcode.
* lexer.l: Handle parsing of avr910_devcode and stk500_devcode.
* pgm.c: Initialize pgm->read_sig_bytes field.
* pgm.h: Add pgm->read_sig_bytes field.
* stk500.c: Use stk500_devcode instead of devicecode.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@293 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-03-17 06:20:02 +00:00
bdean 86dbad54c5 Fix stk500 page write (Program Page command). This is supported after
all on non-paged-memory parts.  The problem was that the page size was
defaulting to 256 (maximum for the stk500), but the timeout for a
response from the stk500 before declaring it dead was only 0.5
seconds.  But it takes much longer than 0.5 seconds to program 256
bytes, so we just weren't waiting long enough.

Fix this in two ways - increase the timeout to 5 seconds, and decrease
the page size to 16 bytes for non-paged parts.  The programming time
for 16 bytes is short enough to provide the user with some feedback
that something is happening.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@260 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-03-05 04:30:20 +00:00
bdean 6e9bdf2a6e Don't call the programmer's 'paged_write' routine unless the memory
itself is paged as it doesn't appear to work otherwise.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@259 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-03-05 02:35:50 +00:00