Commit Graph

27 Commits

Author SHA1 Message Date
Joerg Wunsch 25829f2c5e bug #43137: Writing and reading incorrect pages when using jtagicemkI
* jtagmkI.c (jtagmkI_paged_write, jtagmkI_paged_load): correctly
calculate the size of a partial (non-pagesize) buffer



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1345 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-11-23 20:57:17 +00:00
Axel Wachtler c6788bd795 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 d09bc2e1fb 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
Axel Wachtler eb5fcb581f 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 57903bdeb8 Replace all occurences of exit() in potential library code
by appropriate return values.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1301 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-05-16 15:52:25 +00:00
Joerg Wunsch f80f51f6a9 Change the second parameter of the ser_open method from "baud" into a
"union pinfo", so the USB parameters can be passed without hacks.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1276 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-02-21 13:44:11 +00:00
Joerg Wunsch 76df1b5b6e Replace some stray calls to putchar() by putc(..., stderr).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1131 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-08 21:02:01 +00:00
Joerg Wunsch 147137a218 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
Rene Liebscher c1095de822 Parser does not need to know all programmer types now, new programmers
will update only the table in pgm_type.c.
  * config_gram.y, lexer.l: removed programmer type keywords,
    use now locate_programmer_type() function
  * pgm_type.[ch]: added new files for table of programmer types
  * main.c: allow list of programmer types by -c ?type
  * avrdude.conf.in: changed all type keywords to quoted strings
  * doc/avrdude.texi: changed description of type definition, list
    of valid types is now included from generated file
  * doc/Makefile.am: generate list of programmer types for doc
  * all programmers [hc]: add xxx_desc string for description of programmer


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1051 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-01-31 17:03:43 +00:00
Joerg Wunsch d742827da1 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
Nils Springob 0c603e4791 * serial_open() calls will now return -1 on error (no call to exit())
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@948 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-10-22 14:29:56 +00:00
David Hoerl 8d0cdd937c Cast in fprintf to remove warning on possible size mismatch
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@859 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-10-10 22:10:46 +00:00
Joerg Wunsch 0b871f2b6e * jtagmkI.c (jtagmkI_send): Replace %zd format by %u since not all
implementations do understand the C99 formatting options (sigh).
* jtagmkII.c (jtagmkII_send): (Ditto.)
* stk500v2.c (stk500v2_recv): (Ditto.)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@836 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-07-10 22:39:37 +00:00
Joerg Wunsch 6a633ea9f1 Fix a bunch of warnings.
* avr910.c (avr910_paged_load): possible unitialized use of
rd_size
* jtagmkI.c (jtagmkI_initialize): pointer signedness mixup
* jtagmkII.c (jtagmkII_print_parms1): propagate const'ness
of parameter
* usbasp.c (usbasp_transmit): poiner signedness mixup


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@775 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-07-25 21:14:43 +00:00
Joerg Wunsch 58a3d35757 main.c, pgm.c, pgm.h: Add setup and teardown hooks to the programmer
definition.  If present, call the setup hook immediately after finding
the respective programmer object, and schedule the teardown hook to be
called upon exit.  This allows the programmer implementation to
dynamically allocate private programmer data.

avr910.c, butterfly.c, jtagmkI.c, jtagmkII.c, stk500v2.c, usbasp.c,
usbtiny.c: Convert static programmer data into dynamically allocated
data.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@764 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-11-07 20:36:12 +00:00
Joerg Wunsch b8a306c048 safemode.c: Obtain progname from avrdude.h rather than trying to roll our
own (duplicate) copy of it.

other files: Constify char pointers.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@725 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-30 13:41:54 +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 18cf1cf47f Submitted by ivanv at netman.ru
Fix length for single-byte write operations.
Closes bug #18527 JTAG ICE: fuse bits have been writen incorrectly


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@703 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-15 15:42:44 +00:00
Joerg Wunsch 932bd18ec1 In jtagmkI_close(), revert baud rate to the initial
value in case we had changed it.

Fixes bug #18262: JTAGMKI/JTAG1 Reset Bug


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@699 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 15:15:50 +00:00
Joerg Wunsch 7e20e7571f Make the code compile warning-free:
- declare a dummy "struct timezone" for some Win32 systems (MinGW)
- fix a few printf() argument types
- get rid off the prevailing "all filedescriptors are of type int"
  attitude

The last item required a large sweep across the code, in order to
replace all "int fd"s by "struct filedescriptor *fd"s, and pass
pointers (as we cannot pass a union directly).  In return, the
code is now supposed to be fully 64-bit safe, rather than relying
on a 64-bit pointer being converted to a (32-bit) int and back
to a pointer as we did previously.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@694 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 12:47:35 +00:00
Joerg Wunsch 432ee9035b jtagmkI_close(): remove two unused variables.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@687 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 22:07:25 +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
Joerg Wunsch 23aeb38d13 Avoid sending a CMD_RESET when leaving programming mode, and CMD_GO
when closing the connection.  They cause the activity LED on the ICE
to continue to flicker, and are not necessary anyway (the target
starts to run by itself when leaving programmng mode).

This is a partial fix for bug #18262: JTAGMKI/JTAG1 Reset Bug


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@683 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-13 21:14:28 +00:00
Joerg Wunsch 4e81a6be72 Implement a flags field in struct serdev, and populate it with a flag
that indicates whether the underlying communication can dynamically
change its speed or not.  This flag is set for true serial
communication but clear for USB communication.  Don't try to adjust
the speed when talking over a communication channel that doesn't
support it.  (The Dragon does not even support the respective
parameter.)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@676 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-10-27 08:45:47 +00:00
Joerg Wunsch f68ed0ca7a Fix the size of a response array.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@556 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-11-28 21:11:18 +00:00
Joerg Wunsch a02dc0b11a Improve the communication startup with the ICE in particular after a
powerup.  Ideas taken from AVaRICE.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@555 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-11-28 20:46:21 +00:00
Joerg Wunsch 78fe202b59 Initial import of JTAG ICE mkI support.
The very basic functionality (paged flash read/write, erase, terminal
mode reads, fuse writes) works fine.  There are still the following
issues right now:

. paged EEPROM write (i.e. through -U eeprom:w:...) only works on an
  erased EEPROM
. byte-access flash and EEPROM writes (i.e. in terminal mode) fail
. documentation needs to be updated still


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@547 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-11-25 06:14:06 +00:00