Commit Graph

88 Commits

Author SHA1 Message Date
hinni 3ee1be5529 * pgm.[ch], main.c, par.c, avr910.c, butterfly.c, stk500.c:
Move save/restore-functionality into open/close.
	* par.c: open/close now saves/restores PPICTRL, too.
	* TODO: exitspecs don't work if RESET is in PPICTRL.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@407 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-01-28 20:01:44 +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 cdd82f5dfc *avrpart.c,main.c: Moved list_parts() and locate_part() from main.c to avrpart.c
*avrpart.h: Added prototypes for list_parts() and locate_part()


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@389 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-11-30 16:49:00 +00:00
joerg_wunsch 9dd5e43b20 Make the -U parser tolerate colons in filenames.
Document the change, including changing one of the texinfo examples
to use a Windows-like filename that contains a space (and thus
requires quoting).

This fixes bug #6764.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@386 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-11-26 22:05:02 +00:00
bdean 0b71c0672c Revert to honoring the return code from pgm->pgm_enable() within the
stk500 initialization routine.  However, allow one to use the -F
option to ignore a bad return code from that function.  I think this
still allows what Joerg intended, i.e., providing a way to still get
into terminal mode so that one can recover from setting bad STK500
values which may keep the chip from entering programming mode.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@359 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-08-31 15:40:59 +00:00
bdean 776104ea0c Perform an auto erase before programming if the flash memory is
anywhere specified to be written by any of the -U requests.

To remain backward compatible with previous versions, disable this
feature if any of the old-style memory specification operations are
specified (-i, -o).

Implement the -D option to explicitly disable the auto erase default.

Deprecate the old-style memory specification options (-f, -i, -I, -m,
and -o) in favor of the new -U option which allows one to operate on
multiple memories on a single command line.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@356 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-08-29 23:17:32 +00:00
bdean 1de16c56ed Declare size and vsize as 'int'. These represent the size of the AVR
memory read or written (or up to where continuous 0xff begins in the
case of flash memory).  An 'int' should be plenty big enough for that.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@354 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-08-29 00:14:22 +00:00
arcanum 51a3d56245 * avr910.c:
* fileio.c:
    * main.c:
    * stk500.c:
    More code cleanup to remove warnings.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@352 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-08-28 23:02:25 +00:00
bdean 386f8f19db Fix placement of local variable - variables must be declared before
any statements within a block.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@349 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-08-28 13:52:52 +00:00
troth 1abe56733f * main.c (update_progress_no_tty): Properly terminate progress. Also
fixes stk500 problem where number of bytes written is less than a page.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@348 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-08-28 05:37:57 +00:00
arcanum c9a242e254 * fileio.c:
* main.c:
    * ppiwin.c:
    * ser_posix.c:
    * stk500.c:
    Minor code cleanup to remove warnings.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@346 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-08-25 15:55:48 +00:00
bdean 6183fc22a2 Remove debugging printf.
Update manual to reflect the new -U option.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@342 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-08-24 18:05:46 +00:00
bdean eecf43999d Introduce a new option, -U, for performing memory operions. Its
argument is a 4 field string (fields seperated by colons) which
indicate what memory type to operate on, what operation to perform is
(read, write, or verify), the filename to read from, write to, or
verify against, and an optional file format field.  Multple -U options
can be specified to operate on more than one memory at a time with a
single invocation.  For example, to update both the flash and the
eeprom at the same time one can now specify the following:

	avrdude -p -e -U flash:w:main.hex:i -U eeprom:w:eeprom.hex:i


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@341 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-08-21 04:52:36 +00:00
bdean d6287689c1 Add elapsed time information to the new progress bar.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@338 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-07-30 23:01:52 +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 a44054650f fileio.c : Remove superfluous assignment of 'fname'.
main.c : print out '<stdin>' and '<stdout>' instead of '-' when using
         stdio for I/O.

