Commit Graph

4039 Commits

Author SHA1 Message Date
Stefan Rueger
816d1fd5cf Merge pull request #1830 from stefanrueger/show-avrintel
Add developer options /vcr to explore software compatibility of parts
2024-07-04 21:20:52 +01:00
Stefan Rueger
3ea386898e Merge pull request #1828 from stefanrueger/multi-memory-input
Multi-memory file handling
2024-07-04 17:17:47 +01:00
Stefan Rueger
7427a8e371 Remove -U/-T/-t heading when only one requested 2024-07-04 15:43:23 +01:00
Stefan Rueger
4f25cf8be6 Remove processing -U ... heading for backup/restore/verify 2024-07-04 15:33:36 +01:00
Stefan Rueger
2e1b66fb34 Add more documentation for memory lists 2024-07-04 11:24:13 +01:00
Stefan Rueger
2ad860a53a Remove unused code 2024-07-04 00:03:07 +01:00
Stefan Rueger
23e835b8a3 Document multi-memory files and dryrun options 2024-07-02 23:05:17 +01:00
Stefan Rueger
5cf2908a08 Warn when generating multi-memory list with unsuitable format
AVRDUDE will happily generate all sorts of file formats from multiple
memories, but only understands hex, srec and elf files.
2024-07-02 20:17:34 +01:00
Stefan Rueger
3aaa722f72 Inspect memory lists to decide whether initial chip erase is needed 2024-07-02 19:48:48 +01:00
Stefan Rueger
7647aaa4fc Show filename not pathname in -U warnings/errors 2024-07-01 00:55:33 +01:00
Stefan Rueger
dab725a343 Provide str_infilename() and str_outfilename() 2024-07-01 00:52:30 +01:00
Stefan Rueger
f1ff03d562 Change /mem to \mem for subtracting mem from list
/mem has the meaning of ALL\mem in set theory, which could cause confusion.
2024-07-01 00:30:46 +01:00
Stefan Rueger
b65c3c49b7 Fix reccount when writing srec files 2024-07-01 00:26:35 +01:00
Stefan Rueger
8a194719ba Remove unused variables 2024-07-01 00:26:01 +01:00
Stefan Rueger
c584f84a8e Move signature check into multi-memory file read 2024-07-01 00:18:55 +01:00
Stefan Rueger
cfaee38275 Provide avr_sig_compatible() 2024-06-30 23:53:52 +01:00
Stefan Rueger
3722abccd4 Provide str_ccmcunames_signature() 2024-06-30 22:39:53 +01:00
Stefan Rueger
5ac7c96958 Explicitly test for part being UPDI rather than assuming default 2024-06-30 22:37:37 +01:00
Stefan Rueger
30749c9673 Use PM_Classic instead of !(PM_PDI | PM_UPDI) 2024-06-29 09:00:45 +01:00
Stefan Rueger
7d70d5406f Change memory list syntax to mem0,mem1,-mem2,/mem3,...
... where -mem or /mem removes a memory from the list so far
2024-06-29 00:33:44 +01:00
Stefan Rueger
e3da82b1ec Mark output of /vcr dev options for automated processing 2024-06-28 16:35:54 +01:00
Stefan Rueger
95dac08ccd Add developer option /r for listing registers 2024-06-28 16:34:24 +01:00
Stefan Rueger
9a79a6866f Check dev_info() format at gnuc compile time 2024-06-28 13:54:30 +01:00
Stefan Rueger
e829a46a49 Add developer option /c for listing configuration options 2024-06-28 13:47:41 +01:00
Stefan Rueger
bcf88e13d7 Add developer option /v for listing interrupt vector names 2024-06-28 13:44:23 +01:00
Stefan Rueger
3990fdf84b Add only classic parts developer options /C 2024-06-28 11:54:15 +01:00
Stefan Rueger
13683c1546 Move developer options /c /r to /e /R 2024-06-28 11:52:49 +01:00
stefanrueger
b2ed09f73d Provide terminal verify <memlist> <file>[:format] 2024-06-27 18:21:04 +00:00
stefanrueger
5e846098c8 Provide terminal restore <memlist> <file>[:format] 2024-06-27 18:19:32 +00:00
stefanrueger
dd2a40f81d Provide terminal backup <memlist> <file>[:format] 2024-06-27 17:21:30 +00:00
stefanrueger
a02995749c Utilise fileio_format_with_errmsg() in parse_op() 2024-06-27 17:20:23 +00:00
stefanrueger
485ad6de91 Provide fileio_format_with_errmsg() 2024-06-27 17:15:01 +00:00
stefanrueger
bc0c1a0499 Fix Windows complaint about missing random()/srandom() 2024-06-26 16:49:10 +00:00
stefanrueger
42081e5606 Initialise memories on -c dryrun -xinit or -xrandom
$ avrdude -c dryrun -xhelp
avrdude -c dryrun extended options:
  -xinit     Initialise memories with human-readable patterns (1, 2, 3)
  -xrandom   Initialise memories with random code/values (1, 3)
  -xseed=<n> Seed random number generator with <n>, default time(NULL)
  -xhelp     Show this help menu and exit
Notes:
  (1) -xinit and -xrandom randomly configure flash wrt boot/data/code length
  (2) Patterns can best be seen with fixed-width font on -U flash:r:-:I
  (3) Choose, eg, -xseed=1 for reproducible flash configuration and output

