Commit Graph

39 Commits

Author SHA1 Message Date
Joerg Wunsch 8ffc939aff Cleanup Cygwin builds.
* windows/Makefile.am (loaddrv_LDFLAGS): remove, the -mno-cygwin
flag is supposed to be set in CFLAGS by ./configure
* configure.ac: add a check for the presence of usleep(), add a
check whether the linker accepts -static
* avrdude.h: protect prototype for usleep by !defined(HAVE_USLEEP)
* ppwin.c (usleep): protect by !defined(HAVE_USLEEP)
* main.c: silence "array subscript of type char" compiler warnings
by casting all arguments to tolower()/toupper() and isspace()/
isdigit()/ispunct() to "int"
* butterfly.c: (Dito.)
* avr910.c: (Dito.)




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@936 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-22 16:40:17 +00:00
Joerg Wunsch 5f149728b9 Submitted by Andrew O. Shadoura:
bug #25156: add direct SPI transfer mode
* bitbang.c: Implement direct SPI transfers.
* bitbang.h: (Ditto.)
* par.c: (Ditto.)
* pgm.c: (Ditto.)
* pgm.h: (Ditto.)
* term.c: Add the "spi" and "pgm" commands.
* avrdude.1: Document the changes.
* doc/avrdude.texi: (Ditto.)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@797 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-02-17 15:31:27 +00:00
Joerg Wunsch ec2df64017 Add initial support for the Atmel STK600, for
"classic" AVRs (AT90, ATtiny, ATmega) in both,
ISP and high-voltage programming modes.
* Makefile.am: Add -lm.
* avrdude.conf.in: Add stk600, stk600pp, and stk600hvsp.
* config_gram.y: Add support for the stk600* keywords.
* lexer.l: (Ditto.)
* pgm.h: Add the "chan" parameter to set_varef().
* stk500.c: (Ditto.)
* serial.h: Add USB endpoint support to struct filedescriptor.
* stk500v2.c: Implement the meat of the STK600 support.
* stk500v2.h: Add new prototypes for stk600*() programmers.
* stk500v2_private.h: Add new constants used in the STK600.
* term.c: Add AREF channel support.
* usb_libusb.c: Automatically determine the correct write
endpoint ID, the STK600 uses 0x83 while all other tools use
0x82.  Propagate the EP to use through struct filedescriptor.
* usbdevs.h: Add the STK600 USB product ID.
* tools/get-stk600-cards.xsl: XSL transformation for
targetboards.xml to obtain the list of socket and routing
card IDs, to be used in stk500v2.c (for displaying the
names).
* tools/get-stk600-devices.xsl: XSL transformation for
targetboards.xml to obtain the table of socket/routing cards
and their respective AVR device support for doc/avrdude.texi.
* avrdude.1: Document all the STK600 stuff.
* doc/avrdude.texi: Ditto.  Added a new chapter for
Programmer Specific Information.

Thanks to Eirik Rasmussen from Atmel Norway for his support in
getting this code running within that short amount of time!


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@768 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-03-14 13:00:08 +00:00
Joerg Wunsch 5bf9e2d9f2 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 27e16e8371 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 afb13a9936 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
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
Jan-Hinnerk Reichert 80f996b49a stk500.c, term.c, doc/avrdude.texi, avrdude.1: added "sck"-command to the terminal mode. This command allows slowing down of the SCK of STK500-programmers.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@427 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-07-07 08:59:07 +00:00
kiwi64ajs be4f46c49e merged in changes to allow native Win32 build with no cygwin DLL dependancy
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@419 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-06-24 11:05:07 +00:00
Jan-Hinnerk Reichert eed95a739d *term.c: Add two missing includes to fix compile warnings.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@383 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-11-22 03:25:48 +00:00
Joerg Wunsch 4e704ad695 Add support for displaying and changing the various STK500 operational
parameters.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@336 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-07-24 21:26:28 +00:00
Theodore A. Roth bed435c2c1 * term.c: Use fgets() if readline() is not available.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@243 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-27 20:08:54 +00:00
Theodore A. Roth 2c7934a1ca 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
Brian S. Dean ee8bf2d5fc 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
Brian S. Dean 08e8c6e8ee 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
Brian S. Dean 1e0c4f8756 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
Brian S. Dean 17427c0645 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
Brian S. Dean a193330803 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
Brian S. Dean 39b1f7d02b 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
Brian S. Dean 603fa47266 Use a four byte value instead of a two byte value for the programming
cycle count stored at the end of EEPROM.  It seems as though Atmel was
greatly conservative in claiming a 1000 count reliability for the
FLASH.  I current have a part that has been reprogrammed 173330 times,
and counting.

Fix a compiler warning.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@144 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-10-11 19:36:56 +00:00
Brian S. Dean fa956af92c Fix error reporting by avr_write_byte().
Fix setting of status LEDs under various write-fail conditions.

Add a flag to indicate that a memory type requires the device to
possibly be powered off and back on after a write to it.  This is due
to a hardware problem on some Atmel devices, see:

	http://www.atmel.com/atmel/acrobat/doc1280.pdf

Add greater verbosity to the part-display code when verbose>1 to
display avrprog's encoding of the defined programming instructions.
This is primarily for debugging purposes.


