The JTAG ICE mkII couples CMND_LEAVE_PROGMODE with re-attaching the
on-chip debug system. On a part with the OCDEN fuse unprogrammed -- the
required state of every shipped product -- that attach cannot succeed
and the ICE answers RSP_FAILED although all memory operations completed.
Bench-isolated on an AT90CAN128: identical command bytes, only the
stored OCDEN fuse value decides OK vs FAILED (lock bits ruled out).
Issue the recovery reset first and report a notice when it succeeds;
keep the error only for the case where the reset fails too, since that
is the only outcome that actually leaves the target dead.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Mh2GBGBjSKBTr3Lrxo2fa
Fix issue #2149:
* sort memory regions while reading config file so list always yields the same order
* use `avr_mem_name()` to display the memory regions
As suggested, sort the memory sections into order right after reading
the config file, so all consumers of the library will later see them
in the same order.
As Microchip introduces new AVR families, they seem to follow now the
scheme to have "AVR", the number of KiB flash, two letters, and the
number of pins of the device. Extend the regular expression to match
these (and thus also future devices) when displaying the device
selection groups.
AVR-LA devices have 10 fuses, yet the GUI so far only had entries for
(up to) 9 fuses. Thus, selecting an AVR-LA device, it eventually
threw an exception for trying to touch GUI elements that don't exist.
Signature display fiddles a bit with stylesheets, deviating from standard
text attributes, in order to inform about signature mismatch. Adapt this
for darkmode operation.
The GUI device selection dialog roughly classifies individual
AVRs, to allow restricting the selection box. For the new
AVR-LA devices, it makes sense to group them to the AVR-D* and
AVR-E* devices, instead of falling back to "Other".
The cleanliness and consistency of avrdude.conf owes much to AVRDUDE's
ability to print its own understanding of avrdude.conf entries using
developer options -c*/s and -p*/s.
Unfortunately, comments around memory entries are lost when using these
options, so it's better to not put them into the configuration.
The type component of the programmer structure can be, and on a number of
occasions has been, confused with the type component of the avrdude.conf
file. The latter is solely used to set the initpgm component. The former
is an internally used structure component that the user does not see.
Hence it is justified, and desirable, to rename the type component of the
programmer to avoid future confusion.
The type component of the programmer is set at runtime. As such it does
not need to be part of the raw dump of the configuration values for the
developer option -c*/r. As the type component is not used in the raw dump,
the removed code does not serve a purpose.