Commit Graph

58 Commits

Author SHA1 Message Date
Stefan Rueger ac10272bb6
Lengthen delay after reset for benefit of autobaud bootloaders 2022-12-31 12:27:07 +00:00
Stefan Rueger ab3da9f87c
Guard urclock_getsync() against initial spurious input 2022-12-30 21:05:57 +00:00
Stefan Rueger 857344295c
Merge pull request #1234 from stefanrueger/docs
Mention developer options in documentation and Usage()
2022-12-23 13:17:43 +00:00
Stefan Rueger 217adc543b
Merge pull request #1233 from janegilruud/fix-pickit4-snap-jtag
#1052 Add JTAG support for PICkit4 and Snap.
2022-12-21 19:12:33 +00:00
Stefan Rueger 41c9ed02e3
Mention developer options in documentation and Usage() 2022-12-21 19:06:26 +00:00
Stefan Rueger c6633fedce
Emphasise -xeepromrw and -xbootsize=<n> in documentation 2022-12-20 22:40:27 +00:00
Jan Egil Ruud a2ae465484 #1052 Update PICkit4 and Snap documentation with new modes. 2022-12-20 22:47:06 +01:00
Stefan Rueger 0c96f5d6dc
Calibrate urboot's -xdelay for windows 2022-11-27 13:57:37 +00:00
Stefan Rueger d774e87a59
Update documentation re the urclock programmer 2022-11-26 13:23:25 +00:00
Stefan Rueger e6f7e158cd
Change periphery to peripheral; document deprecated miso/mosi are now sdi/sdo 2022-11-24 13:18:06 +00:00
Stefan Rueger 7d5ab433ca
Replace gratuitous references to slave and master with technical terms 2022-11-22 17:11:33 +00:00
Stefan Rueger adc333ea54
Deprecate mosi/miso in favour of sdo/sdi
See https://www.oshwa.org/a-resolution-to-redefine-spi-signal-names/
2022-11-22 17:04:05 +00:00
Stefan Rueger 9c30ccc6ea
Merge pull request #1175 from stefanrueger/terminal
Make terminal write's automatic number width less surprising
2022-11-22 01:18:30 +00:00
Stefan Rueger 321bddbf7b
Rename urclock's option forcetrim to restore 2022-11-10 22:35:40 +00:00
Stefan Rueger 2434c3f7f6
Make terminal write's automatic number width less surprising 2022-11-10 19:38:21 +00:00
Stefan Rueger 6a6d333849
Update urclock documentation 2022-11-08 15:18:30 +00:00
Stefan Rueger cf3c81f714
Update urclock's -x parameters 2022-11-07 18:01:23 +00:00
Stefan Rueger 21d93ec8cb
Update urclock programmer 2022-11-07 01:26:47 +00:00
Stefan Rueger 16922842be
Improve -B bitclock documentation 2022-10-23 22:26:07 +01:00
Stefan Rueger 2c7083f001
Merge pull request #1139 from steelman/isp-clock-error-message
Mention -B in the error message and document -F better
2022-10-23 21:59:21 +01:00
steelman 34fa2faba5
Look for ~/.config/avrdude/avrduce.rc configuration file (#1131)
* Look for ~/.config/avrdude/config configuration file

Traditionally per-user configuration files have been placed
in user's home directory with their names beginnig with a dot
to hide them from some tools like ls(1). However, the number
of programs following this convention have grown over time
to the point where the number of hidden files becomes inconvenient to
some users. For this reason the XDG Base Directory Specification[1]
specifies an alternate place to store configuration files under
~/.config directory.

This patch enables avrdude to look for ~/.config/avrdude/config
configuration file, if ~/.avrduderc doesn't exist.

[1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html

* Safely concatenate directories and configurations files and minor changes in docs

* Make stats variable available for WIN32 again in main.c

* Utilise full usr_config[] array space

* Check for xdg-style avrdude.rc file first before fallback ~/.avrduderc

Co-authored-by: Stefan Rueger <stefan.rueger@urclocks.com>
2022-10-23 21:52:54 +01:00
Łukasz Stelmach 9977f1ed12 Document meaning of -F during initialization 2022-10-20 19:52:35 +02:00
Stefan Rueger d3a3257cf7
Improve help message in terminal and provide new command pgerase (#1113) 2022-10-11 14:40:37 +01:00
Stefan Rueger d74b17b9b4
Provide cached byte-wise read/write API (#1106)
* Provide cached byte-wise read/write API

int avr_read_byte_cached(const PROGRAMMER *pgm, const AVRPART *p, const
  AVRMEM *mem, unsigned long addr, unsigned char *value);

int avr_write_byte_cached(const PROGRAMMER *pgm, const AVRPART *p, const
 AVRMEM *mem, unsigned long addr, unsigned char data);

int avr_flush_cache(const PROGRAMMER *pgm, const AVRPART *p);

int avr_chip_erase_cached(const PROGRAMMER *pgm, const AVRPART *p);

int avr_reset_cache(const PROGRAMMER *pgm, const AVRPART *p);

avr_read_byte_cached() and avr_write_byte_cached() use a cache if paged
routines are available and if the device memory is EEPROM or flash,
otherwise they fall back to pgm->read_byte() and pgm->write_byte(),
respectively. Byte-wise cached read always gets its data from the cache,
possibly after reading a page from the device memory. Byte-wise cached
write with an address in memory range only ever modifies the cache. Any
modifications are written to the device after calling avr_flush_cache() or
when attempting to read or write from a location outside the address range
of the device memory.

avr_flush_cache() synchronises pending writes to EEPROM and flash with the
device. With some programmer and part combinations, flash (and sometimes
EEPROM, too) looks like a NOR memory, ie, one can only write 0 bits, not 1
bits. When this is detected, either page erase is deployed (eg, with parts
that have PDI/UPDI interfaces), or if that is not available, both EEPROM
and flash caches are fully read in, a pgm->chip_erase() command is issued
and both EEPROM and flash are written back to the device. Hence, it can
take minutes to ensure that a single previously cleared bit is set and,
therefore, this routine should be called sparingly.

avr_chip_erase_cached() erases the chip and discards pending writes() to
flash or EEPROM. It presets the flash cache to all 0xff alleviating the
need to read from the device flash. However, if the programmer serves
bootloaders (pgm->prog_modes & PM_SPM) then the flash cache is reset
instead, necessitating flash memory be fetched from the device on first
read; the reason for this is that bootloaders emulate chip erase and they
won't overwrite themselves (some bootloaders, eg, optiboot ignore chip
erase commands altogether) making it truly unknowable what the flash
contents on device is after a chip erase. 

For EEPROM avr_chip_erase_cached() concludes that it has been deleted if a
previously cached EEPROM page that contained cleared bits now no longer
has these clear bits on the device. Only with this evidence is the EEPROM
cache preset to all 0xff otherwise the cache discards all pending writes
to EEPROM and is left unchanged otherwise.

Finally, avr_reset_cache() resets the cache without synchronising pending
writes() to the device.
2022-10-05 22:16:15 +01:00
MCUdude 419fd35b72 Mention linuxspi and flip2 programmers
in the -E exitspecs section. linuxspi and flip2 supports "-E reset" and "-E noreset".
2022-10-01 22:12:37 +02:00
Stefan Rueger 9a59941dfe
Merge pull request #1100 from s-wakaba/sunxi_linuxspi_support
add extended parameter "disable_no_sc" for linuxspi programmer
2022-09-24 13:23:38 +01:00
Stefan Rueger f17a012325
Update documentation for linuxspi extended parameter disable_no_cs 2022-09-24 00:16:55 +01:00
Stefan Rueger b04a83b1a2
Document conditional options -c ? -p part and -p ? -c programmer 2022-09-20 21:39:15 +01:00
brutzzl3r 346de71cd5 man-page: Fix logfile short option
man synopsis states [-n -logfile] option. Later on in avrdude.1 as well as in
main.c -l is used.
Also '-logfile' is no option alternative but a parameter.
This is a minor issue but still confusing when one uses / to search
through man pages.

-- Always leave the code cleaner than you found it --

Signed-off-by: brutzzl3r <s3b.gr0ss@gmail.com>
2022-08-11 20:11:48 +02:00
Stefan Rueger ed36c7e1f6
Merge branch 'main' into fix_1041 2022-08-04 18:03:49 +01:00
Stefan Rueger 18e5bfd203
Merge pull request #1033 from MCUdude/ignore-safemode-flag
Ignore `-s` flag as safemode is no longer supported
2022-08-02 18:26:58 +01:00
Stefan Rueger 7730706498
Merge pull request #1030 from stefanrueger/ihexcomments
Provide file format I: Intel HEX with comments that ignores checksum errors
2022-08-02 18:23:23 +01:00
MCUdude 248c17177c Mention -s and -u in the docs 2022-07-23 22:33:11 +02:00
Joerg Wunsch ce1ae41dd6 Document that 'h', 'o', and 'd' file formats are output-only. 2022-07-23 16:30:38 +02:00
Stefan Rueger 6fa7400e4e
Merge pull request #1015 from MCUdude/hv-updi
Add support for high-voltage UPDI
2022-07-18 14:28:39 +01:00
Stefan Rueger 79921e52dc Provide file format I: Intel HEX with comments that ignores checksum errors
The new file type I is essentially Intel HEX that, on download, inserts
comments next to data records with the resolved effective address and an
ASCII dump of that same record. On upload the `I` format is permissive
with respect to check sum errors, eg, after manipulated an Intel HEX file
for debugging.
2022-07-16 23:40:36 +01:00
Stefan Rueger 0edb77bdf8
Merge branch 'main' into issue918 2022-07-12 15:05:45 +01:00
MCUdude 50220289bb Add high-voltage UPDI info to docs 2022-06-29 17:12:57 +02:00
Subhaditya Nath b9a012cebb Fix .Dd macro in manpage
The correct format for .Dd according to mdoc(7) is -

	.Dd month day, year
2022-05-08 20:35:32 +05:30
Stefan Rueger 580c37fbfe Describe -A in the man and .texi documentation 2022-04-29 00:14:45 +01:00
Joerg Wunsch 8c6c6a14ec Remove the "safemode" feature.
This feature has been designed with the sometimes quite flakey direct
(parallel or serial port attached) bitbang programming adapters in
mind that were quite common about two decades ago.

With parallel ports vanishing from modern PCs almost completely, and
the advent of various USB-attached low-cost programming devices,
this class of programmers disappeared almost completely.

Furthermore, the fuse combinations that were covered by the feature
are no longer around on all recent AVR devices, so for an ever
increasing number of devices, safemode already became meaningless and
was turned off anyway.

With the prospective version 7.x release, it's a good point in time to
introduce a major change like this one.
2022-01-31 20:44:32 +01:00
MCUdude ad6eff0f76 Set number of Arduino/STK500 connection retry attempts
Using the extended parameter flag -x. Usage: . Default number of attempts is still 10 if not -x flag is specified
2022-01-25 09:40:24 +01:00
Joerg Wunsch 37b0659951 PR #816 merged
Copy over man page additions into texinfo file as well.
2022-01-21 21:56:07 +01:00
Jörg Wunsch 490558049e
Merge pull request #816 from andrewshadura/usbtiny-spi
Add SPI support to USBtiny
2022-01-21 21:40:00 +01:00
Joerg Wunsch 153031d6d6 Copy over description of extended parameters to avrdude.1 2022-01-14 08:18:56 +01:00
Joerg Wunsch c7f7fcda8e Fix URL for linuxgpio programmer
Closes #419
2022-01-10 22:12:36 +01:00
David Fries 40f0fae5a4
Update manpage for USBtiny and direct SPI 2022-01-09 10:57:22 +01:00
Jörg Wunsch a91e389a5e
Merge pull request #807 from yegorich/src-typos
Fix typos all over the code
2022-01-07 13:15:14 +01:00
Yegor Yefremov f29b2a283a Fix typos all over the code 2022-01-07 11:31:16 +01:00
Marius Greuel f20c4bd9e6 Add support for Teensy bootloader 2022-01-06 23:39:17 +01:00