adding code that allows read-only memories to appear written successfully
provided the data to be written is already in the memory. This is useful
so that "writing" a backup to read-only memories works
- Without generating an error
- Without actually trying to write to the part
Trying to write a read-only memory with a byte that is not there will
cause a write error. This is useful if for example one tries to write a
backup of a part to another part with different signature. If the
signature is written back first, this constitutes a "check we are writing
to the same type of part".
This is from @mariusgreuel in Issue #1249.
https://github.com/avrdudes/avrdude/issues/1249
> The WIN32 time-out is specified as ReadTotalTimeoutConstant + buflen * ReadTotalTimeoutMultiplier, which makes it potentially much longer than the Posix one (i.e. at least double). ReadIntervalTimeout is also set to timeout, which essentially renders the interval timeout ineffective, so IMHO, we should explicitly disable that feature.
Rather than finding memories by name this finds memories by the correct
type further separating memory names from their functionality.
Also fixes a few unchecked avr_locate_mem() calls that could lead to
segmentation faults.
The name memtype can mean different things in the AVRDUDE src.
Mostly it means the name string of the memory, eg, "flash" or
"eeprom"; sometimes it is a character designating a memory, eg, 'E'
for "eeprom"; and yet at other times it means a programmer-defined
memory type, eg, MTYPE_BOOT_FLASH. The occurrences of memtype in
the code have now neen renamed appropriately.
The RDY LED is set once the programmer is initialised and switched
off when AVRDUDE exits. During reading, writing or erasing the target
the PGM LED flashes with around 2.5 Hz, whilst the VFY LED comes on
during -U verification of the uploaded contents. Errors are indicated
with the ERR LED.
Assuming AVRDUDE got to the point where LEDs are accessible and the RDY
LED was switched on then, on exit, AVRDUDE will leave the LEDs in the
following states:
| PGM | VFY | ERR | Semantics |
| --- | --- | --- | ------------------------------------------------ |
| off | off | off | OK: all tasks done without errors |
| off | off | on | Some error not related to read/write/erase |
| on | off | on | Read/write/erase error |
| off | on | on | Verification error but no read/write/erase error |
| on | on | on | Read/write/erase error and verification error |
Other combinations should not show after exit.