Commit Graph
100 Commits
Author SHA1 Message Date
Stefan Rueger 607f0c48be Merge pull request #1188 from stefanrueger/not-all-is-nor-memory
Pad pages with input file contents before avr_write()
2022-11-25 17:40:11 +00:00
Stefan Rueger 7269370bf6 Change notices about libreadline presence in urclock.c 2022-11-25 13:58:11 +00:00
Stefan Rueger 8e79b7dc52 Fix error detection for reading a page to pad unset bytes 2022-11-24 12:16:43 +00:00
Stefan Rueger 68c6ffd7fc Silence compiler warnings, change comments, remove typos 2022-11-24 12:14:54 +00:00
Stefan Rueger afa57ace84 Merge pull request #1196 from mcuee/disable_readline_msvc
Disable GNU Readline for MSVC build
2022-11-24 10:13:51 +00:00
Stefan Rueger b925b5113d Silence compiler warnings 2022-11-22 21:49:26 +00:00
Stefan Rueger 25ca91371d Pad pages with input file contents before avr_write() 2022-11-22 21:32:42 +00:00
Stefan Rueger 883d9494c8 Silence compiler warnings for urclock.c 2022-11-22 01:39:27 +00:00
Stefan Rueger 05d78828e0 Update NEWS 2022-11-22 01:29:07 +00:00
Stefan Rueger eee17ab096 Merge pull request #1187 from mcuee/revert_pr1156
Revert PR #1156
2022-11-22 01:19:10 +00:00
Stefan Rueger ef824d4d89 Merge pull request #1184 from mcuee/cmake_print_readline
Print HAVE_LIBREADLINE status
2022-11-22 01:18:56 +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 3400527c7d Merge pull request #1174 from stefanrueger/default_programmer
Ensure default_programmer from config files is used
2022-11-22 01:17:55 +00:00
Stefan Rueger 02e02be6f9 Merge pull request #1171 from stefanrueger/urclock
Provide Urclock programmer
2022-11-22 01:13:57 +00:00
Stefan Rueger 2063671a02 Merge pull request #1147 from mcuee/Xplained_Pro_PDI
Add xplainedpro_pdi programmer
2022-11-22 01:13:23 +00:00
Stefan Rueger f9aea24fba Reduce drain timeout value for Windows in urclock.c 2022-11-22 00:49:34 +00:00
Stefan Rueger 2e398916a7 Hash known bootloaders for urclock; they don't need -xbootsize=.... 2022-11-22 00:47:26 +00:00
Stefan Rueger 7f4474f049 Delete previous metadata when writing new file to flash in urclock 2022-11-20 13:02:51 +00:00
Stefan Rueger c0e4dd494e Use file basename in -c urclock metadata under WIN32 2022-11-20 01:48:39 +00:00
Stefan Rueger 53de22cb83 Update avrintel.c for LGT8F(8|16|32)8P parts 2022-11-20 01:12:14 +00:00
Stefan Rueger f276d325ec Handle verification errors in read only memory areas gracefully 2022-11-20 00:27:49 +00:00
Stefan Rueger ee25a62df6 Emulate chip erase in terminal when pgm->chip_erase() soft fails 2022-11-19 23:09:18 +00:00
Stefan Rueger d65a9a3cee Adapt -c urclock to new reset vector protection in urboot v7.7 2022-11-19 19:39:39 +00:00
Stefan Rueger a3eeedd176 Silence some compiler warnings 2022-11-16 02:32:32 +00:00
Stefan Rueger 2abb666bd2 Prepare urclock for autobaud synchronisation 2022-11-16 02:08:13 +00:00
Stefan Rueger d901e0a768 Update urbootPutVersion() to reflect urboot v7.7 changes 2022-11-16 00:42:36 +00:00
Stefan Rueger 82b9491cbd Harden urclock against bootloader bricking
- Detect write restrictions with new pgm->readonly(..., addr)
 - Check in byte-wise cached write whether mem/addr allows write
 - Emulated chip erase tells user CE is delayed until first -U
 - After bootloader CE urclock_chip_erase will init reset vector
 - Low level paged write @ 0 unconditionally protects reset vector
 - Low level paged read @ 0 checks and repairs reset vector
