Commit Graph

2214 Commits

Author SHA1 Message Date
Stefan Rueger 22362e9f08
Merge branch 'main' into pr-pointer-truncation 2022-10-11 14:43:19 +01:00
Stefan Rueger d3a3257cf7
Improve help message in terminal and provide new command pgerase (#1113) 2022-10-11 14:40:37 +01:00
Marius Greuel 9377acee0e Fix pointer truncation for Windows x64 2022-10-08 19:02:03 +02:00
Stefan Rueger 44fe5bec2d
Update NEWS 2022-10-05 23:21:52 +01:00
Stefan Rueger cd79f81747
Merge pull request #1109 from MCUdude/jtag-mki-targets
Add missing AVR variants the original JTAG ICE supports
2022-10-05 22:21:42 +01:00
Stefan Rueger f2fb3b45b4
Merge pull request #1108 from MCUdude/avr109-xmega
AVR109: support for prodsig read and usersig read/write
2022-10-05 22:20:16 +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
Stefan Rueger c4cb242823
Merge pull request #1105 from MCUdude/power-debugger-features
Support for Power Debugger analog readings in terminal mode
2022-10-05 22:03:52 +01:00
Stefan Rueger bc9137854b
Merge pull request #1103 from s-wakaba/sunxi_linuxspi_support
saving errno of ioctl() call in a temporary variable to prevent overwrite
2022-10-05 22:02:42 +01:00
Stefan Rueger 83232bc7e1
Merge pull request #1102 from MCUdude/flip2-reset
Add support for Flip 2 reset on exit
2022-10-05 22:02:22 +01:00
Stefan Rueger 59a191ee2c
Merge pull request #1101 from MCUdude/avr109-fix
Fix avr109 extended address
2022-10-05 22:00:59 +01:00
Hans da275f8ef2 Adjust prog_modes on a few chip variants
Now variants of chips that the JTAG ICE supports will not cause a warning when used with the original JTAG ICE mkI.
Also, The ATmega165 isn't officially supported by the ICE mkI, so this should be properly tested with the ICE mkI first.
2022-10-05 19:24:40 +02:00
Hans 2c8cef2712
Merge branch 'avrdudes:main' into avr109-xmega 2022-10-02 22:43:03 +02:00
MCUdude 31c3db2617 Add support for prodsig read and usersig read/write
Currently only supported by the Xboot bootloader
2022-10-02 22:36:43 +02:00
MCUdude ffabab1fb2 Improve pgm->id detection handling 2022-10-02 11:48:30 +02:00
MCUdude 4bc9e020f1 Merge branch 'flip2-reset' of https://github.com/MCUdude/avrdude into flip2-reset 2022-10-01 22:13:06 +02: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
Marius Greuel ef209fe44e GitHub Actions: Update apt index before installing packages 2022-10-01 22:12:37 +02:00
MCUdude e05aa16510 use pgm->id to identify Power Debugger instead of USB PID 2022-10-01 21:17:55 +02:00
MCUdude e39133daf5 Initial support for Power Debugger analog reading
Voltage and current though channel A and B
2022-10-01 21:17:01 +02:00
Hans 52eb2e36a7
Merge branch 'avrdudes:main' into flip2-reset 2022-09-30 20:16:58 +02:00
MCUdude 01ccab08b4 Improve exitspecs (-E) parsing
Use the same implementation as linuxspi does, instead of the one suggested in #733
2022-09-30 20:16:16 +02:00
MCUdude 521155c1c2 Improve punctuation in error message 2022-09-30 20:03:04 +02:00
Marius Greuel 3b8f41ca20 GitHub Actions: Update apt index before installing packages 2022-09-29 22:02:04 +02:00
MCUdude e1a317c670 Remove Flip 2 stub functions
Used when compiling without libusb. Print reasonable error instead
2022-09-27 19:35:25 +02:00
Shunichi Wakabayashi 2a64e78c7b bugfix: saving errno of ioctl() call in a temporary variable to prevent overwriting by following avrdude_message() call 2022-09-25 16:46:10 +09:00
MCUdude 80ca8a644e Add support for Flip 2 reset on exit
This makes it possible for the application to start immedeatly after the program has been loaded.
Simply use '-E reset' or '-E noreset'. Default is no reset.
Closes #733
2022-09-24 22:48:14 +02:00
MCUdude 62aa480876 Fix avr109 extended address
Closes #360 #454
2022-09-24 20:42:42 +02:00
Stefan Rueger 8f478f0098
Update NEWS 2022-09-24 13:29:04 +01: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 94203eb441
Merge pull request #1099 from stefanrueger/prog_modes
Print compatible parts for programmer and vice versa using -c? or -p?
2022-09-24 13:23:12 +01:00
Stefan Rueger f172f05372
Merge pull request #1096 from mariusgreuel/pr-cmake-texinfo
CMake: Build docs
2022-09-24 13:22:55 +01:00
Stefan Rueger 7743051926
Merge pull request #1095 from mariusgreuel/pr-fix-multiline-configure
CMake: Fix dependency chain between avrdude.conf.in and avrdude.conf
2022-09-24 13:22:37 +01:00
Stefan Rueger db8b04f423
Merge pull request #1094 from papazoga/main
avrdude.conf.in: Adds digilent-hs2 dongle
2022-09-24 13:22:14 +01:00
Stefan Rueger 3b8ac76246
Merge pull request #1093 from stefanrueger/gemmaBoot
Create two bootloader programmers for gemmaBoot boards
2022-09-24 13:21:44 +01:00
Stefan Rueger fe991b8214
Merge pull request #917 from asmirnou/iss45256-sysfs-gpio
Fix permission denied error in linuxgpio programmer
2022-09-24 13:21:08 +01:00
Stefan Rueger f17a012325
Update documentation for linuxspi extended parameter disable_no_cs 2022-09-24 00:16:55 +01:00
Stefan Rueger 097c78098d
Change printf() to avrdude_message() in linuxgio.c 2022-09-23 23:28:47 +01:00
Stefan Rueger ca154f812f
Improve error messaging in linuxspi.c 2022-09-23 16:53:52 +01:00
Stefan Rueger aa789d4662
Change error messages in linuxspi.c to maintain single style 2022-09-22 10:39:31 +01:00
Stefan Rueger 93df07866a
Inform user of -x disable_no_spi when needed (without -v) 2022-09-22 10:31:59 +01:00
Stefan Rueger d8ff9bef6c
Improve error messaging when part or programmer are invalid 2022-09-21 15:38:05 +01:00
Stefan Rueger 9e836d7988
Ensure avrdude.conf (programmer, part) pairs allow max one programming mode 2022-09-21 12:12:06 +01:00
Stefan Rueger 4c29edbc41
Warn if a part shares multiple programming modes with a programmer 2022-09-21 12:10:24 +01:00
Stefan Rueger 0175ffd21f
Shorten more redundant programmer description for -c \? -p part 2022-09-20 22:03:40 +01:00
Stefan Rueger 505d53c2e1
Shorten redundant for bootloader description in -c ? -p part output 2022-09-20 21:55:29 +01:00
Stefan Rueger b04a83b1a2
Document conditional options -c ? -p part and -p ? -c programmer 2022-09-20 21:39:15 +01:00
Stefan Rueger 97c5ac312a
Shorten redundant programmer description for -c \? -p part 2022-09-20 21:37:49 +01:00
Stefan Rueger 4070ca9012
Distinguish different JTAG programming modes 2022-09-20 18:36:46 +01:00
Shunichi Wakabayashi be40d3b260 add extended parameter "disable_no_sc" for linuxspi programmer 2022-09-20 01:32:12 +09:00