Part updates:

  * add the AT90S4414 part

  * add fuse and lock bit access instructions for the AT90S1200,
    AT90S4434, and AT90S8515.

  * add the pwroff_after_write flag to the fuse bits for the AT90S2333
    and AT90S4433 parts


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@123 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-02-14 02:48:07 +00:00
Brian S. Dean fbbd6ce36e Update version number. Update copyright.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@118 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-01-12 01:51:35 +00:00
Brian S. Dean 3138b91aa7 Fix programming of write-only memories (such as lock bits on the
2313).


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@116 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-01-12 01:26:09 +00:00
Brian S. Dean e95114a18d In interactive mode, reset the address and length if we start dumping
a memory type different than the previous one.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@103 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-11-21 18:54:11 +00:00
Brian S. Dean fb233af934 This is a jajor re-write of the programming algorithms. The Atmel
serial programming instructions are not very orthoganal, i.e., the
"read fuse bits" instruction on an ATMega103 is an entirely different
opcode and data format from the _same_ instruction for an ATMega163!
Thus, it becomes impossible to have a single instruction encoding
(varying the data) across the chip lines.

This set of changes allows and requires instruction encodings to be
defined on a per-part basis within the configuration file.  Hopefully
I've defined the encoding scheme in a general enough way so it is
useful in describing the instruction formats for yet-to-be invented
Atmel chips.  I've tried hard to make it match very closely with the
specification in Atmel's data sheets for their parts.  It's a little
more verbose than what I initially hoped for, but I've tried to keep
it as concise as I could, while still remaining reasonably flexible.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@100 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-11-21 02:46:55 +00:00
Brian S. Dean f1af5d3981 Add support for ATMega163.
Add support for reading/writing ATMega163 lock and fuse bits.
Unfortunately, in looking at the specs for other ATMega parts, they
use entirely different instruction formats for these commands.  Thus,
these routines won't work for the ATMega103, for example.

Add support for sending raw command bytes via the interactive terminal
interface.  This allows one to execute any programming instruction on
the target device, whether or not avrprog supports it explicitly or
not.  Thus, one can use this feature to program fuse / lock bits, or
access any other feature of a current or future device that avrprog
does not know how to do.

Add in comments, an experimental instruction format in the
configuration file.  If this works out, it would allow supporting new
parts and non-orthoganal instructions across existing parts without
making avrprog code changes.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@99 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-11-19 17:44:24 +00:00
Brian S. Dean 90d4f82fc9 Fix (again, hopefully) page addressing for the ATMega parts.
Rename the poorly chosen name "bank" to "page" for page addressing.
Atmel calls it "page" in their documentation.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@91 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-10-16 23:32:30 +00:00
Brian S. Dean 3d8f8bcd45 Use lex/yacc for parsing the config file. Re-work the config file
format using a more human-readable format.

Read part descriptions from the config file now instead of hard-coding
them.

Update usage().

Cleanup unused code.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@79 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-10-14 23:17:26 +00:00
Brian S. Dean 3bae0d8d14 First cut at supporting the ATmega 103 which uses bank addressing and
has a 128K flash.

Due to the bank addressing required, interactive update of the flash
is not supported, though the eeprom can be updated interactively.
Both memories can be programmed via non-interactive mode.

Intel Hex Record type '04' is now generated as required for outputing
memory contents that go beyond 64K.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@78 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-10-14 02:53:21 +00:00
Brian S. Dean f73b0f9eba Style fixes.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@77 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-10-13 03:13:13 +00:00
Brian S. Dean 42a81370c7 Commit changes in preparation for support the ATMega line.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@76 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-10-13 03:12:52 +00:00
Brian S. Dean 88b4c8c41f Remove debugging code - it served its purpose.
Update copyrights.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@72 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-10-01 14:04:46 +00:00
Brian S. Dean 9003ed1183 Make the pin definitions configurable based on entries in a config
file.  This makes supporting other programmers much easier.

Rename AVRprog.pdf to avrprog.pdf.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@67 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-09-19 17:04:25 +00:00
Brian S. Dean fe0f2dca65 Makefile : update dependencies
avr.c : correct status led updates

term.c : update status leds on write, make the address and length
         arguments for dump optional.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@58 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-02-08 01:05:05 +00:00
Brian S. Dean 26223415e6 Add a -V option to display the version information about each
component module.  This is intended for support purposes, so that I
can tell unambiguously what version a binary out in the field is.

Additionally, display a revision timestamp along with the version
number.  This also is intended for aiding in support and is the Unix
time of the latest component module.  Having this, should allow me to
do a "cvs co -D timestamp avrprog" and get exactly the source of the
version that is being reported.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@55 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-01-26 20:34:08 +00:00
Brian S. Dean 209f979c7f Makefile : use gzip -f for man page installation so that we don't get
prompted.

avr.c avr.h fileio.c term.c :

     Change the avrpart data structure so that the typedef AVRMEM is
     used as an index into an array for the sizes of the memory types
     and also for pointers to buffers that represent the chip data for
     that memory type.  This removes a lot of conditional code of the
     form:

		switch (memtype) {
			case AVR_FLASH :
		 	...
		}

     Also, re-code avr_read_byte() and avr_write_byte() to properly
     handle the flash memory type without having to tell them whether
     they should program the high byte or the low byte - figure that
     out from the address itself.  For flash memory type, these
     routines now take the actual byte address instead of the word
     address.  This _greatly_ simplifies many otherwise simple
     operations, such a reading or writing a range of memory, by not
     having to worry about whether the address starts on an odd byte
     or an even byte.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@45 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-01-22 01:59:47 +00:00
Brian S. Dean 6cd9862d2c Accept abbreviations for eeprom and flash for the dump and write
commands.

Fix small bug keeping 1 character command lines from being added to
the history.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@40 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-01-19 03:43:16 +00:00
Brian S. Dean 7dc244ac12 Implement enough state in cmd_dump so that if it is called with no
arguments, it successively dumps the next chunk of data of the same
previously specified length.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@39 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-01-19 03:10:53 +00:00
Brian S. Dean 4265bfa150 The program was getting too large for a single file. Split it up into
more modular pieces.

Also, accept command abbreviations as long as they are not ambiguous.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@38 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-01-19 02:46:50 +00:00