Commit Graph

1884 Commits

Author SHA1 Message Date
Joerg Wunsch dd1255b0c8 Improve defaults and documentation of linuxspi
* avrdude.conf.in: use @HAVE_LINUXGPIO_BEGIN/END@ and
@HAVE_LINUXSPI_BEGIN/END@ brackets around respective config
snippets; values were already set in configure.ac.
* linuxspi.c (linuxspi_open): Provide a reasonable (for the
Raspberry Pi) default for the -P option
* avrdude.1: Extend linuxspi documentation
* doc/avrdude.texi: (Dito.)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1496 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-27 17:33:49 +00:00
Joerg Wunsch 18fe8ef834 patch #10031: linuxspi: Support GPIO uAPI v2
Submitted by Alex Sverdlin:
* linuxspi.c (linuxspi_reset_mcu, linuxspi_open): Since Linux
v5.10 GPIO ABI Version 1 is optional and depends on
CONFIG_GPIO_CDEV_V1.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1495 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-27 15:51:24 +00:00
Joerg Wunsch bd4f46b1ff patch #10030: linuxspi: Support inverted GPIO pin
Submitted by Alex Sverdlin:
* linuxspi.c (linuxspi_open): Clear the inversion mask on request
and set default state to avoid short glitches on the GPIO line.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1494 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-27 15:48:30 +00:00
Joerg Wunsch 6f183d427c patch #10029: linuxspi: Report GPIO_GET_LINEHANDLE_IOCTL errors
Submitted by Alex Sverdlin:
* linuxspi.c (linuxspi_open): Report ioctl error




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1493 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-27 15:46:10 +00:00
Joerg Wunsch d208503911 Actually apply patch #10028 :)
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1492 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-27 15:43:57 +00:00
Joerg Wunsch 93767e0de1 patch #10028: linuxspi: close() only when necessary
Submitted by Alex Sverdlin:
* linuxspi.c: unify descriptor closing




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1491 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-27 15:42:33 +00:00
Joerg Wunsch 711323e7cc Submitted by Alex Sverdlin:
patch #10027: linuxspi: Add reset pulse, according to AVR programming algorithm
* linuxspi.c (linuxspi_open, linuxspi_program_enable):
movw out reset code into linuxspi_reset_mcu()



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1490 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-27 15:40:12 +00:00
Joerg Wunsch 6887f4f373 Add David Mosberger's email address (with permission)
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1489 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-25 18:51:54 +00:00
Joerg Wunsch 49e5f2451c patch #9328: ft245r.c: add TPI support (patches 5-7)
Submitted by David Mosberger-Tang:
* ft245r.c (ft245r_set_bitclock): add workaround for
FT245 hardware bugs in bitclock setting

Correct baud rate calculation (multiplying with factor of 2 was wrong)
and add compile-time workaround for FTDI chips suffering for the
variable pulse-width errata.  The workaround entails always running
the chip at 3MHz and stuffing the channel with repeated bytes to
achieve the desired baudrate.

This has no effect on programming speed.  Note, however, that now a
baudrate option -b750000 has to be used to achieve maximum speed.