2022-11-16 00:08:46 +00:00
Stefan Rueger afc2f7cf0c Hint at option -xdelay=... for urclock programmer not responding messages 2022-11-12 13:47:48 +00:00
Stefan Rueger ff9c8bbe46 Silence min()/max() compiler warnings, fix urclock.c typo etc 2022-11-12 13:32:53 +00:00
Stefan Rueger e2b69dec75 Remove MacOS compiler warnings for urclock.c 2022-11-12 01:12:31 +00:00
Stefan Rueger b178deef5f Handle n_page_erase in urclock for parts t441, t841 and t1634 2022-11-11 01:33:42 +00:00
Stefan Rueger 6e3a99be87 Add write statistics for patched flash input files at notice2 level 2022-11-11 01:27:55 +00:00
Stefan Rueger 22bd977365 Indent erasing chip message in main 2022-11-10 23:18:43 +00:00
Stefan Rueger c67bfe39a3 Show input file staistics before patching in update.c 2022-11-10 23:00:18 +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 4c4952d4f6 Ensure default_programmer from config files is used 2022-11-10 18:20:13 +00:00
Stefan Rueger afa408e2c6 Make urclock.c iron out a bug in some bootloaders 2022-11-09 21:00:16 +00:00
Stefan Rueger d5d0b940cc Harden vector bootloaders more against reset overwrites 2022-11-09 19:28:29 +00:00
Stefan Rueger 84a3e2cc2b Fix avr.c comment 2022-11-09 19:27:34 +00:00
Stefan Rueger c7ba53bca0 Harden urclock against terminal time outs and vector overwrites 2022-11-09 16:16:59 +00:00
Stefan Rueger ea65918dca Omit verify after write failure in term.c 2022-11-09 15:43:57 +00:00
Stefan Rueger 20b86fb739 Warn in uclock when bootloader cannot read/write memories 2022-11-08 20:16:05 +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 715db4c690 Make -A default for urclock programmer 2022-11-07 02:43:34 +00:00
Stefan Rueger 21d93ec8cb Update urclock programmer 2022-11-07 01:26:47 +00:00
Stefan Rueger e6c26d8db4 Provide urclock programmer 2022-11-06 01:29:07 +00:00
Stefan Rueger 4c92030e3a Update NEWS 2022-11-01 18:20:06 +00:00
Stefan Rueger d211c4e5f5 Merge pull request #1164 from MCUdude/hvupdi-type2-fix
Fix Type 2 HV UPDI
2022-11-01 18:17:52 +00:00
Stefan Rueger 02fe08aed2 Open programmer before allocating part
So any programmer that knows exactly which part it is connected to
can set the -p part option should the user not have done so.