Thanks to Francisco T. A. Silva <ftas@geodigitus.com.br> for catching
this, and the error fixed by the previous commit as well.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@325 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-05-07 22:13:46 +00:00
bdean 98d1f804ae unbreak '-i' option argument
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@320 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-04-19 23:31:51 +00:00
bdean fa3d83df02 Add a shortcut option, '-I' which is the same as '-i' but defaults the
file format type to 'immediate mode' where the filename is assumed to
be the memory data itself.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@318 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-04-19 23:06:01 +00:00
bdean 7007ab14ba Implement and "immediate mode" for file input - this allows one to
specify byte values on the command line instead of via a file.  This
can be good for specifying fuse bytes and eliminates the need to
create single-byte files or using interactive terminal mode for these
single-byte memories.  Requested by several folks on the mailing list.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@317 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-04-19 18:41:35 +00:00
troth ae3f4e852f * avrdude.conf.in: Add avr910 and pavr programmers.
* config_gram.y: Add parsing of avr910 programmer.
* lexer.l: Add avr910 token.
* avr910.c: [this is still work in progress]
Add some debug output.
Add probe for programmer presense.
* main.c: Set port to default_serial if programmer type is avr910.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@292 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-03-16 18:19:37 +00:00
bdean ee96643119 Get rid of a debugging printf.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@280 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-03-12 00:06:45 +00:00
arcanum 1b9666eff4 Change software version from hardcoded value to getting it from the configuration.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@269 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-03-06 19:18:40 +00:00
bdean 02aa33e2a4 Check the programmer type against 'STK500' instead of the programmer
name when checking to see if we should default to the default_serial
port instead of the default_parallel port.  This has us do the right
thing for the new 'avrisp' programmer.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@262 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-03-05 04:57:03 +00:00
bdean 174397969c Print out a list of valid parts for '-p ?' and a list of valid
programmers for '-c ?'.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@254 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-03-05 00:53:49 +00:00
arcanum aac7d66784 Integrate Windows search of config files.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@231 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-24 23:13:55 +00:00
arcanum 1ff068469e Usage back to stderr.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@224 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-24 17:27:38 +00:00
bdean 66d2a710db Add the ability to read a per-user config file located at
$HOME/.avrduderc.  Entries from .avrduderc take precedence over those
from the system wide config file in ${PREFIX}/etc/avrdude.conf.

Track and display the config file name and line number when we print
out the available parts and programmers.  This is useful in case
someone has overridden a definition in their .avrduderc file and is
wondering why the definition in the system wide config file is not
being used.

Remove the default programmer 'stk500' from the distributed config
file.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@222 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-22 16:45:13 +00:00
bdean 6b29e029b6 Update comment due to removal of the default parallel port pin config.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@219 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-21 21:19:56 +00:00
bdean 61ab2bc318 Introduce 'default_programmer' to the config file instead of requiring
one of the programmers to be tagged "default" within its definition.

Also, axe the notion of a compiled-in default programmer.  It is
kind've pointless now that nearly all configuration comes from the
config file, thus, avrdude is not very useful without the config file,
and thus, having a programmer compiled-in offers little or no benefit.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@218 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-21 21:07:43 +00:00
arcanum 131cd12d10 Change usage text to be verbose.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@217 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-21 21:04:34 +00:00
bdean 2c01281231 Add port name defaults to the config file instead of hard-coding.
This adds 'default_parallel' and 'default_serial' keywords to the
grammar, which take quoted string arguments.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@214 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-21 18:46:51 +00:00
arcanum 36d980ee58 Make verbose global. Make debug code in par_cmd() based on verbose=2.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@211 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-20 19:59:11 +00:00
bdean eb7359e45d Add Motorola S-record support.
Submitted by:		"Alexey V.Levdikov" <tsar@kemford.com>


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@200 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-20 03:53:49 +00:00
troth 1997cc5188 These changes add basic support for a autoconf/automake based build system.
* .cvsignore: Ignore autoconf files.
	* AUTHORS: New file.
	* ChangeLog: New file.
	* Makefile: Removed file.
	* Makefile.am: New file.
	* NEWS: New file.
	* README: New file.
	* bootstrap: New file.
	* configure.ac: New file.
	* avr.c: Include ac_cfg.h (generated by autoconf).
	* config.c: Include ac_cfg.h.
	Include config_gram.h instead of y.tab.h.
	* config.h: If HAS_YYSTYPE is not defined, define YYSTYPE.
	* config_gram.y: Include ac_cfg.h.
	* fileio.c: Include ac_cfg.h.
	* lexer.l: Include config_gram.h instead of y.tab.h.
	* lists.c: Include ac_cfg.h.
	* main.c: Include ac_cfg.h.
	* par.c: Include ac_cfg.h.
	* pgm.c: Include ac_cfg.h.
	* ppi.c: Include ac_cfg.h.
	* stk500.c: Include ac_cfg.h.
	* term.c: Include ac_cfg.h.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@192 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-14 20:34:03 +00:00