(Option enabled by default now.)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1488 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-25 09:17:11 +00:00
Joerg Wunsch 2015a874e0 patch #9328: ft245r.c: add TPI support (patches 5-7)
Submitted by David Mosberger-Tang:
* ft245r.c: Remove the reader thread (also removes
patch #9079)

Eliminate separate reader thread by tracking how many bytes are queued
in the FTDI chip's RX FIFO and reading those bytes when it fills up
(since in synchronous bitbang mode, the chip won't send any more bytes
until it has space in the RX FIFO).  This reduces TPI programming time
by another 33%.

Since write data is now queued as much as possible, we need flush this
queued data (a) before reading and (b) before sleeping.  For the
latter case, a new helper function ft245r_usleep() is introduced.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1487 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-25 09:10:30 +00:00
Joerg Wunsch 5bf24e4e96 patch #9327: ft245r.c: add TPI support (patches 1-4)
Submitted by David Mosberger-Tang:

ft245r.c (set_pin, ft245r_open): use
ft245r_send_and_discard() so ft245r_in can go away




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1486 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-24 22:27:59 +00:00
Joerg Wunsch 105cebb389 patch #9327: ft245r.c: add TPI support (patches 1-4)
Submitted by David Mosberger-Tang:

Optimize TPI programming speed by reducing number of USB reads.
Specifically, when writing to the FTDI chip (without needing the data
it accumulates), simply increment a count of how many bytes the next
read should ignore.  Thus, if there is one or more write followed by a
read, we only need to read from the device once.

Improves TPI programming speed by another factor of 2.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1485 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-24 22:06:31 +00:00
Joerg Wunsch 7ff5652edc patch #9327: ft245r.c: add TPI support (patches 1-4)
Submitted by David Mosberger-Tang

With newer versions of the Linux kernel (e.g., Ubuntu's
linux-image-4.4.0-75-generic), the default for the latency timer is
set to a high value.  Since this driver needs quick turnaround times,
set it explicitly to the minium.  This improves TPI programming speed
by almost a factor of 10.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1484 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-24 22:00:45 +00:00
Joerg Wunsch 6de6c0ffce patch #9327: ft245r.c: add TPI support (patches 1-4)
Submitted by David Mosberger-Tang:
* ft245r.c: add TPI support
* avrdude.conf.in (tc2030): New programmer




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1483 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-24 21:25:45 +00:00
Joerg Wunsch d947e5893f * ft245r.c (ft245r_open): allow for picking a default
device if none has been provided by -P



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1482 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-24 21:09:33 +00:00
Joerg Wunsch 391439493d * jtag3.c (jtag3_edbg_recv_frame): Better handling for
fragment_info == 0x00 (no response available)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1481 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-24 21:04:47 +00:00
Joerg Wunsch 265aa3296b Fix logic bug in previous commit
Comparison against "usb" was done the wrong way.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1480 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-23 09:54:18 +00:00
Joerg Wunsch 172fcb7c7e Now that we have a matches() function, prefer it over strncmp()
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1479 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-23 09:48:15 +00:00
Joerg Wunsch bd50422644 patch #9757: Fix ATtiny817 Xplained Mini programmer
* jtag3.c (jtag3_getsync, jtag3_close): correctly extract
programmer name from list of names



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1478 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-23 09:42:39 +00:00
Joerg Wunsch 8004e38403 patch #8719: Support Over-the-Air bootloading with XBeeBoot
Submitted by David Sainty:
* xbee.c: New programmer
* xbee.h: (Dito.)
* pgm_type.c: Add xbee.h
* avrdude.conf.in (xbee): New programmer
* Makefile.am (libavrdude_a_SOURCES): add xbee.c, xbee.h
* avrdude.1: document the new programmer
* doc/avrdude.texi: (Dito.)




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1477 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-22 21:35:26 +00:00
Joerg Wunsch 9a15fcb25f Update ChangeLog for ft245r.c patches
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1476 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-14 15:48:53 +00:00
Joerg Wunsch f821bfc03d patch #9123: ftdi_syncbb: use FT245R_CYCLES in ft245r_set_bitclock()
Submitted by Ivan Frederiks:

Replace magic numbers by #defined constant



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1475 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-14 15:47:29 +00:00
Joerg Wunsch e8c5ed0fcd patch #9122: Fixed MISO sampling in ftdi_syncbb
Submitted by Ivan Frederiks

Fix MISO sampling on falling edge of SCK.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1474 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-14 15:44:54 +00:00
Joerg Wunsch ebea9b5237 Submitted by Ivan Frederiks:
patch #9079: Fix ftdi_syncbb teardown

Fix teardown sequence between reader thread and libusb.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1473 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-14 13:34:20 +00:00
Joerg Wunsch 5e6a662e8a Submitted by David Mosberger-Tang:
patch #9320: fix TPI RESET in bitbang.c
* bitbang.c (bitbang_initialize): wait for 128 ms after deasserting
/RESET (per datasheet), and keep /RESET low during MOSI/MISO link check



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1472 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-14 13:17:44 +00:00
Joerg Wunsch 3d1b0ff308 Submitted by Jon Thacker:
patch #9253: Fix for giving terminal_mode commands more than 20 arguments
* term.c (tokenize): fix realloc usage, pointer returned not necessarily
the same as pointer passed



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1471 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-12 22:11:49 +00:00
Joerg Wunsch db7249bf57 Submitted by Martino Facchin:
patch #9110: Let reserved fuse bits to be read as *don't care*
* avr.c (compare_memory_masked): New function
* libavrdude.h: declare compare_memory_masked(); also, insist on C99
so <stdint.h> is required now
* main.c: Use compare_memory_masked() in safemode comparisons

C99 / stdint.h has basically already been required before, as types
like uint8_t are in use in a number of other locations throughout the
source.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1470 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-12 22:02:29 +00:00
Joerg Wunsch 10df0ff15a Submitted by Joseph Coffland:
patch #8957: Allow reading prodsig memory from stk500v2 on xmega devices
* stk500v2.c (stk600_xprog_read_byte, stk600_xprog_paged_load):
treat "prodsig" memory space as equivalent to "calibration"



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1469 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-11 20:59:25 +00:00
Joerg Wunsch 91948428a6 Submitted by Martin Thierer:
patch #10017: uspasp / tpi: Automatically clear configuration byte (fuse) before writing it
* usbasp.c (usbasp_tpi_paged_write): clear fuse region before writing it



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1468 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 20:10:24 +00:00
Joerg Wunsch 62a00cedc7 Submitted by Michael Petersen:
patch #9697: Add iseavrprog support
* avrdude.conf.in (iseavrprog): New programmer



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1467 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 19:37:50 +00:00
Joerg Wunsch 8841a9cd93 bug #50630: Erase Cycle Counter options ( -y -Y n ) should be removed from usage Message
* main.c (usage): remove -y / -Y descriptions



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1466 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 16:51:42 +00:00
Joerg Wunsch 46628eb3c6 Add ATmega8A as an alias for ATmega8
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1465 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 16:49:12 +00:00
Joerg Wunsch 84af4b36a1 bug #50517: Reading fails if "immediate mode" for output file format
is selected - fileio: invalid operation=1

* update.c (do_op): refuse to write to "immediate format" argument




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1464 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 16:22:00 +00:00
Joerg Wunsch 1b3afa4cef Move ATmega164P definition after its parent ATmega324P
Error was introduced in r1458.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1463 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 16:06:42 +00:00
Joerg Wunsch eb461f706f Submitted by Martin Thierer:
bug #60863: avrftdi programming error probably caused by multiple, consecutive empty pages
* avrftdi.c (avrftdi_flash_write): Skip empty pages



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1462 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 16:00:16 +00:00
Joerg Wunsch 9cf4edf76f Submitted by Matwey V. Kornilov:
bug #58495: Add atmega324pb support to avrdude.conf.in
* avrdude.conf.in (ATmega324PB): new entry



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1461 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 15:50:53 +00:00
Joerg Wunsch ea27bfef1e bug #51409: Can't program EFUSE on ATmega32M1
Was already fixed, adjust bug id in NEWS



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1460 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 15:48:01 +00:00
Joerg Wunsch 7c554b0035 bug #55734: USBtiny programming of ATmega328p broken by Patch #9278
* usbtiny.c (usbtiny_initialize): undo change from patch #9728



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1459 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 15:44:18 +00:00
Joerg Wunsch 8907155291 Fix entry for ATmega164P, by deriving it from ATmega324P
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1458 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 15:28:24 +00:00
Joerg Wunsch aedc3b0c2a Submitted by evan Venn:
bug #59227: Add new part. How does one get a part added to the CONF file?
* avrdude.conf.in (LGT8FX88P, LGT8FX168P, LGT8FX328P): new parts



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1457 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-07 09:18:32 +00:00
Joerg Wunsch b05e8af0a7 Submitted by Britton Kerin:
bug #57453: [PATCH] fix reference to nonexistant -m option by changing to -U
* avrdude.1: replace -m option by -U



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1456 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-06 22:44:21 +00:00
Joerg Wunsch 60f5885849 Submitted by Andrew D'Addesio:
bug #58078: [PATCH] buspirate: remove compound literals (fixes GCC>=9)
* buspirate.c (buspirate_start_mode_bin):
avoid propagating local scope compound literals



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1455 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-06 22:34:29 +00:00
Joerg Wunsch e074edf4cb Submitted by Jan Egil Ruud:
patch #10000: Add support for extended UPDI device context
* avrdude.conf.in (pickit4_updi, snap_updi, pkobn_updi):
new programmers
* avrdude.conf.in (ATmega808, ATmega809, ATmega1608, ATmega1609)
(AVR DA, AVR DB): new devices
* jtag3.c: Add support for extended UPDI device context
* jtag3_private.h: (Dito.)
* tools/atdf-to-avrdude.xslt: Bug fixes
* usbdevs.h: Bump USBDEV_MAX_XFER_3 to 912
* doc/avrdude.texi: Document changes
* avrdude.1: (Dito)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1454 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-06 22:13:51 +00:00
Joerg Wunsch c9aeaf8928 Submitted by gerardoallende:
bug #59525: Bogus error message because Copy/Paste typo in stk500.c
* stk500.c (stk500_getparm): Fix bogus ID in error message




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1453 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-06-27 20:42:06 +00:00
Joerg Wunsch 38e5aa33ea bug #60753: Patch #1436 breaks multiple programmer/device combinations on MacOS BigSur
* avr.c: compare page_size > 1 instead of != 0
* stk500v2.c: (Ditto.)




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1452 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-06-27 20:26:05 +00:00
Joerg Wunsch 69a771317f ChangeLog rotation
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1451 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-06-27 20:24:30 +00:00
Joerg Wunsch 1b650f594d * avrdude.conf.in (m32m1): add "size" parameter in "efuse"
section

Reported by Hannes Wallnöfer:



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1450 81a1dc3b-b13d-400b-aceb-764788c761c2
2020-09-22 07:36:45 +00:00
Joerg Wunsch c934f95f5e patch #9744: Patch for ATMega324A support
* avrdude.conf.in (m324a): New entry.

Submitted by Björn Mellström



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1449 81a1dc3b-b13d-400b-aceb-764788c761c2
2020-09-20 20:51:51 +00:00
Joerg Wunsch e98f9854b7 patch #9811: ATmega328pb has efuse bit 3
* avrdude.conf.in (m328pb): Add own efuse definition

Submitted by Ronald Sutherland



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1448 81a1dc3b-b13d-400b-aceb-764788c761c2
2020-09-20 18:29:03 +00:00
Joerg Wunsch 40b0b104d6 patch #9816: Implement new programmer type: linuxspi
* linuxspi.c: (New file.)
* linuxspi.h: (New file.)
* Makefile.am: Add new files
* configure.ac: Add "linuxspi" --enable option
* avrdude.conf.in: Add "linuxspi" programmer template
* pgm_type.c: Include linuxspi programmer
* doc/avrdude.texi: Document new programmer
* avrdude.1: (Dito.)

Submitted by Ralf Ramsauer



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1447 81a1dc3b-b13d-400b-aceb-764788c761c2
2020-09-19 21:32:38 +00:00