Also no longer exits main without closing open programmer.
2022-11-01 18:12:00 +00:00
Stefan Rueger b5699663c4 Update NEWS 2022-10-29 11:05:25 +01:00
Stefan Rueger 50046da923 Merge pull request #1151 from dbuchwald/serialupdi_page_erase
Implementation of SerialUPDI page erase operation
2022-10-29 11:02:17 +01:00
Stefan Rueger a3c04d294e Merge pull request #1156 from mcuee/readline_macos
Readline macos
2022-10-29 11:00:06 +01:00
Stefan Rueger d87eb14dc9 Make -p variable partdesc global 2022-10-29 10:55:58 +01:00
Stefan Rueger 87df3216cb Make fileio() and do_op() arguments const where possible 2022-10-29 10:48:47 +01:00
Stefan Rueger a1018999c4 Correct plural for message writing %d bytes in term.c 2022-10-26 08:42:03 +01:00
Stefan Rueger 418cf08e84 Change avrdude.conf.in comment on location of per-user config file 2022-10-25 18:13:28 +01:00
Stefan Rueger 1dba916e06 Update NEWS 2022-10-23 23:33:56 +01:00
Stefan Rueger 3769332afd Merge pull request #1142 from MCUdude/stk600-pdi
STK600 supports programming using PDI
2022-10-23 23:10:10 +01:00
Stefan Rueger ec1e7156bd Merge pull request #1154 from avrdudes/revert-1148-readline_mingw
Revert "Add readline for MSYS2 mingw32/mingw64 build"
2022-10-23 23:09:18 +01:00
Stefan Rueger 960bf7b959 Revert "Add readline for MSYS2 mingw32/mingw64 build" 2022-10-23 23:04:16 +01:00
Stefan Rueger 0ebf220315 Merge pull request #1148 from mcuee/readline_mingw
Add readline for MSYS2 mingw32/mingw64 build
2022-10-23 22:42:10 +01:00
Stefan Rueger b1b4a180ba Merge pull request #1146 from mcuee/readline_action
Add libreadline-dev for Linux github action build
2022-10-23 22:39:54 +01:00
Stefan Rueger ae5b460859 Merge pull request #1141 from stefanrueger/paged
Always use paged access for programmers that serve bootloaders
2022-10-23 22:33:31 +01:00
Stefan Rueger baaad71aa5 Support optiboot, optiboot_dx and optiboot_x bootloaders for -c arduino (#1140)
* If bootloaders are served, send word addresses for classic parts and
  byte addresses for newer parts, eg, UPDI and PDI
* Load ext addr for stk500v1 bootloaders after grazing 64k boundaries
* Fix bootloader stk500v1 EEPROM r/w for classic parts with page size 1
2022-10-23 22:32:29 +01: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
Stefan Rueger 4f6bab6303 Merge pull request #1138 from MCUdude/pic-detect-mode-cherry
Detect PICkit4 and SNAP in PIC mode
2022-10-23 21:57:26 +01:00
Stefan Rueger 5b008a04cf Revamp terminal output: progress bar, callback and stdout/stderr (#1132)
* Print parms output to stdout
* Flush terminal writes and other minor changes
* Prepare terminal for periodic calls to programmer to reset bootloader WDT
* Only show progress reports for memories > 32 bytes or on -vv
* Freeze progress bar on serious error
* Allow cached r/w byte routines to be used in pgm->read_byte and pgm->write_byte
2022-10-23 21:56:45 +01:00
Stefan Rueger b9396bcd02 Always use paged access for programmers that serve bootloaders 2022-10-21 00:56:43 +01:00
Stefan Rueger b864d7e73a Update NEWS and resolve minor residual messaging issues 2022-10-17 16:39:45 +01:00
Stefan Rueger e172877724 Review and overhaul AVRDUDE's messaging system (#1126)
* Change avrdude_message(MSG_XYZ, ...) to msg_xyz(...)
* Define and use pmsg_xyz(...) instead of msg_xyz("%s: ...", progname, ...)
* Review and change avrdude_message() levels
   - Introduce new levels warning, error and ext_error
   - Distribute info level to info, warning, error, ext_error
   - Assign levels (more) consistently
   - Unify grammar, punctuation and style of messages
* Use imsg_xyz() to print indented messages
* Show function name in errors and warnings on -v
* Reduce effective verbosity level by number of -q above one
2022-10-17 15:44:55 +01:00
Stefan Rueger 2503ae03ce Merge pull request #1125 from MCUdude/updi-lock-fix
Fix UPDI erase when target is locked
2022-10-17 14:17:32 +01:00
Stefan Rueger ff1d26ad18 Merge pull request #1122 from mariusgreuel/pr-teensy-warning
Suppress Teensy USB communication error message on reboot
2022-10-17 14:17:07 +01:00
Stefan Rueger 8e879cfae6 Merge pull request #1121 from stefanrueger/avr_cache
Use byte-wise read/write when page size is 1 in terminal cache
2022-10-17 14:16:43 +01:00
Stefan Rueger 08f4f6c63f Merge pull request #1112 from MCUdude/jtag3-page-erase-updi
Fix jtag3_page_erase for targets with UPDI
2022-10-17 14:12:17 +01:00
Stefan Rueger 714c2fbf95 Rename variable for clarity in avrcache.c 2022-10-12 15:55:22 +01:00
Stefan Rueger 8a3864d263 Fall back on bytewise r/w if paged access fails for avr cache 2022-10-12 15:53:54 +01:00
Stefan Rueger 48919f59b3 Use byte-wise read/write when page size is 1 in terminal cache 2022-10-11 15:31:18 +01:00
Stefan Rueger e14e5d2f74 Update NEWS 2022-10-11 14:49:44 +01:00
Stefan Rueger 929441eb82 Merge pull request #1119 from mariusgreuel/pr-pointer-truncation
Fix pointer truncation for Windows x64
2022-10-11 14:43:41 +01:00
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
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
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