For example:

$ avrdude -c dryrun -p 16eb28 -xinit -xseed=7 -UALL:r:backup-dry.hex:I

backup-dry.hex will be a human-readable multi-memory .hex file for testing
that has memories initialised with non-trivial contents. Great care has
been taken that the generated flash code is valid and benign, ie, it won't
touch I/O peripherals, SRAM or flash.

Can be restored with

$ avrdude -cdryrun -p 16eb28 -U ALL:w:backup-dry.hex
2024-06-26 16:22:48 +00:00
Stefan Rueger
76353b8218 Provide str_is_in_list() 2024-06-25 14:33:00 +01:00
Stefan Rueger
9a834c37c7 Update avrintel.c 2024-06-25 12:06:49 +01:00
Stefan Rueger
41eacd0eed Fix flash page size for x128a4 2024-06-25 12:04:25 +01:00
Stefan Rueger
ad312b985a Fix boot_section_size for x128a4 2024-06-25 01:04:05 +01:00
Stefan Rueger
f06b3dd5b9 Fix boot_section_size for AVR-Ex parts 2024-06-25 00:08:54 +01:00
Stefan Rueger
d4d6835bdf Fix dryrun's paged write to XMEGA overlapping flash memories 2024-06-24 17:28:22 +01:00
Stefan Rueger
f3fbb2eb1d Default -U multi-memory backups to Intel Hex with comments 2024-06-24 00:24:29 +01:00
Stefan Rueger
1a2ac74a7b Label segments with memory names in .hex:I output files 2024-06-23 20:50:31 +01:00
Stefan Rueger
9bf11fd67a Make sigs argument of str_mcunames_signature() const 2024-06-23 20:38:20 +01:00
Stefan Rueger
eb412304ee Provide avr_locate_uP() 2024-06-22 12:31:59 +01:00
Stefan Rueger
23324622d9 Formalise multi-memory address layout 2024-06-22 00:33:26 +01:00
Stefan Rueger
06b64bf9fb Provide ALL memory (all + sub-memories excluded from all) 2024-06-21 21:40:02 +01:00
Stefan Rueger
9a446ec0bb Check signature of part against multi-memory file signature
... to avoid tears when mistakenly restoring a backup from another part

$ avrdude -c dryrun -p t167 -U all:r:backup.hex:I

avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9487 (probably t167)

avrdude: processing -U all:r:backup.hex:r
         reading multiple memories ...
         eeprom      | ################################################## | 100% 0.00s
         flash       | ################################################## | 100% 0.00s
         lfuse       | ################################################## | 100% 0.00s
         hfuse       | ################################################## | 100% 0.00s
         efuse       | ################################################## | 100% 0.00s
         lock        | ################################################## | 100% 0.00s
         signature   | ################################################## | 100% 0.00s
         calibration | ################################################## | 100% 0.00s
         writing 16904 bytes to output file backup.hex

avrdude done.  Thank you.

$ avrdude -c urclock -p m328p -b 115200 -P /dev/ttyUSB0 -U all:v:backup.hex:I

avrdude -c urclock -p m328p -b 115200 -P /dev/ttyUSB0 -U all:v:backup.hex
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e950f (probably m328p)

avrdude: processing -U all:v:backup.hex:i
avrdude: verifying 16904 bytes of multiple memories against input file backup.hex
avrdude error: signature of ATmega328P does not match file (ATtiny167, ATA5505, ATA6617C, ATA664251)
        use -F to override this check

avrdude done.  Thank you.

$ avrdude -c dryrun -p m328p -U all:w:backup.hex:I -F

avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e950f (probably m328p)

avrdude: processing -U all:w:backup.hex:I
avrdude: reading 16904 bytes for multiple memories from input file backup.hex
avrdude: 512 bytes eeprom in 1 section [0, 0x1ff]: 128 pages and 0 pad bytes
         writing 512 bytes to eeprom ...
         writing | ################################################## | 100% 0.00s
         reading | ################################################## | 100% 0.00s
         512 bytes of eeprom verified
avrdude: 16384 bytes flash in 1 section [0, 0x3fff]: 128 pages and 0 pad bytes
         writing 16384 bytes to flash ...
         writing | ################################################## | 100% 0.00s
         reading | ################################################## | 100% 0.00s
         16384 bytes of flash verified
avrdude: 1 byte lfuse in 1 section [0, 0]
         writing 1 byte to lfuse (0x62), 1 byte written, 1 verified
avrdude: 1 byte hfuse in 1 section [0, 0]
         writing 1 byte to hfuse (0xdf), 1 byte written, 1 verified
avrdude: 1 byte efuse in 1 section [0, 0]
         writing 1 byte to efuse (0xff), 1 byte written, 1 verified
avrdude: 1 byte lock in 1 section [0, 0]
         writing 1 byte to lock (0xff), 1 byte written, 1 verified

avrdude done.  Thank you.
2024-06-19 00:33:44 +01:00
Stefan Rueger
392ccf8814 Specify memory name in verfication error 2024-06-19 00:28:22 +01:00
Stefan Rueger
b366078e6a Provide str_mcunames_signature() 2024-06-19 00:27:26 +01:00
Stefan Rueger
0e4d8fd483 Allow etc to be used in lieu of all in memory lists 2024-06-18 22:53:52 +01:00