bdean dca2176204 Split higher level parallel port programmer code off from ppi.c into
its own file par.c, leaving low level parallel port accessor routines
in ppi.c to help with portability.  Change the programmer type to
'PAR' now instead of 'PPI' - 'PAR' represents the parallel port
programmer type.

Be more liberal with 'static' function declarations within the
programmer implimentation files - these functions should never be
called directly - always use the programmer function references.

There are still a few places in 'main.c' that directly reference the
parallel programmer explicitly (par_getpinmask).  These should be
fixed somehow.

Axe a few unused functions.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@190 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-13 19:27:50 +00:00
bsd 2c651eb7bf Makefile: include a target to automatically generate the dependency
list.

All others


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@177 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-08 04:17:25 +00:00
bsd b7c08f5901 Re-license using the GNU GPL. Thanks to Ted Roth for the patch.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@172 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-06 19:08:33 +00:00
bsd f983234f46 Get rid of the verbose printing of individual file CVS version ids.
This was intended to be used for identifying code in the field for
incoming bug reports, but I've never really found it all that useful.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@171 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-06 05:45:06 +00:00
bsd c1bcfe53a7 Change the name from AVRPROG to AVRDUDE.
This change represents a name change only.  There is currently an
effort to port AVRPROG to other platforms including Linux and Windows.
Since Atmel's programmer binary that's included within their AVR
Studio software is named AVRPROG.EXE on the Windows OS, there is the
chance for confusion if we keep calling this program AVRPROG as well.
Up until now the name hasn't really been a problem since there was no
chance to confuse 'avrprog' on Unix with Atmel's AVRPROG because
Atmel's tools only run on Windows.  But with the Unix 'avrprog'
possibly being ported to Windows, I felt a name change was the best
way to avoid problems.

So - from this point forward, my FreeBSD Unix program formerly known
as AVRPROG will subsequently be known as AVRDUDE (AVR Downloader/UploaDEr).

This change also represents a time when the AVRDUDE sources move from
my own private repository to a public repository.  This will give
other developers a chance to port AVRDUDE to other platforms and
extend its functionality to support additional programming hardware,
etc.

So goodbye AVRPROG, welcome AVRDUDE!


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@170 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-06 05:13:32 +00:00
bsd 4339967b19 minor cleanup
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@168 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-12-12 03:59:28 +00:00
bsd 354cd80b4a If the stk500 is being used, default to using the first serial port.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@167 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-12-07 15:16:24 +00:00
bsd e722fbc587 The STK500 can perform paged read/write operations even on standard
"non-paged" parts.  Take advantage of that and use the faster internal
routines of the STK500 for those parts as well.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@162 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-12-01 15:05:56 +00:00
bsd b3cc1535b6 Optimize reading and writing for the STK500 programmer if the part
supports paged reads and writes.  This greatly decreases the
program/verify time from about 4.5 minutes down to about 10 seconds in
a 12K program size test case.

Print out the hardware and firmware version for the STK500 if verbose
is enabled.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@161 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-12-01 06:35:18 +00:00
bsd 580ff186eb Seperate programmer operations out into a driver-like interface so
that programmers other than the direct parallel port connection can be
supported.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@159 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-11-30 14:09:12 +00:00
bsd 2d09c5b0aa term.c - when in interactive terminal mode and dumping memory using
the 'dump <memtype>' command without any address information,
         and the end of memory is reached, wrap back around to zero on
         the next invocation.

CHANGELOG - describe changes

main.c - update version number


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@157 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-11-23 00:52:15 +00:00
bsd 7561e319a1 When getting ready to initiate communications with the AVR device,
first pull /RESET low for a short period of time before enabling the
buffer chip.  This sequence allows the AVR to be reset before the
buffer is enabled to avoid a short period of time where the AVR may be
driving the programming lines at the same time the programmer tries
to.  Of course, if a buffer is being used, then the /RESET line from
the programmer needs to be directly connected to the AVR /RESET line
and not via the buffer chip.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@156 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-11-23 00:47:29 +00:00
bsd 1d33dc00ba Fix -Y option. Reported by Joerg Wunsch.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@153 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-11-06 02:19:57 +00:00
bsd 4f818a067b Version update and CHANGELOG entry.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@151 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-11-01 14:46:20 +00:00
bsd 4a3a651831 Add '-V' (no verify) flag requested by Joerg Wunsch. Update the man
page.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@148 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-10-29 01:59:02 +00:00
bsd fbc9157eac Update version number.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@146 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-10-13 04:19:39 +00:00