Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PK5 ISP, dW, TPI, JTAG and theoretical PDI support #1935

Merged
merged 17 commits into from
Feb 5, 2025

Conversation

MX682X
Copy link
Contributor

@MX682X MX682X commented Nov 23, 2024

Chips I tested with test-avrdude successfully:
328p with dw/isp
atmega32u4 with jtag/isp
Attiny9 with tpi

A couple of caveats I noticed:
debugWire had sometimes trouble writing higher flash addresses, but it was inconsistent. Couldn't tell why (tested with 328p). An increase of the page size seemed to mitigate the problem.

JTAG can't rewrite EEPROM, at least on 32u4, so a test was failing there. To write a new value, a chip erase is needed, but this is also pointed out in the datasheet.

As I don't have an xmega, I couldn't test the xmega jtag nor PDI, but it looked so similar to UPDI that I guess it should work.

@mcuee mcuee added the enhancement New feature or request label Nov 23, 2024
@MCUdude
Copy link
Collaborator

MCUdude commented Nov 24, 2024

It's incredibly cool to see full support for the PICkit5!

I just ran test8 with an ATmega64 using ISP and JTAG using a PICkit4 in PIC mode.

$ ./test8 pickit5_isp atmega64

Processing -U ALL:r:bak-pickit5_isp-atmega64.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.91 s 
 - flash          | ################################################## | 100% 20.67 s 
 - lfuse          | ################################################## | 100% 0.00 s 
 - hfuse          | ################################################## | 100% 0.00 s 
 - efuse          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | -------------------------------------------------- | 0% 0.00 s 
Error: unsupported memory prodsig
Error: unable to read byte at address 0x0000
Error: read operation failed for memory prodsig
Warning: unable to read prodsig/sigrow (ret = -3), skipping...
 - sernum         | -------------------------------------------------- | 0% 0.00 s 
Error: unsupported memory sernum
Error: unable to read byte at address 0x0000
Error: read operation failed for memory sernum
Warning: unable to read sernum (ret = -3), skipping...
 - calibration    | ################################################## | 100% 0.01 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 67595 bytes to output file bak-pickit5_isp-atmega64.hex

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs

$ ./test8 pickit5_jtag atmega64

Processing -U ALL:r:bak-pickit5_jtag-atmega64.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 1.35 s 
 - flash          | ################################################## | 100% 20.57 s 
 - lfuse          | ################################################## | 100% 0.00 s 
 - hfuse          | ################################################## | 100% 0.00 s 
 - efuse          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | -------------------------------------------------- | 0% 10.00 s 
Error: reading data memory failed
Error: unable to read byte at address 0x0000
Warning: unable to read prodsig/sigrow (ret = -2), skipping...
 - sernum         | -------------------------------------------------- | 0% 10.00 s 
Error: reading from PICkit failed
Error: unexpected read response
Error: unable to read byte at address 0x0000
Warning: unable to read sernum (ret = -2), skipping...
 - calibration    | -------------------------------------------------- | 0% 10.00 s 
Error: reading from PICkit failed
Error: unexpected read response
Error: unable to read byte at address 0x0000
Warning: unable to read calibration (ret = -2), skipping...
 - signature      | ################################################## | 100% 0.00 s 
Writing 67591 bytes to output file bak-pickit5_jtag-atmega64.hex
Error: reading from PICkit failed
Error: could not end programming, aborting
Error: wrote -60 out of 29 bytes, err = Operation timed out
Error: Sending script failed
Error: sending script failed

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs

@MCUdude
Copy link
Collaborator

MCUdude commented Nov 24, 2024

PICkit5 in PDI mode:

$ ./test8 pickit5_pdi atxmega128a3u

Processing -U ALL:r:bak-pickit5_pdi-atxmega128a3u.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.65 s 
 - flash          | ################################################## | 100% 15.16 s 
 - application    | ################################################## | 100% 14.10 s 
 - apptable       | ################################################## | 100% 0.89 s 
 - boot           | ################################################## | 100% 0.89 s 
 - fuses          | ################################################## | 100% 0.04 s 
 - fuse0          | ################################################## | 100% 0.01 s 
 - fuse1          | ################################################## | 100% 0.01 s 
 - fuse2          | ################################################## | 100% 0.01 s 
 - fuse4          | ################################################## | 100% 0.01 s 
 - fuse5          | ################################################## | 100% 0.01 s 
 - lock           | ################################################## | 100% 0.01 s 
 - prodsig/sigrow | ################################################## | 100% 0.31 s 
 - calibration    | ################################################## | 100% 0.02 s 
 - sernum         | ################################################## | 100% 0.09 s 
 - tempsense      | ################################################## | 100% 0.01 s 
 - usersig        | ################################################## | 100% 0.06 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 289368 bytes to output file bak-pickit5_pdi-atxmega128a3u.hex

Processing -T fact reset
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
Caching | ################################################## | 100% 0.75 s 
Caching | ################################################## | 100% 0.05 s 
Caching | ################################################## | 100% 0.06 s 
Synching cache to device ... done
after the next reset the part will have F_CPU = 2.000 MHz

Processing -U ALL:w:bak-pickit5_pdi-atxmega128a3u.hex:I
Reading 141887 bytes for multiple memories from input file bak-pickit5_pdi-atxmega128a3u.hex
Writing 2048 bytes to eeprom
Writing | ################################################## | 100% 0.97 s 
Reading | ################################################## | 100% 0.58 s 
2048 bytes of eeprom verified
Writing 139264 bytes to flash
Writing | ################################################## | 100% 18.63 s 
Reading | ################################################## | 100% 14.98 s 
Warning: flash verification mismatch
  device 0xff != input 0xcf at addr 0x21ffd (error)
Error: flash verification mismatch
Writing 131072 bytes to application
Writing | ################################################## | 100% 17.67 s 
Reading | ################################################## | 100% 14.11 s 
131072 bytes of application verified
Writing 8192 bytes to apptable
Writing | ################################################## | 100% 1.10 s 
Reading | ################################################## | 100% 0.88 s 
8192 bytes of apptable verified
Writing 8192 bytes to boot
Writing | ################################################## | 100% 0.96 s 
Reading | ################################################## | 100% 0.89 s 
Warning: boot verification mismatch
  device 0xff != input 0xcf at addr 0x1ffd (error)
Error: boot verification mismatch
Writing 7 bytes to fuses, 7 bytes written, 7 verified
Writing 1 byte (0xFF) to fuse0, 1 byte written, 1 verified
Writing 1 byte (0x00) to fuse1, 1 byte written, 1 verified
Writing 1 byte (0xFF) to fuse2, 1 byte written, 1 verified
Writing 1 byte (0xFE) to fuse4, 1 byte written, 1 verified
Writing 1 byte (0xFF) to fuse5, 1 byte written, 1 verified
Writing 1 byte (0xFF) to lock, 1 byte written, 1 verified
Writing 512 bytes to usersig
Writing | ################################################## | 100% 0.07 s 
Reading | ################################################## | 100% 0.06 s 
512 bytes of usersig verified

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs
performing chip erase; discarded pending writes to flash and EEPROM
after the next reset the part will have F_CPU = 2.000 MHz

PICkit5 in XMEGA JTAG mode

$ ./test8 pickit5_jtag atxmega256a3bu

Processing -U ALL:r:bak-pickit5_jtag-atxmega256a3bu.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 1.33 s 
 - flash          | ################################################## | 100% 29.12 s 
 - application    | ################################################## | 100% 28.26 s 
 - apptable       | ################################################## | 100% 0.89 s 
 - boot           | ################################################## | 100% 0.88 s 
 - fuses          | ################################################## | 100% 0.04 s 
 - fuse0          | ################################################## | 100% 0.01 s 
 - fuse1          | ################################################## | 100% 0.01 s 
 - fuse2          | ################################################## | 100% 0.01 s 
 - fuse4          | ################################################## | 100% 0.01 s 
 - fuse5          | ################################################## | 100% 0.01 s 
 - lock           | ################################################## | 100% 0.01 s 
 - prodsig/sigrow | ################################################## | 100% 0.31 s 
 - calibration    | ################################################## | 100% 0.01 s 
 - sernum         | -------------------------------------------------- | 0% 10.00 s 
Error: reading data memory failed
Error: unable to read byte at address 0x0000
Warning: unable to read sernum (ret = -2), skipping...
 - tempsense      | -------------------------------------------------- | 0% 10.00 s 
Error: reading data memory failed
Error: unable to read byte at address 0x0000
Warning: unable to read tempsense (ret = -2), skipping...
 - usersig        | -------------------------------------------------- | 0% 10.13 s 
Error: reading data memory failed
Error: reading data memory failed
Error: unable to read byte at address 0x0000
Warning: unable to read usersig (ret = -2), skipping...
 - signature      | ################################################## | 100% 0.00 s 
Writing 553032 bytes to output file bak-pickit5_jtag-atxmega256a3bu.hex
Error: reading from PICkit failed
Error: could not end programming, aborting
Error: reading from PICkit failed
Error: reading script response failed

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs

@MCUdude
Copy link
Collaborator

MCUdude commented Nov 24, 2024

Output from test-avrdude:

$ ./test-avrdude -p "-cpickit5_isp -patmega64"
Testing /usr/local/bin/avrdude 8.0-20241123 (fbffbf7a)
Prepare "-cpickit5_isp -patmega64" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.316 s: fuse access: clear, set and read eesave fuse bit
✅   0.311 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.551 s: chip erase
✅   8.111 s: flash -U write/verify holes_rjmp_loops_65536B.hex
✅   3.865 s: flash -T write/verify holes_rjmp_loops_65536B.hex
✅   1.017 s: eeprom check whether programmer can flip 0s to 1s
✅   5.182 s: eeprom -U write/verify holes_pack_my_box_2048B.hex
✅  10.142 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_2048B.hex
✅   4.178 s: chip erase and spot check flash is actually erased
✅   0.544 s: spot check eeprom is erased, too

$ ./test-avrdude -p "-cpickit5_pdi -patxmega128a3u"
Testing /usr/local/bin/avrdude 8.0-20241123 (fbffbf7a)
Prepare "-cpickit5_pdi -patxmega128a3u" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.322 s: fuse access: clear, set and read eesave fuse bit
✅   0.280 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.571 s: chip erase
✅   6.274 s: flash -U write/verify holes_rjmp_loops_139264B.hex
✅   2.829 s: flash -T write/verify holes_rjmp_loops_139264B.hex
❌   0.349 s: eeprom check whether programmer can flip 0s to 1s (failed command below)
$ avrdude -qq -cpickit5_pdi -patxmega128a3u -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅  22.488 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_2048B.hex
✅   3.124 s: chip erase and spot check flash is actually erased
✅   0.436 s: spot check eeprom is erased, too
✅   0.767 s: usersig -T/-U write/read random_data_512B.bin

$ ./test-avrdude -p "-cpickit5_pdi -patxmega256a3bu"
Testing /usr/local/bin/avrdude 8.0-20241123 (fbffbf7a)
Prepare "-cpickit5_pdi -patxmega256a3bu" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.325 s: fuse access: clear, set and read eesave fuse bit
✅   0.283 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.605 s: chip erase
✅  11.328 s: flash -U write/verify holes_rjmp_loops_270336B.hex
✅   5.149 s: flash -T write/verify holes_rjmp_loops_270336B.hex
❌   0.347 s: eeprom check whether programmer can flip 0s to 1s (failed command below)
$ avrdude -qq -cpickit5_pdi -patxmega256a3bu -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅  43.637 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_4096B.hex
✅   5.527 s: chip erase and spot check flash is actually erased
✅   0.583 s: spot check eeprom is erased, too
✅   0.762 s: usersig -T/-U write/read random_data_512B.bin

$ ./test-avrdude -p "-cpickit5_jtag -patxmega256a3bu"
Testing /usr/local/bin/avrdude 8.0-20241123 (fbffbf7a)
Prepare "-cpickit5_jtag -patxmega256a3bu" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.307 s: fuse access: clear, set and read eesave fuse bit
✅   0.278 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.567 s: chip erase
✅  11.185 s: flash -U write/verify holes_rjmp_loops_270336B.hex
✅   5.137 s: flash -T write/verify holes_rjmp_loops_270336B.hex
❌   0.333 s: eeprom check whether programmer can flip 0s to 1s (failed command below)
$ avrdude -qq -cpickit5_jtag -patxmega256a3bu -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅  43.447 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_4096B.hex
✅   5.493 s: chip erase and spot check flash is actually erased
✅   0.580 s: spot check eeprom is erased, too
✅   0.761 s: usersig -T/-U write/read random_data_512B.bin


$ ./test-avrdude -p "-cpickit5_jtag -patmega645"
Testing /usr/local/bin/avrdude 8.0-20241123 (fbffbf7a)
Prepare "-cpickit5_jtag -patmega645" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.340 s: fuse access: clear, set and read eesave fuse bit
✅   0.321 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.689 s: chip erase
✅   8.083 s: flash -U write/verify holes_rjmp_loops_65536B.hex
✅   3.860 s: flash -T write/verify holes_rjmp_loops_65536B.hex
❌   0.464 s: eeprom check whether programmer can flip 0s to 1s (failed command below)
$ avrdude -qq -cpickit5_jtag -patmega645 -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅  38.860 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_2048B.hex
✅   4.216 s: chip erase and spot check flash is actually erased
✅   0.664 s: spot check eeprom is erased, too

$ ./test-avrdude -p "-cpickit5_isp -pattiny13"
Testing /usr/local/bin/avrdude 8.0-20241123 (fbffbf7a)
Prepare "-cpickit5_isp -pattiny13" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.325 s: fuse access: clear, set and read eesave fuse bit
✅   0.304 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.403 s: chip erase
✅   0.615 s: flash -U write/verify holes_rjmp_loops_1024B.hex
✅   0.413 s: flash -T write/verify holes_rjmp_loops_1024B.hex
✅   0.447 s: eeprom check whether programmer can flip 0s to 1s
✅   0.464 s: eeprom -U write/verify holes_pack_my_box_64B.hex
✅   0.586 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_64B.hex
✅   0.507 s: chip erase and spot check flash is actually erased
✅   0.340 s: spot check eeprom is erased, too

The ATtiny15 is a difficult one. I'm not even sure it's supported by the PICkit5, but I gave it a try anyways. Results below:

$ avrdude -cpickit5_isp -pattiny15 -B32 -t
avrdude> c
config cksel=slowpwrx00 # 0
config rstdisbl=external_reset # 1
config spien=isp_enabled # 0
config boden=bod_disabled # 1
config bodlevel=bod_4v0 # 0
config lb=no_lock # 3
avrdude> read flash
Reading | -------------------------------------------------- | 0% 10.12 s 
Error: reading data memory failed
Error: unable to read flash page at addr 0x0000
Error: (read) error reading flash address 0x00000 of part ATtiny15
avrdude> read fuse
Reading | -------------------------------------------------- | 0% 10.11 s 
Error: reading from PICkit failed
Error: reading script response failed
Error: Read Fuse Script failed
Error: (read) error reading fuse address 0x00000 of part ATtiny15
avrdude> read eeprom
Reading | ########################-------------------------- | 48% 0.08 s 
Error: unexpected response
Error: sending script done message failed
Error: unexpected response
Error: unexpected read response
Error: unable to read eeprom page at addr 0x0020
Error: (read) error reading eeprom address 0x00020 of part ATtiny15
avrdude> read signature
Reading | ################################################## | 100% 0.00 s 
0000  1e 90 06                                          |...             |
avrdude> read cal
Reading | -------------------------------------------------- | 0% 0.00 s 
Error: unexpected response
Error: unexpected read response
Error: (read) error reading calibration address 0x00000 of part ATtiny15
avrdude> read lock
Reading | -------------------------------------------------- | 0% 0.00 s 
Error: unexpected response
Error: unexpected read response
Error: (read) error reading lock address 0x00000 of part ATtiny15
avrdude> read sernum
Reading | -------------------------------------------------- | 0% 0.00 s 
Error: unsupported memory sernum
Error: (read) error reading sernum address 0x00000 of part ATtiny15
avrdude> q
Error: unexpected response
Error: could not end programming, aborting
Error: unexpected response
Error: reading script response failed

Avrdude done.  Thank you.

@MX682X
Copy link
Contributor Author

MX682X commented Nov 24, 2024

I'm not sure, but I think I have a bug in JTAG Fuse write that doesn't correctly poll for a completed read. This might lead to a fuse write corruption. It seems like it wrote a wrong value into hfuse killing SPI and JTAG access on my 32u4.
I haven't noticed it before, but with test8 writing the fuses in a short order it hit the edge case.

tl;dr, don't use JTAG for now. At least not when writing Fuses in quick succession.

Any recommendation on how to HVPP the Arduino Leonardo without a HVPP Programmer? (With 5 bucks per chip, it would suck to loose it) Was thinking about to just write a quick sketch to do fuse reads/writes with another AVR, probably a DA with 12V coming from an external Power Supply.

Oh, and I was able to get prodsig to work on isp (didn't manage to check jtag), I didn't knew they even had it as I've only consulted the docs.

@MX682X
Copy link
Contributor Author

MX682X commented Nov 24, 2024

The ATtiny15 is a difficult one. I'm not even sure it's supported by the PICkit5, but I gave it a try anyways. Results below:

How so exactly? I mean besides the flash programming failing? According to the scripts.xml, it is supported.
Thinking about it, Flash programming probably failed because of the 1k page size overwrite I did to fix things on 32k devices; I'll change it up then.

@MCUdude
Copy link
Collaborator

MCUdude commented Nov 24, 2024

Any recommendation on how to HVPP the Arduino Leonardo without a HVPP Programmer?

I'm not even sure the Leonardo breaks out all the necessary pins to do HVPP. Are you using the atmega32u4 to test JTAG?
I have an STK500 board I use when I screw up something. But I'd build myself an AVR fuse doctor or similar if I didn't had one.

Oh, and I was able to get prodsig to work on isp (didn't manage to check jtag), I didn't knew they even had it as I've only consulted the docs.

IIRC prodsig and serial number was added to lots of "classic" AVRs right before the v8.0 release. test8 is very comprehensive, but it did help us track down lots of small bugs, and was one of the reason why the Avrdude v8.0 release got delayed.

The ATtiny15 is a difficult one. I'm not even sure it's supported by the PICkit5, but I gave it a try anyways. Results below:

How so exactly? I mean besides the flash programming failing? According to the scripts.xml, it is supported.
Thinking about it, Flash programming probably failed because of the 1k page size overwrite I did to fix things on 32k devices; I'll change it up then.

I'm not able to read any memory apart from the signature. But I'll give it a try again if you think you have a solution.

BTW thank you for doing this. This PR is a BIG DEAL for the community and the Avrdude project in general. Fully supporting the latest and greatest official Microchip programmers is key to keep Avrdude relevant. I only have a PICkit4 and a SNAP to test with, but it would be really interesting to see if hte ICE4 and/or an ICD5 would work as well. They should be compatible as they use the same scripting approach, but I wouldn't conclude with anything before performing actual tests. Maybe @xedbg have access to these?

@xedbg
Copy link

xedbg commented Nov 25, 2024

Those tools are so expensive not even I can afford to order one 😬
(But in theory they are the same)

@MX682X
Copy link
Contributor Author

MX682X commented Nov 25, 2024

Good news: I was able to recover the 32u4, just had to solder on 3 jumper wires and desolder a diode on the reset line. This allowed me to verify that fuses and prodsig work correctly with jtag now, no lockouts on my end anymore.

./test8 pickit5_jtag atxmega256a3bu

I looked at the test log again and noticed something strange - the transfer had a timeout on sernum for some reason (the 10 seconds flat is an indicator) and broke all following transactions. The only reason signature works is because I only check it once on init and just feed the buffered signature. I would be useful if you could try to read it with -vvv in terminal mode to get a better idea of what's going on.

avrdude -cpickit5_isp -pattiny15 -B32 -t

Is there a reason why the -B32 option was used? Has it failed on a faster clock before?

Writing 139264 bytes to flash
Writing | ################################################## | 100% 18.63 s
Reading | ################################################## | 100% 14.98 s
Warning: flash verification mismatch
device 0xff != input 0xcf at addr 0x21ffd (error)

This is a similar error I had with debugWire. I increased the page size here too, maybe it could help.

Also, I'd like to suggest to change the usbdev_send trace output created with the -vvvv option to the same format that is used on memory reads, is this feasable? it would make debugging the data way easier then the wall of unformatted text log that is currently implemented.

@MCUdude
Copy link
Collaborator

MCUdude commented Nov 25, 2024

avrdude -cpickit5_isp -pattiny15 -B32 -t

Is there a reason why the -B32 option was used? Has it failed on a faster clock before?

I couldn't even read the signature if I didn't reduce the ISP clock speed. I tried -B8 and -B16, but I was only able to read the signature using -B32.

BTW can you add pickit5 as an alias for pickit5_jtag? We've done that on the PICkit4, Atmel ICE and most JTAG3 comatible programmers.

Here are a few new test8 runs using your latest commit.

# It doesn't work well with the ATtiny15. I was able to write to flash though, but I had to disconnect and reconnect the pickit afterwards
$ avrdude -cpickit5_isp -pattiny15 -B16
Device signature = 00 01 02
Error: expected signature for ATtiny15 is 1E 90 06
  - double check chip or use -F to carry on regardless

Avrdude done.  Thank you.

$ avrdude -cpickit5_isp -pattiny15 -B32 -t
avrdude> read flash
Reading | ################################################## | 100% 1.20 s 
0000  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0010  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0020  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0030  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0050  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0060  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
avrdude> write flash 0 "Hello World"
Caching | ################################################## | 100% 0.00 s 
avrdude> flush
Synching cache to device ... 
Writing | ################################################## | 100% 1.27 s 
avrdude> read eeprom
Reading | -------------------------------------------------- | 0% 10.09 s 
Error: reading data memory failed
Error: unable to read eeprom page at addr 0x0000
Error: (read) error reading eeprom address 0x00000 of part ATtiny15
avrdude> q
^C

$ avrdude -cpickit5_isp -pattiny15 -B32 -t
avrdude> read flash
Reading | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 188 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: wrote -6 out of 188 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read flash page at addr 0x0000
Error: (read) error reading flash address 0x00000 of part ATtiny15
avrdude> q
Error: wrote -6 out of 26 bytes, err = Device not configured
Error: Sending script failed
Error: could not end programming, aborting
Error: wrote -6 out of 29 bytes, err = Device not configured
Error: Sending script failed
Error: sending script failed

Avrdude done.  Thank you.

$ avrdude -cpickit5_isp -pattiny15 -B32 -t
avrdude> read flash
Reading | ################################################## | 100% 1.20 s 
0000  48 65 6c 6c 6f 20 57 6f  72 6c 64 00 ff ff ff ff  |Hello World.....|
0010  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0020  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0030  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0050  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0060  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
avrdude> read fuse
Reading | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 51 bytes, err = Device not configured
Error: Sending script failed
Error: sending script failed
Error: Read Fuse Script failed
Error: (read) error reading fuse address 0x00000 of part ATtiny15
avrdude> q
Error: wrote -6 out of 26 bytes, err = Device not configured
Error: Sending script failed
Error: could not end programming, aborting
Error: wrote -6 out of 29 bytes, err = Device not configured
Error: Sending script failed
Error: sending script failed

Avrdude done.  Thank you.


$ ./test8 pickit5_isp atmega64

Processing -U ALL:r:bak-pickit5_isp-atmega64.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 1.28 s 
 - flash          | ################################################## | 100% 20.20 s 
 - lfuse          | ################################################## | 100% 0.00 s 
 - hfuse          | ################################################## | 100% 0.00 s 
 - efuse          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | ################################################## | 100% 0.03 s 
 - sernum         | ################################################## | 100% 0.01 s 
 - calibration    | ################################################## | 100% 0.01 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 67629 bytes to output file bak-pickit5_isp-atmega64.hex

Processing -T fact reset
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
Caching | ################################################## | 100% 1.28 s 
Caching | ################################################## | 100% 0.01 s 
after the next reset the part will have F_CPU = 1.000 MHz

Processing -U ALL:w:bak-pickit5_isp-atmega64.hex:I
Reading 67619 bytes for multiple memories from input file bak-pickit5_isp-atmega64.hex
Writing 2048 bytes to eeprom
Writing | ################################################## | 100% 22.72 s 
Reading | ################################################## | 100% 1.40 s 
2048 bytes of eeprom verified
Writing 65536 bytes to flash
Writing | ################################################## | 100% 4.00 s 
Reading | ################################################## | 100% 20.27 s 
65536 bytes of flash verified
Writing 1 byte (0xBF) to lfuse, 1 byte written
Warning: lfuse verification mismatch
  device 0xff != input 0xbf at addr 0x0000 (error)
Error: lfuse verification mismatch
Writing 1 byte (0x8F) to hfuse, 1 byte written, 1 verified
Writing 1 byte (0xFF) to efuse, 1 byte written, 1 verified
Writing 1 byte (0xFF) to lock, 1 byte written, 1 verified

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs
performing chip erase; discarded pending writes to flash and EEPROM
after the next reset the part will have F_CPU = 1.000 MHz
^C


$ ./test8 pickit5_pdi atxmega256a3bu

Processing -U ALL:r:bak-pickit5_pdi-atxmega256a3bu.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 1.43 s 
 - flash          | ################################################## | 100% 28.86 s 
 - application    | ################################################## | 100% 29.01 s 
 - apptable       | ################################################## | 100% 0.90 s 
 - boot           | ################################################## | 100% 0.86 s 
 - fuses          | ################################################## | 100% 0.04 s 
 - fuse0          | ################################################## | 100% 0.01 s 
 - fuse1          | ################################################## | 100% 0.01 s 
 - fuse2          | ################################################## | 100% 0.01 s 
 - fuse4          | ################################################## | 100% 0.01 s 
 - fuse5          | ################################################## | 100% 0.01 s 
 - lock           | ################################################## | 100% 0.01 s 
 - prodsig/sigrow | ################################################## | 100% 0.36 s 
 - calibration    | ################################################## | 100% 0.02 s 
 - sernum         | ################################################## | 100% 0.08 s 
 - tempsense      | ################################################## | 100% 0.01 s 
 - usersig        | ################################################## | 100% 0.06 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 553560 bytes to output file bak-pickit5_pdi-atxmega256a3bu.hex

Processing -T fact reset
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
Caching | ################################################## | 100% 1.53 s 
Caching | ################################################## | 100% 0.05 s 
Caching | ################################################## | 100% 0.06 s 
after the next reset the part will have F_CPU = 2.000 MHz

Processing -U ALL:w:bak-pickit5_pdi-atxmega256a3bu.hex:I
Reading 275007 bytes for multiple memories from input file bak-pickit5_pdi-atxmega256a3bu.hex
Writing 4096 bytes to eeprom
Writing | ################################################## | 100% 1.94 s 
Reading | ################################################## | 100% 1.36 s 
4096 bytes of eeprom verified
Writing 270336 bytes to flash
Writing | ################################################## | 100% 36.87 s 
Reading | ################################################## | 100% 28.53 s 
270336 bytes of flash verified
Writing 262144 bytes to application
Writing | ################################################## | 100% 35.11 s 
Reading | ################################################## | 100% 27.73 s 
262144 bytes of application verified
Writing 8192 bytes to apptable
Writing | ################################################## | 100% 1.09 s 
Reading | ################################################## | 100% 0.98 s 
8192 bytes of apptable verified
Writing 8192 bytes to boot
Writing | ################################################## | 100% 0.96 s 
Reading | ################################################## | 100% 0.85 s 
8192 bytes of boot verified
Writing 7 bytes to fuses, 7 bytes written, 7 verified
Writing 1 byte (0xFF) to fuse0, 1 byte written, 1 verified
Writing 1 byte (0x00) to fuse1, 1 byte written, 1 verified
Writing 1 byte (0xFF) to fuse2, 1 byte written, 1 verified
Writing 1 byte (0xFE) to fuse4, 1 byte written, 1 verified
Writing 1 byte (0xFF) to fuse5, 1 byte written, 1 verified
Writing 1 byte (0xFF) to lock, 1 byte written, 1 verified
Writing 512 bytes to usersig
Writing | ################################################## | 100% 0.07 s 
Reading | ################################################## | 100% 0.06 s 
512 bytes of usersig verified

Processing -U ALL:v:bak-pickit5_pdi-atxmega256a3bu.hex:I
Verifying 275007 bytes of multiple memories against input file bak-pickit5_pdi-atxmega256a3bu.hex
Reading | ################################################## | 100% 1.16 s 
4096 bytes of eeprom verified
Reading | ################################################## | 100% 28.43 s 
270336 bytes of flash verified
Reading | ################################################## | 100% 27.55 s 
262144 bytes of application verified
Reading | ################################################## | 100% 0.85 s 
8192 bytes of apptable verified
Reading | ################################################## | 100% 0.85 s 
8192 bytes of boot verified
7 bytes of fuses verified
1 byte of fuse0 verified
1 byte of fuse1 verified
1 byte of fuse2 verified
1 byte of fuse4 verified
1 byte of fuse5 verified
1 byte of lock verified
Reading | ################################################## | 100% 0.31 s 
52 bytes of prodsig/sigrow verified
4 bytes of calibration verified
14 bytes of sernum verified
2 bytes of tempsense verified
Reading | ################################################## | 100% 0.06 s 
512 bytes of usersig verified
3 bytes of signature verified

Avrdude done.  Thank you.

$ ./test8 pickit5_jtag atxmega256a3bu

Processing -U ALL:r:bak-pickit5_jtag-atxmega256a3bu.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 1.28 s 
 - flash          | ################################################## | 100% 28.50 s 
 - application    | ################################################## | 100% 27.65 s 
 - apptable       | ################################################## | 100% 0.85 s 
 - boot           | ################################################## | 100% 0.85 s 
 - fuses          | ################################################## | 100% 0.04 s 
 - fuse0          | ################################################## | 100% 0.01 s 
 - fuse1          | ################################################## | 100% 0.01 s 
 - fuse2          | ################################################## | 100% 0.01 s 
 - fuse4          | ################################################## | 100% 0.01 s 
 - fuse5          | ################################################## | 100% 0.01 s 
 - lock           | ################################################## | 100% 0.01 s 
 - prodsig/sigrow | ################################################## | 100% 0.31 s 
 - calibration    | ################################################## | 100% 0.01 s 
 - sernum         | -------------------------------------------------- | 0% 10.00 s 
Error: reading data memory failed
Error: unable to read byte at address 0x0000
Warning: unable to read sernum (ret = -2), skipping...
 - tempsense      | -------------------------------------------------- | 0% 10.00 s 
Error: reading data memory failed
Error: unable to read byte at address 0x0000
Warning: unable to read tempsense (ret = -2), skipping...
 - usersig        |                                                    | 0% 0.00 s ^C

$ avrdude -cpickit5_jtag -patxmega256a3bu -T 'read sernum' -vvvv
$ avrdude -cpickit5_jtag -patxmega256a3bu -T 'read sernum' -vvvv
Avrdude version 8.0-20241125 (7d82e587)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_jtag
Programmer baud rate  : 200000
Pickit5_open("usb")
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
Max packet size expected 2048, but found 512 due to EP 0x81's wMaxPacketSize
AVR part              : ATxmega256A3BU
Programming modes     : SPM, PDI, XMEGAJTAG

Memory            Size  Pg size     Offset
------------------------------------------
eeprom            4096       32   0x8c0000 
flash           270336      512   0x800000 
application     262144      512   0x800000 
apptable          8192      512   0x83e000 
boot              8192      512   0x840000 
fuses                7        1   0x8f0020 
fuse0                1        1   0x8f0020 
fuse1                1        1   0x8f0021 
fuse2                1        1   0x8f0022 
fuse4                1        1   0x8f0024 
fuse5                1        1   0x8f0025 
lock                 1        1   0x8f0027 
prodsig/sigrow      52        1   0x8e0200 
calibration          4        1   0x8e0200 
sernum              14        1   0x8e0208 
tempsense            2        1   0x8e022e 
usersig            512      512   0x8e0400 
io                4096        1          0 
sram             16384        1     0x2000 
signature            3        1  0x1000090 

Variants            Package  F max   T range        V range       
------------------------------------------------------------------
ATxmega256A3BU-AU   TQFP64   32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]
ATxmega256A3BU-AUR  TQFP64   N/A     [N/A,    N/A]  [N/A,     N/A]
ATxmega256A3BU-MH   QFN64    32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]
ATxmega256A3BU-MHR  VQFN64   32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in JTAG Mode
Pickit5_get_fw_info()
Usbdev_send: . [e1]
Application version   : 02.01.80
Serial number         : BUR204071896
Pickit5_initialize()
Pickit5_set_ptg_mode()
Pickit5_send_script(scr_len: 5, param_len: 0, payload_len: 4)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [1d] . [00] . [00] . [00] . [04] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [05] . [00] . [00] . [00] ^ [5e] . [00] . [00] . [00] . [00]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [1d] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [05] . [00] . [00] . [00] F [46] . [00] . [00] . [00] . [00]
Pickit5_send_script(scr_len: 1, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [19] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [01] . [00] . [00] . [00] D [44]
Pickit5_get_vtarget()
Pickit5_send_script(scr_len: 1, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [19] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [01] . [00] . [00] . [00] G [47]
Target Vdd: 3.38 V, target current: 0 mA
External Voltage detected: will not supply power
Pickit5_set_sck_period()
Pickit5_send_script(scr_len: 14, param_len: 4, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] * [2a] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [04] . [00] . [00] . [00] . [0e] . [00] . [00] . [00] . [c8] . [00] . [00] . [00] . [91] . [00] . [90] . [01] . [01] . [00] . [00] . [00] . [1e] ` [60] . [01] . [1e] a [61] . [00]
Pickit5_program_enable()
Pickit5_send_script(scr_len: 179, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [cb] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [b3] . [00] . [00] . [00] . [90] . [00] . [01] . [00] . [00] . [00] . [1e] ` [60] . [00] . [90] . [00] . [00] . [00] . [00] . [00] . [90] . [01] . [04] . [00] . [00] . [00] . [1e] b [62] . [00] . [01] . [90] . [00] . [00] . [00] . [00] . [00] . [90] . [01] . [01] . [00] . [00] . [00] . [1e] c [63] . [00] . [01] . [90] . [00] . [03] . [00] . [00] . [00] . [1e] f [66] . [00] . [90] . [00]   [20] . [00] . [00] . [00] . [1e] j [6a] . [00] . [90] . [00] . [07] . [00] . [00] . [00] . [1e] f [66] . [00] . [9b] . [01] . [00] . [9b] . [02] . [fd] . [1e] . [0f] . [01] . [02] . [9b] . [01] . [00] . [a2] . [1e] . [0e] . [01] . [a5] . [02] . [00] . [00] . [00] . [00] . [00] . [00] . [00] 2 [32] . [00] . [9b] . [01] . [01] . [9b] . [02] Y [59] . [1e] . [0f] . [01] . [02] . [9b] . [01] . [00] e [65] . [ff] . [88] . [d8] . [cd] . [04] e [65] E [45] . [ab] . [89] . [12] . [04] . [1e] . [11] . [01] . [9b] . [01] . [00] . [1e] . [0e] . [01] l [6c] . [02] f [66] . [02] . [f9] . [00] . [00] . [00] . [90] . [03] . [00] . [00] . [00] . [00] . [fc] . [02] . [03] . [aa] . [00] . [9b] . [01] . [00] . [a2] . [1e] . [0e] . [01] . [a5] . [02] . [00] . [00] . [00] . [02] . [00] . [00] . [00] . [e8] . [03] . [fb] . [b2] . [00] . [90] . [01] . [00] . [01] . [00] . [00] . [7f] . [01] Z [5a]
Pickit5_read_dev_id()
Pickit5_send_script(scr_len: 104, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [80] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] h [68] . [00] . [00] . [00] . [95] . [90] . [01] . [c0] . [01] . [00] . [00] . [fe] . [01] . [00] . [00] . [00] . [00] % [25] . [00] . [90] . [03] . [ca] . [01] . [00] . [01] . [1e] . [03] . [03] l [6c] . [0a] . [90] . [03] . [c4] . [01] . [00] . [01] . [1e] . [03] . [03] l [6c] . [0b] . [90] . [00] . [90] . [00] . [00] . [01] . [1e] . [09] . [00] . [9c] . [01] . [03] . [00] . [1e] . [10] . [01] . [9b] . [02] . [03] . [1e] . [0c] . [02] . [90] . [02] . [93] . [00] . [00] . [01] . [1e] . [03] . [02] . [9f] . [90] . [01] . [c0] . [01] . [00] . [00] . [fe] . [01] . [00] . [00] . [00] . [00] g [67] . [00] . [90] . [03] . [ca] . [01] . [00] . [01] . [1e] . [06] . [03] . [0a] . [90] . [03] . [c4] . [01] . [00] . [01] . [1e] . [06] . [03] . [0b] Z [5a]

AVR device initialized and ready to accept instructions
Avr_signature(pickit5_jtag, x256a3bu)
Reading |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_jtag, x256a3bu, signature, NULL)
Pickit5_read_array(signature, addr: 0x0000, offset: 16777360, len: 1)
Reading | #################                                  | 33% 0.00 s 
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 98 43 (ATxmega256A3B, ATxmega256A3BU)
>>> read sernum 0x0 0xe
Reading |                                                    | 0% 0.00 s 
Pickit5_read_array(sernum, addr: 0x0000, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [08] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Pickit5_read_array(sernum, addr: 0x0001, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [09] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | ####                                               | 7% 0.01 s 
Pickit5_read_array(sernum, addr: 0x0002, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [0a] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | #######                                            | 14% 0.02 s 
Pickit5_read_array(sernum, addr: 0x0003, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [0b] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | ###########                                        | 21% 0.02 s 
Pickit5_read_array(sernum, addr: 0x0004, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [0c] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | ##############                                     | 28% 0.03 s 
Pickit5_read_array(sernum, addr: 0x0005, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [0d] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | ##################                                 | 35% 0.04 s 
Pickit5_read_array(sernum, addr: 0x0006, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [0e] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | #####################                              | 42% 0.04 s 
Pickit5_read_array(sernum, addr: 0x0007, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [0f] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | #########################                          | 50% 0.05 s 
Pickit5_read_array(sernum, addr: 0x0008, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [10] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | #############################                      | 57% 0.05 s 
Pickit5_read_array(sernum, addr: 0x0009, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [11] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | ################################                   | 64% 0.06 s 
Pickit5_read_array(sernum, addr: 0x000a, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [12] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | ####################################               | 71% 0.07 s 
Pickit5_read_array(sernum, addr: 0x000b, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [13] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | #######################################            | 78% 0.07 s 
Pickit5_read_array(sernum, addr: 0x000c, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [14] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | ###########################################        | 85% 0.08 s 
Pickit5_read_array(sernum, addr: 0x000d, offset: 9306632, len: 1)
Pickit5_send_script(scr_len: 106, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [8a] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] j [6a] . [00] . [00] . [00] . [15] . [02] . [8e] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [95] . [90] . [04] . [c0] . [01] . [00] . [00] . [90] . [05] . [00] . [00] . [00] . [00] . [fc] . [04] . [05] & [26] . [00] . [ad] . [01] . [1e] . [03] . [00] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [ae] . [fb] i [69] . [00] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [03] . [06] l [6c] . [0b] . [90] . [04] . [ca] . [01] . [00] . [01] . [90] . [05] . [07] . [00] . [00] . [00] . [1e] . [06] . [04] . [05] . [1e] . [09] . [00] . [1e] . [10] . [01] . [1e] . [0c] . [01] . [90] . [06] . [ca] . [01] . [00] . [01] . [1e] . [06] . [06] . [0a] . [90] . [06] . [c4] . [01] . [00] . [01] . [1e] . [06] . [06] . [0b] Z [5a]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Reading | ################################################## | 100% 0.08 s 
0000  00 00 00 00 00 00 00 00  00 00 00 00 00 00        |..............  |
Pickit5_program_disable()
Pickit5_send_script(scr_len: 40, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] @ [40] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] ( [28] . [00] . [00] . [00] . [9b] . [01] . [01] . [9b] . [02] . [00] . [1e] . [0f] . [01] . [02] . [9b] . [01] . [00] . [9b] . [02] . [00] . [1e] . [0f] . [01] . [02] . [9b] . [01] . [00] . [a2] . [1e] . [0e] . [01] . [a5] . [02] . [00] . [00] . [00] . [00] . [00] . [00] . [00] 2 [32] . [00] . [1e] d [64]
Pickit5_close()
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [1d] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [05] . [00] . [00] . [00] F [46] . [00] . [00] . [00] . [00]
Pickit5_send_script(scr_len: 1, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [19] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [01] . [00] . [00] . [00] D [44]

Avrdude done.  Thank you.

$ ./test8 -a"-vvvv" -a"-B32" pickit5_isp attiny15
$ avrdude -vvvv -B32 -c pickit5_isp -p attiny15 -D -UALL:r:bak-pickit5_isp-attiny15.hex:I -T 'fact reset' -UALL:w:bak-pickit5_isp-attiny15.hex:I -UALL:v:bak-pickit5_isp-attiny15.hex:I
Avrdude version 8.0-20241125 (7d82e587)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_isp
Programmer baud rate  : 125000
Setting bit clk period: 32.0 us
Pickit5_open("usb")
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
Max packet size expected 2048, but found 512 due to EP 0x81's wMaxPacketSize
AVR part              : ATtiny15
Programming modes     : ISP, HVSP

Memory          Size  Pg size
-----------------------------
eeprom            64        1
flash           1024        1
fuse               1        1
lock               1        1
prodsig/sigrow    24        1
sernum            10        1
io                64        1
sram              32        1
signature          3        1
calibration        1        1

Variants       Package  F max    T range        V range       
--------------------------------------------------------------
ATtiny15       N/A      N/A      [N/A,    N/A]  [2.7 V, 5.5 V]
ATtiny15L-1PC  DIP8     1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1PI  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1PU  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SC  SOIC8    1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1SI  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SU  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in ISP Mode
Pickit5_get_fw_info()
Usbdev_send: . [e1]
Application version   : 02.01.80
Serial number         : BUR204071896
Pickit5_initialize()
Pickit5_set_ptg_mode()
Pickit5_send_script(scr_len: 5, param_len: 0, payload_len: 4)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [1d] . [00] . [00] . [00] . [04] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [05] . [00] . [00] . [00] ^ [5e] . [00] . [00] . [00] . [00]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [1d] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [05] . [00] . [00] . [00] F [46] . [00] . [00] . [00] . [00]
Pickit5_send_script(scr_len: 1, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [19] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [01] . [00] . [00] . [00] D [44]
Pickit5_get_vtarget()
Pickit5_send_script(scr_len: 1, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [19] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [01] . [00] . [00] . [00] G [47]
Target Vdd: 5.16 V, target current: 0 mA
External Voltage detected: will not supply power
Pickit5_set_sck_period()
Pickit5_send_script(scr_len: 5, param_len: 4, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] ! [21] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [04] . [00] . [00] . [00] . [05] . [00] . [00] . [00] . [1f] . [00] . [00] . [00] . [91] . [00] . [1e] 3 [33] . [00]
Pickit5_program_enable()
Pickit5_send_script(scr_len: 44, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] D [44] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] , [2c] . [00] . [00] . [00] . [ac] . [02] . [00] . [1e] 0 [30] . [90] . [05] . [00] . [00] S [53] . [ac] . [9b] . [06] . [02] . [9b] . [07] . [00] . [1e] 5 [35] . [05] . [06] . [07] l [6c] . [06] . [fd] S [53] . [00] . [00] . [00] , [2c] . [00] . [1e] 6 [36] . [a4] . [1e] 1 [31] . [90] . [01] . [c0] . [0e] . [00] . [00] . [7f] . [01]
Pickit5_read_dev_id()
Pickit5_send_script(scr_len: 66, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] Z [5a] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] B [42] . [00] . [00] . [00] . [90] . [00] . [00] . [00] . [00] 0 [30] . [9c] . [01] . [00] . [00] . [ac] . [03] . [00] . [9b] . [0c] 2 [32] . [1e] 7 [37] . [0c] l [6c] . [0d] . [9b] . [0e] . [00] . [fc] . [0d] . [0e] B [42] . [00] ` [60] . [0c] . [00] . [9b] . [0d] . [03] . [9b] . [0e] . [00] . [1e] 5 [35] . [0c] . [0d] . [0e] . [9f] . [92] . [01] . [01] . [00] . [00] . [00] ` [60] . [02] . [01] h [68] . [02] . [08] f [66] . [00] . [ff] . [00] . [ff] . [ff] | [7c] . [00] . [02] . [a4]

AVR device initialized and ready to accept instructions
Avr_signature(pickit5_isp, t15)
Reading |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, signature, NULL)
Pickit5_read_array(signature, addr: 0x0000, offset: 0, len: 1)
Reading | #################                                  | 33% 0.00 s 
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 90 06 (ATtiny15)

Processing -U ALL:r:bak-pickit5_isp-attiny15.hex:I
Reading multiple memories ...
 - eeprom         |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, eeprom, NULL)
Pickit5_read_array(eeprom, addr: 0x0000, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [a1] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] . [81] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [91] . [00] . [91] . [01] . [9b] . [02] 2 [32] . [1e] 7 [37] . [02] l [6c] . [04] . [9b] . [03] . [00] . [fc] . [04] . [03] . [81] . [00] . [90] . [0c] @ [40] . [00] . [00] . [00] . [90] . [0d] . [00] . [00] . [02] . [00] ` [60] . [0e] . [01] . [93] . [0e] . [02] . [00] . [ad] . [0e] . [fa] . [0c] . [0d] 1 [31] . [00] . [fb] O [4f] . [00] ` [60] . [0f] . [00] g [67] . [0f] . [08] f [66] . [0f] . [00] . [ff] . [ff] . [00] f [66] . [10] . [00] . [00] . [00] . [ff] . [90] . [10] . [00] . [00] . [00] M [4d] | [7c] . [10] . [0f] . [1e] 4 [34] . [10] . [ac] . [02] . [00] ` [60] . [0f] . [00] h [68] . [0f] . [08] f [66] . [0f] . [00] . [ff] . [ff] . [00] . [90] . [10] . [00] . [00] . [00] . [a0] f [66] . [10] . [00] . [00] . [00] . [ff] | [7c] . [10] . [0f] . [9b] . [11] . [03] . [9b] . [12] . [00] . [1e] 5 [35] . [10] . [11] . [12] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [a4] . [ae]
Usb_fill_buf(): usb_bulk_read() error: Operation timed out
 - eeprom         | -------------------------------------------------- | 0% 10.00 s 
Error pickit5_upload_data() pickit5.c 1658: reading data memory failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read eeprom (ret = -2), skipping...
 - flash          |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, flash, NULL)
Pickit5_read_array(flash, addr: 0x0000, offset: 0, len: 1024)
Pickit5_send_script(scr_len: 156, param_len: 8, payload_len: 1024)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] . [bc] . [00] . [00] . [00] . [00] . [04] . [00] . [00] . [08] . [00] . [00] . [00] . [9c] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [04] . [00] . [00] . [91] . [00] . [91] . [01] g [67] . [00] . [01] g [67] . [01] . [01] . [93] . [01] @ [40] . [00] . [9b] . [02] 2 [32] . [1e] 7 [37] . [02] l [6c] . [03] . [9b] . [02] . [00] . [fc] . [03] . [02] . [9c] . [00] . [90] . [0c] . [00] . [04] . [00] . [00] . [90] . [0d] . [00] . [00] . [02] . [00] . [ad] . [01] . [fa] . [0c] . [0d] 4 [34] . [00] . [fb] R [52] . [00] ` [60] . [0c] . [00] g [67] . [0c] . [08] f [66] . [0c] . [00] . [ff] . [ff] . [00] f [66] . [0d] . [00] . [00] . [00] . [ff] . [90] . [0d] . [00] . [00] . [00] M [4d] | [7c] . [0d] . [0c] . [1e] 4 [34] . [0d] . [ac] @ [40] . [00] ` [60] . [0c] . [00] h [68] . [0c] . [08] . [90] . [0d] . [00] . [00] . [00]   [20] f [66] . [0d] . [00] . [00] . [00] . [ff] f [66] . [0c] . [00] . [ff] . [ff] . [00] | [7c] . [0d] . [0c] . [9b] . [0f] . [03] . [9b] . [10] . [00] . [1e] 5 [35] . [0d] . [0f] . [10] . [9f] . [90] . [0e] . [00] . [00] . [00] ( [28] f [66] . [0e] . [00] . [00] . [00] . [ff] | [7c] . [0e] . [0c] . [1e] 5 [35] . [0e] . [0f] . [10] . [9f] . [92] . [00] . [01] . [00] . [00] . [00] . [a4] . [94] . [04] . [00] . [ae]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
 - flash          | ################################################## | 100% 1.20 s 
 - fuse           |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, fuse, NULL)
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [00] . [00] P [50] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - fuse           | ################################################## | 100% 0.00 s 
 - lock           |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, lock, NULL)
Pickit5_read_array(lock, addr: 0x0000, offset: 0, len: 1)
Pickit5_send_script(scr_len: 41, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] I [49] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] ) [29] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [91] . [05] . [91] . [06] . [90] . [00] . [00] . [00] . [00] X [58] . [9b] . [0c] 2 [32] . [1e] 7 [37] . [0c] l [6c] . [0d] . [9b] . [0e] . [00] . [fc] . [0d] . [0e] ) [29] . [00] ` [60] . [0c] . [00] . [9b] . [0d] . [03] . [9b] . [0e] . [00] . [1e] 5 [35] . [0c] . [0d] . [0e] . [9f]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, prodsig, NULL)
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [00] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [00] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ##                                                 | 4% 0.01 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [01] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ####                                               | 8% 0.01 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [01] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ######                                             | 12% 0.01 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [02] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ########                                           | 16% 0.02 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [02] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ##########                                         | 20% 0.02 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [03] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | #############                                      | 25% 0.02 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [03] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ###############                                    | 29% 0.02 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [04] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | #################                                  | 33% 0.03 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [04] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ###################                                | 37% 0.03 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [05] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | #####################                              | 41% 0.03 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [05] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | #######################                            | 45% 0.04 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [06] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | #########################                          | 50% 0.04 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [06] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ###########################                        | 54% 0.04 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [07] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | #############################                      | 58% 0.05 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [07] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ###############################                    | 62% 0.05 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [08] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | #################################                  | 66% 0.05 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [08] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ###################################                | 70% 0.06 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [09] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ######################################             | 75% 0.06 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [09] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ########################################           | 79% 0.06 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [0a] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ##########################################         | 83% 0.07 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [0a] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ############################################       | 87% 0.07 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [0b] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ##############################################     | 91% 0.07 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [0b] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - prodsig/sigrow | ################################################## | 100% 0.08 s 
 - sernum         |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, sernum, NULL)
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [07] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [07] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - sernum         | #####                                              | 10% 0.01 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [08] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - sernum         | ##########                                         | 20% 0.01 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [08] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - sernum         | ###############                                    | 30% 0.01 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [09] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - sernum         | ####################                               | 40% 0.02 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [09] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - sernum         | #########################                          | 50% 0.02 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [0a] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - sernum         | ##############################                     | 60% 0.02 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [0a] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - sernum         | ###################################                | 70% 0.03 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [0b] . [00] 0 [30] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - sernum         | ########################################           | 80% 0.03 s 
Pickit5_send_script(scr_len: 27, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] 3 [33] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [1b] . [00] . [00] . [00] . [90] . [00] 2 [32] . [00] . [00] . [00] . [1e] 7 [37] . [00] . [90] . [01] . [00] . [0b] . [00] 8 [38] . [9b] . [02] . [03] . [9b] . [03] . [00] . [1e] 5 [35] . [01] . [02] . [03] . [9f]
 - sernum         | ################################################## | 100% 0.03 s 
 - signature      |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, signature, NULL)
Pickit5_read_array(signature, addr: 0x0000, offset: 0, len: 1)
 - signature      | #################                                  | 33% 0.00 s 
 - signature      | ################################################## | 100% 0.00 s 
 - calibration    |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, calibration, NULL)
Pickit5_read_array(calibration, addr: 0x0000, offset: 0, len: 1)
Pickit5_send_script(scr_len: 37, param_len: 8, payload_len: 1)
Usbdev_send: . [02] . [01] . [00] . [80] . [00] . [00] . [00] . [00] E [45] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [08] . [00] . [00] . [00] % [25] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [01] . [00] . [00] . [00] . [90] . [00] . [00] . [00] . [00] 8 [38] . [9b] . [0c] 2 [32] . [1e] 7 [37] . [0c] l [6c] . [0d] . [9b] . [0e] . [00] . [fc] . [0d] . [0e] % [25] . [00] ` [60] . [0c] . [00] . [9b] . [0d] . [03] . [9b] . [0e] . [00] . [1e] 5 [35] . [0c] . [0d] . [0e] . [9f]
Usbdev_send: . [03] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00]
 - calibration    | ################################################## | 100% 0.00 s 
Writing 1064 bytes to output file bak-pickit5_isp-attiny15.hex
Pickit5_program_disable()
Pickit5_send_script(scr_len: 2, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [1a] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [02] . [00] . [00] . [00] . [1e] 1 [31]
Pickit5_close()
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [1d] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [05] . [00] . [00] . [00] F [46] . [00] . [00] . [00] . [00]
Pickit5_send_script(scr_len: 1, param_len: 0, payload_len: 0)
Usbdev_send: . [00] . [01] . [00] . [00] . [00] . [00] . [00] . [00] . [19] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [01] . [00] . [00] . [00] D [44]

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs
^C

@MX682X
Copy link
Contributor Author

MX682X commented Nov 26, 2024

I've reworked the prodsig retrieval - now it retrieves all bytes at once when the first address is requested, otherwise it serves a buffer. This should fix sernum and tempsense.

And with the Attiny15 - I have no idea why it doesn't work It seems however that test8 is timeouting on reading the eeprom, but the rest seems to work?. The script is pretty much the same compared to 328p, only the commands for programming are different.

I wonder however, if the problem persists with other tinies aswell, like the attiny85/84. I would appreciate if somone could test them aswell

@MCUdude
Copy link
Collaborator

MCUdude commented Nov 28, 2024

I wonder however, if the problem persists with other tinies aswell, like the attiny85/84. I would appreciate if somone could test them aswell

Sure!

$ ./test8 pickit5_isp attiny85

Processing -U ALL:r:bak-pickit5_isp-attiny85.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.41 s 
 - flash          | ################################################## | 100% 2.91 s 
 - lfuse          | ################################################## | 100% 0.00 s 
 - hfuse          | ################################################## | 100% 0.00 s 
 - efuse          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - signature      | ################################################## | 100% 0.00 s 
 - calibration    | ################################################## | 100% 0.00 s 
Writing 8747 bytes to output file bak-pickit5_isp-attiny85.hex

Processing -T fact reset
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
Caching | ################################################## | 100% 0.51 s 
Caching | ################################################## | 100% 0.01 s 
after the next reset the part will have F_CPU = 1.000 MHz

Processing -U ALL:w:bak-pickit5_isp-attiny85.hex:I
Reading 8737 bytes for multiple memories from input file bak-pickit5_isp-attiny85.hex
Writing 512 bytes to eeprom
Writing | ################################################## | 100% 1.11 s 
Reading | ################################################## | 100% 0.41 s 
512 bytes of eeprom verified
Writing 8192 bytes to flash
Writing | ################################################## | 100% 2.74 s 
Reading | ################################################## | 100% 2.90 s 
8192 bytes of flash verified
Writing 1 byte (0x62) to lfuse, 1 byte written, 1 verified
Writing 1 byte (0xDF) to hfuse, 1 byte written, 1 verified
Writing 1 byte (0xFF) to efuse, 1 byte written, 1 verified
Writing 1 byte (0xFF) to lock, 1 byte written, 1 verified

Processing -U ALL:v:bak-pickit5_isp-attiny85.hex:I
Verifying 8737 bytes of multiple memories against input file bak-pickit5_isp-attiny85.hex
Reading | ################################################## | 100% 0.40 s 
512 bytes of eeprom verified
Reading | ################################################## | 100% 2.90 s 
8192 bytes of flash verified
1 byte of lfuse verified
1 byte of hfuse verified
1 byte of efuse verified
1 byte of lock verified
24 bytes of prodsig/sigrow verified
10 bytes of sernum verified
3 bytes of signature verified
2 bytes of calibration verified

Avrdude done.  Thank you.
Hanss-MacBook-Pro:tools hans$ ./test8 pickit5_isp attiny84

Processing -U ALL:r:bak-pickit5_isp-attiny84.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.45 s 
 - flash          | ################################################## | 100% 2.94 s 
 - lfuse          | ################################################## | 100% 0.00 s 
 - hfuse          | ################################################## | 100% 0.00 s 
 - efuse          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - signature      | ################################################## | 100% 0.00 s 
 - calibration    | ################################################## | 100% 0.00 s 
Writing 8746 bytes to output file bak-pickit5_isp-attiny84.hex

Processing -T fact reset
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
Caching | ################################################## | 100% 0.55 s 
Caching | ################################################## | 100% 0.02 s 
after the next reset the part will have F_CPU = 1.000 MHz

Processing -U ALL:w:bak-pickit5_isp-attiny84.hex:I
Reading 8736 bytes for multiple memories from input file bak-pickit5_isp-attiny84.hex
Writing 512 bytes to eeprom
Writing | ################################################## | 100% 1.06 s 
Reading | ################################################## | 100% 0.42 s 
512 bytes of eeprom verified
Writing 8192 bytes to flash
Writing | ################################################## | 100% 2.09 s 
Reading | ################################################## | 100% 2.90 s 
8192 bytes of flash verified
Writing 1 byte (0x62) to lfuse, 1 byte written, 1 verified
Writing 1 byte (0xDF) to hfuse, 1 byte written, 1 verified
Writing 1 byte (0xFF) to efuse, 1 byte written, 1 verified
Writing 1 byte (0xFF) to lock, 1 byte written, 1 verified

Processing -U ALL:v:bak-pickit5_isp-attiny84.hex:I
Verifying 8736 bytes of multiple memories against input file bak-pickit5_isp-attiny84.hex
Reading | ################################################## | 100% 0.39 s 
512 bytes of eeprom verified
Reading | ################################################## | 100% 2.90 s 
8192 bytes of flash verified
1 byte of lfuse verified
1 byte of hfuse verified
1 byte of efuse verified
1 byte of lock verified
24 bytes of prodsig/sigrow verified
10 bytes of sernum verified
3 bytes of signature verified
1 byte of calibration verified

Avrdude done.  Thank you.

$ ./test8 pickit5_isp attiny13

Processing -U ALL:r:bak-pickit5_isp-attiny13.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.05 s 
 - flash          | ################################################## | 100% 0.43 s 
 - lfuse          | ################################################## | 100% 0.00 s 
 - hfuse          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - signature      | ################################################## | 100% 0.00 s 
 - calibration    | ################################################## | 100% 0.01 s 
Writing 1130 bytes to output file bak-pickit5_isp-attiny13.hex

Processing -T fact reset
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
Caching | ################################################## | 100% 0.05 s 
Caching | ################################################## | 100% 0.00 s 
after the next reset the part will have F_CPU = 1.200 MHz

Processing -U ALL:w:bak-pickit5_isp-attiny13.hex:I
Reading 1120 bytes for multiple memories from input file bak-pickit5_isp-attiny13.hex
Writing 64 bytes to eeprom
Writing | ################################################## | 100% 0.15 s 
Reading | ################################################## | 100% 0.05 s 
64 bytes of eeprom verified
Writing 1024 bytes to flash
Writing | ################################################## | 100% 0.17 s 
Reading | ################################################## | 100% 0.43 s 
1024 bytes of flash verified
Writing 1 byte (0x6A) to lfuse, 1 byte written, 1 verified
Writing 1 byte (0xFF) to hfuse, 1 byte written, 1 verified
Writing 1 byte (0xFF) to lock, 1 byte written, 1 verified

Processing -U ALL:v:bak-pickit5_isp-attiny13.hex:I
Verifying 1120 bytes of multiple memories against input file bak-pickit5_isp-attiny13.hex
Reading | ################################################## | 100% 0.05 s 
64 bytes of eeprom verified
Reading | ################################################## | 100% 0.43 s 
1024 bytes of flash verified
1 byte of lfuse verified
1 byte of hfuse verified
1 byte of lock verified
24 bytes of prodsig/sigrow verified
10 bytes of sernum verified
3 bytes of signature verified
2 bytes of calibration verified

Avrdude done.  Thank you.

The ATtiny15 is a strage one. R/W EEPROM does not work, and if I wait a bit before sending a new command in terminal mode, it fails:

$ avrdude -cpickit5_isp -pattiny15 -t -B32
avrdude> write flash 32 "the quick brown fox"
Caching | ################################################## | 100% 1.20 s 
avrdude> flush
Synching cache to device ... 
Writing | ################################################## | 100% 1.56 s ad
avrdude> read fuse
Reading | ################################################## | 100% 0.00 s 
0000  5c                                                |\               |
avrdude> read flash
Reading | ################################################## | 100% 0.00 s 
0000  48 65 6c 6c 6f 20 57 6f  72 6c 64 00 ff ff ff ff  |Hello World.....|
0010  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0020  74 68 65 20 71 75 69 63  6b 20 62 72 6f 77 6e 20  |the quick brown |
0030  66 6f 78 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |fox.............|
0040  74 68 65 20 71 75 69 63  6b 20 62 72 6f 77 6e 20  |the quick brown |
0050  66 6f 78 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |fox.............|
0060  ff ff ff ff 48 65 6c 6c  6f 20 57 6f 72 6c 64 00  |....Hello World.|
0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
avrdude> part
ATtiny15 with programming modes ISP, HVSP

Memory          Size  Pg size
-----------------------------
eeprom            64        1
flash           1024     1024
fuse               1        1
lock               1        1
prodsig/sigrow    24        1
sernum            10        1
io                64        1
sram              32        1
signature          3        1
calibration        1        1

Variants       Package  F max    T range        V range       
--------------------------------------------------------------
ATtiny15       N/A      N/A      [N/A,    N/A]  [2.7 V, 5.5 V]
ATtiny15L-1PC  DIP8     1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1PI  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1PU  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SC  SOIC8    1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1SI  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SU  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
avrdude> read cal
Reading | ################################################## | 100% 0.00 s 
0000  70                                                |p               |

[waiting a minute before running the next command]

avrdude> read cal
Reading | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 69 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: (read) error reading calibration address 0x00000 of part ATtiny15

@MX682X
Copy link
Contributor Author

MX682X commented Nov 29, 2024

I think i have to give up on the Attiny15 - without having the chip here I won't be able to debug the problem effectively. I need to trace the lines with my oscilloscope and try out different things. I suspect it would have ended with me writing a full set of custom scripts to get it to work - which will be more work than is worth for this chip.

On another note, @stefanrueger , currently I'm using the part name to identify the correct script for pickit, however I thought it would be better to use the signature as the identifier for the switch cases. This would, however, require to run the scripts_decoder.py file any time the avrdude.conf is expanded (the signature would be pulled from the conf), It would also require an installed MPLAB or rather the toolpack on the uploaders's PC. Is this feasable or would it be too much of a hassle?

@MCUdude
Copy link
Collaborator

MCUdude commented Nov 29, 2024

I think i have to give up on the Attiny15 - without having the chip here I won't be able to debug the problem effectively. I need to trace the lines with my oscilloscope and try out different things. I suspect it would have ended with me writing a full set of custom scripts to get it to work - which will be more work than is worth for this chip.

The ATtiny15 is tricky for sure. That's why I have one in my parts bin for testing. It has given us problems before, and I think really old AVRs may behave in a similar way. That's why it's nice to get it figured out.
I actually have a spare ATtiny15 chip, so if you want one, I can send it to you.

If you search for attiny15 in this discussion, you can see the issues we found and how they were resolved.
#1654

@MX682X
Copy link
Contributor Author

MX682X commented Nov 29, 2024

This gave me an idea actually - someone mentioned a byte access. I've checked the scripts and it seems they implemented a word access, for eeprom and flash. Reading the EEPROM just by byte seems to break the system as avrdude tells pickit to send 1 byte but it has read 2 - at least that is my best guess.
My hope right now is that by setting the readsize of EEPROM in the .conf file to 2 might fix the bug on the pickit already. To verify that it works, a -vvv output is needed (Pickit5_read_array(eeprom, addr: 0x0000, offset: 0, len: 1) if the len increases to 2 it means the change in .conf has worked)

@MCUdude
Copy link
Collaborator

MCUdude commented Nov 29, 2024

Here is the -vvv output:

$ avrdude -cpickit5_isp -pattiny15 -vvv -B32 -T 'write eeprom 0 "the quick brown fox jumps over the lazy dog"'
Avrdude version 8.0-20241126 (ae867081)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_isp
Programmer baud rate  : 125000
Setting bit clk period: 32.0 us
Pickit5_open("usb")
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
Max packet size expected 2048, but found 512 due to EP 0x81's wMaxPacketSize
AVR part              : ATtiny15
Programming modes     : ISP, HVSP

Memory          Size  Pg size
-----------------------------
eeprom            64        1
flash           1024        1
fuse               1        1
lock               1        1
prodsig/sigrow    24        1
sernum            10        1
io                64        1
sram              32        1
signature          3        1
calibration        1        1

Variants       Package  F max    T range        V range       
--------------------------------------------------------------
ATtiny15       N/A      N/A      [N/A,    N/A]  [2.7 V, 5.5 V]
ATtiny15L-1PC  DIP8     1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1PI  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1PU  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SC  SOIC8    1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1SI  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SU  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in ISP Mode
Pickit5_get_fw_info()
Application version   : 02.01.80
Serial number         : BUR204071896
Pickit5_initialize()
Pickit5_set_ptg_mode()
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 4)
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 0)
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)
Pickit5_get_vtarget()
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)
Target Vdd: 5.15 V, target current: 0 mA
External Voltage detected: will not supply power
Pickit5_set_sck_period()
Pickit5_send_script(scr_len: 5, param_len: 4, data_len: 0)
Pickit5_program_enable()
Pickit5_send_script(scr_len: 44, param_len: 0, data_len: 0)
Pickit5_read_dev_id()
Pickit5_send_script(scr_len: 66, param_len: 0, data_len: 0)

AVR device initialized and ready to accept instructions
Avr_signature(pickit5_isp, t15)
Reading |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, signature, NULL)
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 90 06 (ATtiny15)
(write) writing 44 bytes starting from address 0x0000
Caching |                                                    | 0% 0.00 s 
Pickit5_read_array(eeprom, addr: 0x0000, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Usb_fill_buf(): usb_bulk_read() error: Input/output error
Caching | -------------------------------------------------- | 0% 2.06 s 
Error pickit5_upload_data() pickit5.c 1677: reading data memory failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0000
Error cmd_write() term.c 887: (write) error writing 0x74 at 0x00000 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0001, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0001
Error cmd_write() term.c 887: (write) error writing 0x68 at 0x00001 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0002, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0002
Error cmd_write() term.c 887: (write) error writing 0x65 at 0x00002 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0003, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0003
Error cmd_write() term.c 887: (write) error writing 0x20 at 0x00003 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0004, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0004
Error cmd_write() term.c 887: (write) error writing 0x71 at 0x00004 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0005, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0005
Error cmd_write() term.c 887: (write) error writing 0x75 at 0x00005 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0006, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0006
Error cmd_write() term.c 887: (write) error writing 0x69 at 0x00006 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0007, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0007
Error cmd_write() term.c 887: (write) error writing 0x63 at 0x00007 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0008, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0008
Error cmd_write() term.c 887: (write) error writing 0x6b at 0x00008 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0009, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0009
Error cmd_write() term.c 887: (write) error writing 0x20 at 0x00009 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x000a, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x000a
Error cmd_write() term.c 887: (write) error writing 0x62 at 0x0000a (rc = -1)
Pickit5_read_array(eeprom, addr: 0x000b, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x000b
Error cmd_write() term.c 887: (write) error writing 0x72 at 0x0000b (rc = -1)
Pickit5_read_array(eeprom, addr: 0x000c, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x000c
Error cmd_write() term.c 887: (write) error writing 0x6f at 0x0000c (rc = -1)
Pickit5_read_array(eeprom, addr: 0x000d, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x000d
Error cmd_write() term.c 887: (write) error writing 0x77 at 0x0000d (rc = -1)
Pickit5_read_array(eeprom, addr: 0x000e, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x000e
Error cmd_write() term.c 887: (write) error writing 0x6e at 0x0000e (rc = -1)
Pickit5_read_array(eeprom, addr: 0x000f, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x000f
Error cmd_write() term.c 887: (write) error writing 0x20 at 0x0000f (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0010, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0010
Error cmd_write() term.c 887: (write) error writing 0x66 at 0x00010 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0011, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0011
Error cmd_write() term.c 887: (write) error writing 0x6f at 0x00011 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0012, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0012
Error cmd_write() term.c 887: (write) error writing 0x78 at 0x00012 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0013, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0013
Error cmd_write() term.c 887: (write) error writing 0x20 at 0x00013 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0014, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0014
Error cmd_write() term.c 887: (write) error writing 0x6a at 0x00014 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0015, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0015
Error cmd_write() term.c 887: (write) error writing 0x75 at 0x00015 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0016, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0016
Error cmd_write() term.c 887: (write) error writing 0x6d at 0x00016 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0017, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0017
Error cmd_write() term.c 887: (write) error writing 0x70 at 0x00017 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0018, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0018
Error cmd_write() term.c 887: (write) error writing 0x73 at 0x00018 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0019, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0019
Error cmd_write() term.c 887: (write) error writing 0x20 at 0x00019 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x001a, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x001a
Error cmd_write() term.c 887: (write) error writing 0x6f at 0x0001a (rc = -1)
Pickit5_read_array(eeprom, addr: 0x001b, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x001b
Error cmd_write() term.c 887: (write) error writing 0x76 at 0x0001b (rc = -1)
Pickit5_read_array(eeprom, addr: 0x001c, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x001c
Error cmd_write() term.c 887: (write) error writing 0x65 at 0x0001c (rc = -1)
Pickit5_read_array(eeprom, addr: 0x001d, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x001d
Error cmd_write() term.c 887: (write) error writing 0x72 at 0x0001d (rc = -1)
Pickit5_read_array(eeprom, addr: 0x001e, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x001e
Error cmd_write() term.c 887: (write) error writing 0x20 at 0x0001e (rc = -1)
Pickit5_read_array(eeprom, addr: 0x001f, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x001f
Error cmd_write() term.c 887: (write) error writing 0x74 at 0x0001f (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0020, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0020
Error cmd_write() term.c 887: (write) error writing 0x68 at 0x00020 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0021, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0021
Error cmd_write() term.c 887: (write) error writing 0x65 at 0x00021 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0022, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0022
Error cmd_write() term.c 887: (write) error writing 0x20 at 0x00022 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0023, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0023
Error cmd_write() term.c 887: (write) error writing 0x6c at 0x00023 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0024, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0024
Error cmd_write() term.c 887: (write) error writing 0x61 at 0x00024 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0025, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0025
Error cmd_write() term.c 887: (write) error writing 0x7a at 0x00025 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0026, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0026
Error cmd_write() term.c 887: (write) error writing 0x79 at 0x00026 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0027, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0027
Error cmd_write() term.c 887: (write) error writing 0x20 at 0x00027 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0028, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0028
Error cmd_write() term.c 887: (write) error writing 0x64 at 0x00028 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x0029, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x0029
Error cmd_write() term.c 887: (write) error writing 0x6f at 0x00029 (rc = -1)
Pickit5_read_array(eeprom, addr: 0x002a, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x002a
Error cmd_write() term.c 887: (write) error writing 0x67 at 0x0002a (rc = -1)
Pickit5_read_array(eeprom, addr: 0x002b, offset: 0, len: 1)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 1)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 161 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 1670: sending script with upload failed
Error loadCachePage() avrcache.c 247: unable to read eeprom page at addr 0x002b
Error cmd_write() term.c 887: (write) error writing 0x00 at 0x0002b (rc = -1)
Pickit5_program_disable()
Pickit5_send_script(scr_len: 2, param_len: 0, data_len: 0)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 26 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error main() main.c 1828: could not end programming, aborting
Pickit5_close()
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 0)
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 29 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_send_script_cmd() pickit5.c 1630: sending script failed

Avrdude done.  Thank you.

@MX682X
Copy link
Contributor Author

MX682X commented Nov 29, 2024

alright, seems like I have to modify the code. Is there an easy way to check for the old AVRs like the Attiny15?

@MCUdude
Copy link
Collaborator

MCUdude commented Nov 29, 2024

alright, seems like I have to modify the code. Is there an easy way to check for the old AVRs like the Attiny15?

The output was from when I tried to write to the ATtiny15 EEPROM. Do you need more logs from different memories?

@MX682X
Copy link
Contributor Author

MX682X commented Nov 29, 2024

The output was from when I tried to write to the ATtiny15 EEPROM. Do you need more logs from different memories?

Nah, there is a problem somewhere else - I need to get the read/write length to a factor of 2. Maybe by setting the pagesize value to 2 in the .conf file? Avrdude still tried to write 1 byte only. Either I write a workaround or tell avrdude to write words. I find it weird though that the EEPROM readsize is set for the Attiny15 - but to 256 bytes while it has only 64 bytes.

@MCUdude
Copy link
Collaborator

MCUdude commented Nov 29, 2024

You'll have to instruct me, or provide a modified ATtiny15 config I can use to perform the tests you need. And ideally a command or two 😉

@MX682X
Copy link
Contributor Author

MX682X commented Nov 29, 2024

I've found a "mode" paramater for the memories, I hope it works as intended.
And for the command: just do a EEPROM Read - if that works write should work as well.

@MCUdude
Copy link
Collaborator

MCUdude commented Nov 29, 2024

Amazing! That certainly did the trick!

$ avrdude -cpickit5_isp -pattiny15 -vvv -B32 -Ueeprom:r:-:I
Avrdude version 8.0-20241129 (f916ba39)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_isp
Programmer baud rate  : 125000
Setting bit clk period: 32.0 us
Pickit5_open("usb")
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
Max packet size expected 2048, but found 512 due to EP 0x81's wMaxPacketSize
AVR part              : ATtiny15
Programming modes     : ISP, HVSP

Memory          Size  Pg size
-----------------------------
eeprom            64        1
flash           1024        1
fuse               1        1
lock               1        1
prodsig/sigrow    24        1
sernum            10        1
io                64        1
sram              32        1
signature          3        1
calibration        1        1

Variants       Package  F max    T range        V range       
--------------------------------------------------------------
ATtiny15       N/A      N/A      [N/A,    N/A]  [2.7 V, 5.5 V]
ATtiny15L-1PC  DIP8     1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1PI  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1PU  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SC  SOIC8    1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1SI  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SU  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in ISP Mode
Pickit5_get_fw_info()
Application version   : 02.01.80
Serial number         : BUR204071896
Pickit5_initialize()
Pickit5_set_ptg_mode()
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 4)
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 0)
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)
Pickit5_get_vtarget()
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)
Target Vdd: 5.16 V, target current: 0 mA
External Voltage detected: will not supply power
Pickit5_set_sck_period()
Pickit5_send_script(scr_len: 5, param_len: 4, data_len: 0)
Pickit5_program_enable()
Pickit5_send_script(scr_len: 44, param_len: 0, data_len: 0)
Pickit5_read_dev_id()
Pickit5_send_script(scr_len: 66, param_len: 0, data_len: 0)

AVR device initialized and ready to accept instructions
Avr_signature(pickit5_isp, t15)
Reading |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, signature, NULL)
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 90 06 (ATtiny15)
Reading eeprom memory ...
Reading |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, eeprom, NULL)
Pickit5_read_array(eeprom, addr: 0x0000, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ###                                                | 6% 0.01 s 
Pickit5_read_array(eeprom, addr: 0x0004, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ######                                             | 12% 0.04 s 
Pickit5_read_array(eeprom, addr: 0x0008, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | #########                                          | 18% 0.05 s 
Pickit5_read_array(eeprom, addr: 0x000c, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | #############                                      | 25% 0.06 s 
Pickit5_read_array(eeprom, addr: 0x0010, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ################                                   | 31% 0.06 s 
Pickit5_read_array(eeprom, addr: 0x0014, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ###################                                | 37% 0.07 s 
Pickit5_read_array(eeprom, addr: 0x0018, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ######################                             | 43% 0.08 s 
Pickit5_read_array(eeprom, addr: 0x001c, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | #########################                          | 50% 0.09 s 
Pickit5_read_array(eeprom, addr: 0x0020, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ############################                       | 56% 0.10 s 
Pickit5_read_array(eeprom, addr: 0x0024, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ###############################                    | 62% 0.10 s 
Pickit5_read_array(eeprom, addr: 0x0028, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ##################################                 | 68% 0.11 s 
Pickit5_read_array(eeprom, addr: 0x002c, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ######################################             | 75% 0.12 s 
Pickit5_read_array(eeprom, addr: 0x0030, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | #########################################          | 81% 0.13 s 
Pickit5_read_array(eeprom, addr: 0x0034, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ############################################       | 87% 0.17 s 
Pickit5_read_array(eeprom, addr: 0x0038, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ###############################################    | 93% 0.18 s 
Pickit5_read_array(eeprom, addr: 0x003c, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ################################################## | 100% 0.18 s 
Writing 64 bytes to output file <stdout>
:20000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 // 00000> ................................ eeprom
:20002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 // 00020> ................................
:00000001FF
Pickit5_program_disable()
Pickit5_send_script(scr_len: 2, param_len: 0, data_len: 0)
Pickit5_close()
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 0)
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)

Avrdude done.  Thank you.

$ avrdude -cpickit5_isp -pattiny15 -vvv -B32 -T 'write eeprom 0 "Hello World"'
$ avrdude -cpickit5_isp -pattiny15 -vvv -B32 -T 'write eeprom 0 "Hello World"'
Avrdude version 8.0-20241129 (f916ba39)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_isp
Programmer baud rate  : 125000
Setting bit clk period: 32.0 us
Pickit5_open("usb")
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
Max packet size expected 2048, but found 512 due to EP 0x81's wMaxPacketSize
AVR part              : ATtiny15
Programming modes     : ISP, HVSP

Memory          Size  Pg size
-----------------------------
eeprom            64        1
flash           1024        1
fuse               1        1
lock               1        1
prodsig/sigrow    24        1
sernum            10        1
io                64        1
sram              32        1
signature          3        1
calibration        1        1

Variants       Package  F max    T range        V range       
--------------------------------------------------------------
ATtiny15       N/A      N/A      [N/A,    N/A]  [2.7 V, 5.5 V]
ATtiny15L-1PC  DIP8     1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1PI  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1PU  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SC  SOIC8    1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1SI  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SU  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in ISP Mode
Pickit5_get_fw_info()
Application version   : 02.01.80
Serial number         : BUR204071896
Pickit5_initialize()
Pickit5_set_ptg_mode()
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 4)
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 0)
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)
Pickit5_get_vtarget()
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)
Target Vdd: 5.16 V, target current: 0 mA
External Voltage detected: will not supply power
Pickit5_set_sck_period()
Pickit5_send_script(scr_len: 5, param_len: 4, data_len: 0)
Pickit5_program_enable()
Pickit5_send_script(scr_len: 44, param_len: 0, data_len: 0)
Pickit5_read_dev_id()
Pickit5_send_script(scr_len: 66, param_len: 0, data_len: 0)

AVR device initialized and ready to accept instructions
Avr_signature(pickit5_isp, t15)
Reading |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, signature, NULL)
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 90 06 (ATtiny15)
(write) writing 12 bytes starting from address 0x0000
Caching |                                                    | 0% 0.00 s 
Pickit5_read_array(eeprom, addr: 0x0000, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Caching | #################                                  | 33% 0.01 s 
Pickit5_read_array(eeprom, addr: 0x0004, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Caching | #################################                  | 66% 0.02 s 
Pickit5_read_array(eeprom, addr: 0x0008, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Caching | ################################################## | 100% 0.02 s 
Synching cache to device ... 
Writing |                                                    | 0% 0.00 s 
Pickit5_write_array(eeprom, addr: 0x0000, offset: 0, len: 4)
Pickit5_send_script(scr_len: 391, param_len: 8, data_len: 4)
Pickit5_read_array(eeprom, addr: 0x0000, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Pickit5_write_array(eeprom, addr: 0x0004, offset: 0, len: 4)
Pickit5_send_script(scr_len: 391, param_len: 8, data_len: 4)
Pickit5_read_array(eeprom, addr: 0x0004, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Writing | #################                                  | 33% 0.09 s 
Pickit5_write_array(eeprom, addr: 0x0008, offset: 0, len: 4)
Pickit5_send_script(scr_len: 391, param_len: 8, data_len: 4)
Pickit5_read_array(eeprom, addr: 0x0008, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Writing | ################################################## | 100% 0.14 s 
Pickit5_program_disable()
Pickit5_send_script(scr_len: 2, param_len: 0, data_len: 0)
Pickit5_close()
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 0)
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)

Avrdude done.  Thank you.

$ avrdude -cpickit5_isp -pattiny15 -vvv -B32 -Ueeprom:r:-:I
$ avrdude -cpickit5_isp -pattiny15 -vvv -B32 -Ueeprom:r:-:I
Avrdude version 8.0-20241129 (f916ba39)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_isp
Programmer baud rate  : 125000
Setting bit clk period: 32.0 us
Pickit5_open("usb")
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
Max packet size expected 2048, but found 512 due to EP 0x81's wMaxPacketSize
AVR part              : ATtiny15
Programming modes     : ISP, HVSP

Memory          Size  Pg size
-----------------------------
eeprom            64        1
flash           1024        1
fuse               1        1
lock               1        1
prodsig/sigrow    24        1
sernum            10        1
io                64        1
sram              32        1
signature          3        1
calibration        1        1

Variants       Package  F max    T range        V range       
--------------------------------------------------------------
ATtiny15       N/A      N/A      [N/A,    N/A]  [2.7 V, 5.5 V]
ATtiny15L-1PC  DIP8     1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1PI  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1PU  DIP8     1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SC  SOIC8    1.6 MHz  [0 C,   70 C]  [2.7 V, 5.5 V]
ATtiny15L-1SI  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]
ATtiny15L-1SU  SOIC8    1.6 MHz  [-40 C, 85 C]  [2.7 V, 5.5 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in ISP Mode
Pickit5_get_fw_info()
Application version   : 02.01.80
Serial number         : BUR204071896
Pickit5_initialize()
Pickit5_set_ptg_mode()
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 4)
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 0)
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)
Pickit5_get_vtarget()
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)
Target Vdd: 5.16 V, target current: 0 mA
External Voltage detected: will not supply power
Pickit5_set_sck_period()
Pickit5_send_script(scr_len: 5, param_len: 4, data_len: 0)
Pickit5_program_enable()
Pickit5_send_script(scr_len: 44, param_len: 0, data_len: 0)
Pickit5_read_dev_id()
Pickit5_send_script(scr_len: 66, param_len: 0, data_len: 0)

AVR device initialized and ready to accept instructions
Avr_signature(pickit5_isp, t15)
Reading |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, signature, NULL)
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 90 06 (ATtiny15)
Reading eeprom memory ...
Reading |                                                    | 0% 0.00 s 
Avr_read_mem(pickit5_isp, t15, eeprom, NULL)
Pickit5_read_array(eeprom, addr: 0x0000, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ###                                                | 6% 0.01 s 
Pickit5_read_array(eeprom, addr: 0x0004, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ######                                             | 12% 0.02 s 
Pickit5_read_array(eeprom, addr: 0x0008, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | #########                                          | 18% 0.02 s 
Pickit5_read_array(eeprom, addr: 0x000c, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | #############                                      | 25% 0.03 s 
Pickit5_read_array(eeprom, addr: 0x0010, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ################                                   | 31% 0.04 s 
Pickit5_read_array(eeprom, addr: 0x0014, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ###################                                | 37% 0.05 s 
Pickit5_read_array(eeprom, addr: 0x0018, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ######################                             | 43% 0.06 s 
Pickit5_read_array(eeprom, addr: 0x001c, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | #########################                          | 50% 0.07 s 
Pickit5_read_array(eeprom, addr: 0x0020, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ############################                       | 56% 0.07 s 
Pickit5_read_array(eeprom, addr: 0x0024, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ###############################                    | 62% 0.08 s 
Pickit5_read_array(eeprom, addr: 0x0028, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ##################################                 | 68% 0.09 s 
Pickit5_read_array(eeprom, addr: 0x002c, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ######################################             | 75% 0.10 s 
Pickit5_read_array(eeprom, addr: 0x0030, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | #########################################          | 81% 0.11 s 
Pickit5_read_array(eeprom, addr: 0x0034, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ############################################       | 87% 0.11 s 
Pickit5_read_array(eeprom, addr: 0x0038, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ###############################################    | 93% 0.12 s 
Pickit5_read_array(eeprom, addr: 0x003c, offset: 0, len: 4)
Pickit5_send_script(scr_len: 129, param_len: 8, data_len: 4)
Reading | ################################################## | 100% 0.13 s 
Writing 64 bytes to output file <stdout>
:2000000048656C6C6F20576F726C6400FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD8 // 00000> Hello World..................... eeprom
:20002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 // 00020> ................................
:00000001FF
Pickit5_program_disable()
Pickit5_send_script(scr_len: 2, param_len: 0, data_len: 0)
Pickit5_close()
Pickit5_set_vtarget(disable)
Pickit5_send_script(scr_len: 5, param_len: 0, data_len: 0)
Pickit5_send_script(scr_len: 1, param_len: 0, data_len: 0)

Avrdude done.  Thank you.

@MX682X
Copy link
Contributor Author

MX682X commented Dec 22, 2024

Excellent. Now I'd like to ask you to recheck xJTAG and PDI, just to make sure I haven't introduced a regression.
I have tested the interfaces I have:

./test-avrdude -e ../build_linux/src/avrdude -d1 -p "-cpickit5_jtag -p m32u4 -B400kHz -xvtarg=4.5"

./test-avrdude -e ../build_linux/src/avrdude -d1 -p "-cpickit5_jtag -p m32u4 -B400kHz -xvtarg=4.5"
Testing ../build_linux/src/avrdude 8.0-20241119 (8f5d7bfe)
Prepare "-cpickit5_jtag -p m32u4 -B400kHz -xvtarg=4.5" and press 'enter' or 'space' to continue. Press any other key to skip
✅   1,383 s: fuse access: clear, set and read eesave fuse bit
✅   1,160 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   1,771 s: chip erase
✅   4,334 s: flash -U write/verify holes_rjmp_loops_32768B.hex
✅   2,317 s: flash -T write/verify holes_rjmp_loops_32768B.hex
❌   1,390 s: eeprom check whether programmer can flip 0s to 1s (failed command below) [this failed because the chip doesn't support it]
$ ../build_linux/src/avrdude -qq -cpickit5_jtag -p m32u4 -B400kHz -xvtarg=4.5 -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅  12,714 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_1024B.hex
✅   3,021 s: chip erase and spot check flash is actually erased
✅   1,454 s: spot check eeprom is erased, too
./test-avrdude -e ../build_linux/src/avrdude -d1 -p "-c pickit5_isp -p m32u4 -B400kHz -xvtarg=4.5"

Testing ../build_linux/src/avrdude 8.0-20241119 (8f5d7bfe)
Prepare "-c pickit5_isp -p m32u4 -B400kHz -xvtarg=4.5" and press 'enter' or 'space' to continue. Press any other key to skip
✅   1,318 s: fuse access: clear, set and read eesave fuse bit
✅   1,160 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   1,551 s: chip erase
✅   4,301 s: flash -U write/verify holes_rjmp_loops_32768B.hex
✅   2,510 s: flash -T write/verify holes_rjmp_loops_32768B.hex
✅   1,295 s: eeprom check whether programmer can flip 0s to 1s
✅   1,581 s: eeprom -U write/verify holes_pack_my_box_1024B.hex
✅   2,606 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_1024B.hex
✅   3,021 s: chip erase and spot check flash is actually erased
✅   1,518 s: spot check eeprom is erased, too

./test-avrdude -e ../build_linux/src/avrdude -d1 -p "-c pickit5_tpi -p t9 -B400kHz -xvtarg=4.5"

./test-avrdude -e ../build_linux/src/avrdude -d1 -p "-c pickit5_tpi -p t9 -B400kHz -xvtarg=4.5"
Testing ../build_linux/src/avrdude 8.0-20241119 (8f5d7bfe)
Prepare "-c pickit5_tpi -p t9 -B400kHz -xvtarg=4.5" and press 'enter' or 'space' to continue. Press any other key to skip
✅   1,600 s: fuse access: clear, set and read wdton fuse bit
✅   1,225 s: chip erase
✅   2,125 s: flash -U write/verify holes_rjmp_loops_1024B.hex
✅   1,357 s: flash -T write/verify holes_rjmp_loops_1024B.hex
✅   1,326 s: chip erase and spot check flash is actually erased


./test-avrdude -e ../build_linux/src/avrdude -d1 -p "-c pickit5_updi -p avr128da48 -B400kHz -xvtarg=4.5"

Testing ../build_linux/src/avrdude 8.0-20241119 (8f5d7bfe)
Prepare "-c pickit5_updi -p avr128da48 -B400kHz -xvtarg=4.5" and press 'enter' or 'space' to continue. Press any other key to skip
✅   1,549 s: fuse access: clear, set and read eesave fuse bit
✅   1,511 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   2,379 s: chip erase
✅   5,931 s: flash -U write/verify holes_rjmp_loops_131072B.hex
✅   2,350 s: flash -T write/verify holes_rjmp_loops_131072B.hex
✅   2,702 s: eeprom check whether programmer can flip 0s to 1s
✅   3,756 s: eeprom -U write/verify holes_pack_my_box_512B.hex
✅   5,932 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_512B.hex
✅   3,471 s: chip erase and spot check flash is actually erased
✅   1,552 s: spot check eeprom is erased, too



@MCUdude
Copy link
Collaborator

MCUdude commented Dec 22, 2024

Thank you! I just left for Christmas holiday, and won't be home for about a week. I'll test for regressions as soon as I'm back

@MX682X
Copy link
Contributor Author

MX682X commented Dec 29, 2024

A general thought came to mind:

UPDI, PDI and xJTAG have a OCD messaging register. In UPDI it uses the CS Register 0x06 and 0xF18 in the data space for unidirectional communication towards the debugger. I haven't researched the other ones yet, but as PDI worked out of the box just with what I have written for UPDI, It shouldn't be too different.
I could try to write a skript that polls the CS Register on the pickit. The data rates would be slow though. (2 to 5 ms per poll I guess)
When avrdude is used in avrdude terminal mode the user could enable the poll mode through a dedicated command, This might provide some use-cases. What do you guys think, is it worth implementing?

Some sources:
Info on the data space registers: https://onlinedocs.microchip.com/oxy/GUID-F897CF19-8EAC-457A-BE11-86BDAC9B59CF-en-US-10/GUID-01647562-39B4-4115-9A61-E011680A6D21.html
Info on OCD Registers: https://github.com/feline-felicity/avr-absurd/blob/main/guesswork.md

@MCUdude
Copy link
Collaborator

MCUdude commented Dec 30, 2024

UPDI, PDI and xJTAG have a OCD messaging register. In UPDI it uses the CS Register 0x06 and 0xF18 in the data space for unidirectional communication towards the debugger. I haven't researched the other ones yet, but as PDI worked out of the box just with what I have written for UPDI, It shouldn't be too different.
I could try to write a skript that polls the CS Register on the pickit. The data rates would be slow though. (2 to 5 ms per poll I guess)
When avrdude is used in avrdude terminal mode the user could enable the poll mode through a dedicated command, This might provide some use-cases. What do you guys think, is it worth implementing?

Maybe I'm missing something. What kind of functionality for the end user will this provide?

@MX682X
Copy link
Contributor Author

MX682X commented Dec 30, 2024

Maybe I'm missing something. What kind of functionality for the end user will this provide?

It would provide an extra communication channel for ebugging. Of course, due to the limited bandwith the use would be limited.
It might be most useful on small pincount devices.
One idea would to send the 8 most significant bits of the Stack pointer or the current state of a statemachine.
However, I'm not even sure if this will work without the Debugging mode (sending "OCD " instead of "NVMPROG"). If this requires debugging mode, I wouldn't implement it.

Edit: I should add that I can understand if this feature would be out of the scope of avrdude - the purpose being reading and writing memories

@MCUdude
Copy link
Collaborator

MCUdude commented Jan 3, 2025

@stefanrueger would have to decide if this (debugging communication) is something that would fit into the Avrdude project.

Anyways, here are some more xmega PDI and JTAG tests:

$ ./test-avrdude -d1 -p "-c pickit5_pdi -p atxmega128a3u"
$ ./test-avrdude -d1 -p "-c pickit5_pdi -p atxmega128a3u"
Testing /usr/local/bin/avrdude 8.0-20241222 (26b5fdf2)
Prepare "-c pickit5_pdi -p atxmega128a3u" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.315 s: fuse access: clear, set and read eesave fuse bit
✅   0.281 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.514 s: chip erase
✅   2.835 s: flash -U write/verify holes_rjmp_loops_139264B.hex
✅   1.216 s: flash -T write/verify holes_rjmp_loops_139264B.hex
❌   0.306 s: eeprom check whether programmer can flip 0s to 1s (failed command below)
$ avrdude -qq -c pickit5_pdi -p atxmega128a3u -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅   8.185 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_2048B.hex
✅   1.368 s: chip erase and spot check flash is actually erased
✅   0.350 s: spot check eeprom is erased, too
✅   0.467 s: usersig -T/-U write/read random_data_512B.bin

One or more AVRDUDE "-c pickit5_pdi -p atxmega128a3u" tests failed. Do you want to retry this particular test? (y/n): n
$ ./test8 -a"-v" pickit5_pdi atxmega128a3u
$ ./test8 -a"-v" pickit5_pdi atxmega128a3u
Avrdude version 8.0-20241222 (26b5fdf2)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_pdi
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
AVR part              : ATxmega128A3U
Programming modes     : SPM, PDI, XMEGAJTAG
Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in PDI Mode
Application version   : 02.01.80
Serial number         : BUR204071896
Target Vdd: 3.38 V, target current: 0 mA
External Voltage detected: will not supply power

AVR device initialized and ready to accept instructions
Device signature = 1E 97 42 (ATxmega128A3, ATxmega128A3U)

Processing -U ALL:r:bak-pickit5_pdi-atxmega128a3u.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.26 s 
 - flash          | ################################################## | 100% 4.95 s 
 - application    | ################################################## | 100% 4.63 s 
 - apptable       | ################################################## | 100% 0.28 s 
 - boot           | ################################################## | 100% 0.28 s 
 - fuses          | ################################################## | 100% 0.02 s 
 - fuse0          | ################################################## | 100% 0.00 s 
 - fuse1          | ################################################## | 100% 0.00 s 
 - fuse2          | ################################################## | 100% 0.00 s 
 - fuse4          | ################################################## | 100% 0.00 s 
 - fuse5          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - calibration    | ################################################## | 100% 0.00 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - tempsense      | ################################################## | 100% 0.00 s 
 - usersig        | ################################################## | 100% 0.02 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 289368 bytes to output file bak-pickit5_pdi-atxmega128a3u.hex

Processing -T fact reset
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
Caching | ################################################## | 100% 0.26 s 
Caching | ################################################## | 100% 0.02 s 
Caching | ################################################## | 100% 0.02 s 
after the next reset the part will have F_CPU = 2.000 MHz

Processing -U ALL:w:bak-pickit5_pdi-atxmega128a3u.hex:I
Reading 141887 bytes for multiple memories from input file bak-pickit5_pdi-atxmega128a3u.hex
2048 bytes eeprom in 1 section [0, 0x7ff]: 64 pages and 0 pad bytes
Writing 2048 bytes to eeprom
Writing | ################################################## | 100% 0.58 s 
Reading | ################################################## | 100% 0.26 s 
2048 bytes of eeprom verified
139264 bytes flash in 1 section [0, 0x21fff]: 136 pages and 0 pad bytes
Writing 139264 bytes to flash
Writing | ################################################## | 100% 7.75 s 
Reading | ################################################## | 100% 4.81 s 
139264 bytes of flash verified
131072 bytes application in 1 section [0, 0x1ffff]: 128 pages and 0 pad bytes
Writing 131072 bytes to application
Writing | ################################################## | 100% 7.44 s 
Reading | ################################################## | 100% 4.53 s 
131072 bytes of application verified
8192 bytes apptable in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to apptable
Writing | ################################################## | 100% 0.50 s 
Reading | ################################################## | 100% 0.34 s 
8192 bytes of apptable verified
8192 bytes boot in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to boot
Writing | ################################################## | 100% 0.34 s 
Reading | ################################################## | 100% 0.31 s 
8192 bytes of boot verified
7 bytes fuses in 1 section [0, 6]
Writing 7 bytes to fuses, 7 bytes written
Warning: fuses verification mismatch
  device 0x00 != input 0xff at addr 0x0000 (error)
  device 0x00 != input 0xff at addr 0x0002 (error)
  device 0x00 != input 0xfe at addr 0x0004 (error)
  device 0x00 != input 0xff at addr 0x0005 (error)
Error: fuses verification mismatch
1 byte fuse0 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse0, 1 byte written, 1 verified
1 byte fuse1 in 1 section [0, 0]
Writing 1 byte (0x00) to fuse1, 1 byte written, 1 verified
1 byte fuse2 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse2, 1 byte written, 1 verified
1 byte fuse4 in 1 section [0, 0]
Writing 1 byte (0xFE) to fuse4, 1 byte written, 1 verified
1 byte fuse5 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse5, 1 byte written, 1 verified
1 byte lock in 1 section [0, 0]
Writing 1 byte (0xFF) to lock, 1 byte written, 1 verified
512 bytes usersig in 1 section [0, 0x1ff]: 1 page and 0 pad bytes
Writing 512 bytes to usersig
Writing | ################################################## | 100% 0.03 s 
Reading | ################################################## | 100% 0.06 s 
512 bytes of usersig verified

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs
performing chip erase; discarded pending writes to flash and EEPROM
after the next reset the part will have F_CPU = 2.000 MHz
$ ./test8 -a"-vv" pickit5_pdi atxmega128a3u
$ ./test8 -a"-vv" pickit5_pdi atxmega128a3u
Avrdude version 8.0-20241222 (26b5fdf2)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_pdi
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
AVR part              : ATxmega128A3U
Programming modes     : SPM, PDI, XMEGAJTAG

Memory            Size  Pg size     Offset
------------------------------------------
eeprom            2048       32   0x8c0000 
flash           139264      512   0x800000 
application     131072      512   0x800000 
apptable          8192      512   0x81e000 
boot              8192      512   0x820000 
fuses                7        1   0x8f0020 
fuse0                1        1   0x8f0020 
fuse1                1        1   0x8f0021 
fuse2                1        1   0x8f0022 
fuse4                1        1   0x8f0024 
fuse5                1        1   0x8f0025 
lock                 1        1   0x8f0027 
prodsig/sigrow      52        1   0x8e0200 
calibration          4        1   0x8e0200 
sernum              14        1   0x8e0208 
tempsense            2        1   0x8e022e 
usersig            512      512   0x8e0400 
io                4096        1          0 
sram              8192        1     0x2000 
signature            3        1  0x1000090 

Variants           Package  F max   T range         V range       
------------------------------------------------------------------
ATxmega128A3U-AN   TQFP64   32 MHz  [-40 C, 105 C]  [1.6 V, 3.6 V]
ATxmega128A3U-AU   TQFP64   32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-AUR  TQFP64   32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-MH   QFN64    32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-MHR  QFN64    32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-MN   QFN64    32 MHz  [-40 C, 105 C]  [1.6 V, 3.6 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in PDI Mode
Application version   : 02.01.80
Serial number         : BUR204071896
Target Vdd: 3.38 V, target current: 0 mA
External Voltage detected: will not supply power

AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 97 42 (ATxmega128A3, ATxmega128A3U)

Processing -U ALL:r:bak-pickit5_pdi-atxmega128a3u.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.27 s 
 - flash          | ################################################## | 100% 5.06 s 
 - application    | ################################################## | 100% 4.49 s 
 - apptable       | ################################################## | 100% 0.28 s 
 - boot           | ################################################## | 100% 0.28 s 
 - fuses          | ################################################## | 100% 0.02 s 
 - fuse0          | ################################################## | 100% 0.00 s 
 - fuse1          | ################################################## | 100% 0.00 s 
 - fuse2          | ################################################## | 100% 0.00 s 
 - fuse4          | ################################################## | 100% 0.00 s 
 - fuse5          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - calibration    | ################################################## | 100% 0.01 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - tempsense      | ################################################## | 100% 0.00 s 
 - usersig        | ################################################## | 100% 0.02 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 289368 bytes to output file bak-pickit5_pdi-atxmega128a3u.hex

Processing -T fact reset
(factory)  unchanged fuse0 0xff
(factory)  unchanged fuse1 0x00
(factory)  unchanged fuse2 0xff
(factory)  unchanged fuse4 0xfe
(factory)  unchanged fuse5 0xff
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
(write) writing 2048 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.26 s 
(write) writing 139264 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.02 s 
(write) writing 512 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.02 s 
(factory)  unchanged lock 0xff
after the next reset the part will have F_CPU = 2.000 MHz

Processing -U ALL:w:bak-pickit5_pdi-atxmega128a3u.hex:I
Reading 141887 bytes for multiple memories from input file bak-pickit5_pdi-atxmega128a3u.hex
2048 bytes eeprom in 1 section [0, 0x7ff]: 64 pages and 0 pad bytes
Writing 2048 bytes to eeprom
Writing | ################################################## | 100% 0.57 s 
Reading | ################################################## | 100% 0.26 s 
2048 bytes of eeprom verified
139264 bytes flash in 1 section [0, 0x21fff]: 136 pages and 0 pad bytes
Writing 139264 bytes to flash
Writing | ################################################## | 100% 7.75 s 
Reading | ################################################## | 100% 4.76 s 
139264 bytes of flash verified
131072 bytes application in 1 section [0, 0x1ffff]: 128 pages and 0 pad bytes
Writing 131072 bytes to application
Writing | ################################################## | 100% 7.45 s 
Reading | ################################################## | 100% 4.52 s 
131072 bytes of application verified
8192 bytes apptable in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to apptable
Writing | ################################################## | 100% 0.46 s 
Reading | ################################################## | 100% 0.28 s 
8192 bytes of apptable verified
8192 bytes boot in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to boot
Writing | ################################################## | 100% 0.33 s 
Reading | ################################################## | 100% 0.28 s 
8192 bytes of boot verified
7 bytes fuses in 1 section [0, 6]
Writing 7 bytes to fuses
Writing | ################################################## | 100% 0.07 s 
Reading | ################################################## | 100% 0.02 s 
Warning avr_verify_mem() avr.c 1350: fuses verification mismatch
  device 0x00 != input 0xff at addr 0x0000 (error)
  device 0x00 != input 0xff at addr 0x0002 (error)
  device 0x00 != input 0xfe at addr 0x0004 (error)
  device 0x00 != input 0xff at addr 0x0005 (error)
Error update_avr_verify() update.c 563: fuses verification mismatch
1 byte fuse0 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse0
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse0 verified
1 byte fuse1 in 1 section [0, 0]
Writing 1 byte (0x00) to fuse1
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse1 verified
1 byte fuse2 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse2
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse2 verified
1 byte fuse4 in 1 section [0, 0]
Writing 1 byte (0xFE) to fuse4
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse4 verified
1 byte fuse5 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse5
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse5 verified
1 byte lock in 1 section [0, 0]
Writing 1 byte (0xFF) to lock
Writing | ################################################## | 100% 0.00 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of lock verified
512 bytes usersig in 1 section [0, 0x1ff]: 1 page and 0 pad bytes
Writing 512 bytes to usersig
Writing | ################################################## | 100% 0.03 s 
Reading | ################################################## | 100% 0.02 s 
512 bytes of usersig verified

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs
performing chip erase; discarded pending writes to flash and EEPROM
after the next reset the part will have F_CPU = 2.000 MHz
$ ./test-avrdude -d1 -p "-c pickit5_pdi -p atxmega256a3bu"
$ ./test-avrdude -d1 -p "-c pickit5_pdi -p atxmega256a3bu"
Testing /usr/local/bin/avrdude 8.0-20241222 (26b5fdf2)
Prepare "-c pickit5_pdi -p atxmega256a3bu" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.306 s: fuse access: clear, set and read eesave fuse bit
✅   0.278 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.537 s: chip erase
✅   5.070 s: flash -U write/verify holes_rjmp_loops_270336B.hex
✅   1.901 s: flash -T write/verify holes_rjmp_loops_270336B.hex
❌   0.417 s: eeprom check whether programmer can flip 0s to 1s (failed command below)
$ avrdude -qq -c pickit5_pdi -p atxmega256a3bu -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅  15.161 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_4096B.hex
✅   2.212 s: chip erase and spot check flash is actually erased
✅   0.634 s: spot check eeprom is erased, too
✅   0.546 s: usersig -T/-U write/read random_data_512B.bin

One or more AVRDUDE "-c pickit5_pdi -p atxmega256a3bu" tests failed. Do you want to retry this particular test? (y/n): n
$ ./test8 -a"-v" pickit5_pdi atxmega256a3bu (Several times. Not sure why it randomly fails)
$ ./test8 -a"-v" pickit5_pdi atxmega256a3bu
Avrdude version 8.0-20241222 (26b5fdf2)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_pdi
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
AVR part              : ATxmega256A3BU
Programming modes     : SPM, PDI, XMEGAJTAG
Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in PDI Mode
Application version   : 02.01.80
Serial number         : BUR204071896
Target Vdd: 3.37 V, target current: 0 mA
External Voltage detected: will not supply power

AVR device initialized and ready to accept instructions
Device signature = 1E 98 43 (ATxmega256A3B, ATxmega256A3BU)

Processing -U ALL:r:bak-pickit5_pdi-atxmega256a3bu.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.52 s 
 - flash          | ################################################## | 100% 9.24 s 
 - application    | ###########################----------------------- | 54% 4.96 s 
Error: reading data memory failed
Error: reading from PICkit failed
Error: unable to read byte at address 0x0000
Warning: unable to read application (ret = -2), skipping...
 - apptable       | -------------------------------------------------- | 0% 0.00 s 
Error: reading from PICkit failed
Error: wrote -5 out of 158 bytes, err = Input/output error
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read apptable (ret = -2), skipping...
 - boot           | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -32 out of 158 bytes, err = Broken pipe
Error: Sending script failed
Error: sending script with upload failed
Error: wrote -32 out of 158 bytes, err = Broken pipe
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read boot (ret = -2), skipping...
 - fuses          | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -32 out of 162 bytes, err = Broken pipe
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read fuses (ret = -2), skipping...
 - fuse0          | -------------------------------------------------- | 0% 0.28 s 
Error: wrote -6 out of 138 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read fuse0 (ret = -2), skipping...
 - fuse1          | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 138 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read fuse1 (ret = -2), skipping...
 - fuse2          | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 138 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read fuse2 (ret = -2), skipping...
 - fuse4          | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 138 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read fuse4 (ret = -2), skipping...
 - fuse5          | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 138 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read fuse5 (ret = -2), skipping...
 - lock           | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 138 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read lock (ret = -2), skipping...
 - prodsig/sigrow | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 138 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read prodsig/sigrow (ret = -2), skipping...
 - calibration    | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 138 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read calibration (ret = -2), skipping...
 - sernum         | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 138 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read sernum (ret = -2), skipping...
 - tempsense      | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 138 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read tempsense (ret = -2), skipping...
 - usersig        | -------------------------------------------------- | 0% 0.00 s 
Error: wrote -6 out of 158 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: wrote -6 out of 158 bytes, err = Device not configured
Error: Sending script failed
Error: sending script with upload failed
Error: unable to read byte at address 0x0000
Warning: unable to read usersig (ret = -2), skipping...
 - signature      | ################################################## | 100% 0.00 s 
Writing 274435 bytes to output file bak-pickit5_pdi-atxmega256a3bu.hex
Error: wrote -6 out of 64 bytes, err = Device not configured
Error: Sending script failed
Error: sending script failed
Error: could not end programming, aborting
Error: wrote -6 out of 29 bytes, err = Device not configured
Error: Sending script failed
Error: sending script failed

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs

$ ./test8 -a"-v" pickit5_pdi atxmega256a3bu
Avrdude version 8.0-20241222 (26b5fdf2)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_pdi
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
AVR part              : ATxmega256A3BU
Programming modes     : SPM, PDI, XMEGAJTAG
Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in PDI Mode
Application version   : 02.01.80
Serial number         : BUR204071896
Target Vdd: 3.38 V, target current: 0 mA
External Voltage detected: will not supply power

AVR device initialized and ready to accept instructions
Device signature = 1E 98 43 (ATxmega256A3B, ATxmega256A3BU)

Processing -U ALL:r:bak-pickit5_pdi-atxmega256a3bu.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.52 s 
 - flash          | ################################################## | 100% 9.56 s 
 - application    | ################################################## | 100% 8.96 s 
 - apptable       | ################################################## | 100% 0.28 s 
 - boot           | ################################################## | 100% 0.28 s 
 - fuses          | ################################################## | 100% 0.02 s 
 - fuse0          | ################################################## | 100% 0.00 s 
 - fuse1          | ################################################## | 100% 0.00 s 
 - fuse2          | ################################################## | 100% 0.00 s 
 - fuse4          | ################################################## | 100% 0.00 s 
 - fuse5          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - calibration    | ################################################## | 100% 0.00 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - tempsense      | ################################################## | 100% 0.00 s 
 - usersig        | ################################################## | 100% 0.02 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 553560 bytes to output file bak-pickit5_pdi-atxmega256a3bu.hex

Processing -T fact reset
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
Caching | ################################################## | 100% 0.52 s 
Caching | ################################################## | 100% 0.03 s 
Caching | ################################################## | 100% 0.02 s 
after the next reset the part will have F_CPU = 2.000 MHz

Processing -U ALL:w:bak-pickit5_pdi-atxmega256a3bu.hex:I
Reading 275007 bytes for multiple memories from input file bak-pickit5_pdi-atxmega256a3bu.hex
4096 bytes eeprom in 1 section [0, 0xfff]: 128 pages and 0 pad bytes
Writing 4096 bytes to eeprom
Writing | ################################################## | 100% 1.08 s 
Reading | ################################################## | 100% 0.52 s 
4096 bytes of eeprom verified
270336 bytes flash in 1 section [0, 0x41fff]: 264 pages and 0 pad bytes
Writing 270336 bytes to flash
Writing | ################################################## | 100% 15.31 s 
Reading | ################################################## | 100% 9.46 s 
270336 bytes of flash verified
262144 bytes application in 1 section [0, 0x3ffff]: 256 pages and 0 pad bytes
Writing 262144 bytes to application
Writing | ################################################## | 100% 14.85 s 
Reading | ################################################## | 100% 9.13 s 
262144 bytes of application verified
8192 bytes apptable in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to apptable
Writing | ################################################## | 100% 0.46 s 
Reading | ################################################## | 100% 0.38 s 
8192 bytes of apptable verified
8192 bytes boot in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to boot
Writing | ################################################## | 100% 0.34 s 
Reading | ################################################## | 100% 0.29 s 
8192 bytes of boot verified
7 bytes fuses in 1 section [0, 6]
Writing 7 bytes to fuses, 7 bytes written
Warning: fuses verification mismatch
  device 0x00 != input 0xff at addr 0x0000 (error)
  device 0x00 != input 0xff at addr 0x0002 (error)
  device 0x00 != input 0xfe at addr 0x0004 (error)
  device 0x00 != input 0xff at addr 0x0005 (error)
Error: fuses verification mismatch
1 byte fuse0 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse0, 1 byte written, 1 verified
1 byte fuse1 in 1 section [0, 0]
Writing 1 byte (0x00) to fuse1, 1 byte written, 1 verified
1 byte fuse2 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse2, 1 byte written, 1 verified
1 byte fuse4 in 1 section [0, 0]
Writing 1 byte (0xFE) to fuse4, 1 byte written, 1 verified
1 byte fuse5 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse5, 1 byte written, 1 verified
1 byte lock in 1 section [0, 0]
Writing 1 byte (0xFF) to lock, 1 byte written, 1 verified
512 bytes usersig in 1 section [0, 0x1ff]: 1 page and 0 pad bytes
Writing 512 bytes to usersig
Writing | ################################################## | 100% 0.03 s 
Reading | ################################################## | 100% 0.02 s 
512 bytes of usersig verified

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs
performing chip erase; discarded pending writes to flash and EEPROM
after the next reset the part will have F_CPU = 2.000 MHz

$ ./test8 -a"-vv" pickit5_pdi atxmega256a3bu
Avrdude version 8.0-20241222 (26b5fdf2)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_pdi
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
AVR part              : ATxmega256A3BU
Programming modes     : SPM, PDI, XMEGAJTAG

Memory            Size  Pg size     Offset
------------------------------------------
eeprom            4096       32   0x8c0000 
flash           270336      512   0x800000 
application     262144      512   0x800000 
apptable          8192      512   0x83e000 
boot              8192      512   0x840000 
fuses                7        1   0x8f0020 
fuse0                1        1   0x8f0020 
fuse1                1        1   0x8f0021 
fuse2                1        1   0x8f0022 
fuse4                1        1   0x8f0024 
fuse5                1        1   0x8f0025 
lock                 1        1   0x8f0027 
prodsig/sigrow      52        1   0x8e0200 
calibration          4        1   0x8e0200 
sernum              14        1   0x8e0208 
tempsense            2        1   0x8e022e 
usersig            512      512   0x8e0400 
io                4096        1          0 
sram             16384        1     0x2000 
signature            3        1  0x1000090 

Variants            Package  F max   T range        V range       
------------------------------------------------------------------
ATxmega256A3BU-AU   TQFP64   32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]
ATxmega256A3BU-AUR  TQFP64   N/A     [N/A,    N/A]  [N/A,     N/A]
ATxmega256A3BU-MH   QFN64    32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]
ATxmega256A3BU-MHR  VQFN64   32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in PDI Mode
Application version   : 02.01.80
Serial number         : BUR204071896
Target Vdd: 3.38 V, target current: 0 mA
External Voltage detected: will not supply power

AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 98 43 (ATxmega256A3B, ATxmega256A3BU)

Processing -U ALL:r:bak-pickit5_pdi-atxmega256a3bu.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.64 s 
 - flash          | ################################################## | 100% 9.36 s 
 - application    | ################################################## | 100% 8.96 s 
 - apptable       | ################################################## | 100% 0.28 s 
 - boot           | ################################################## | 100% 0.28 s 
 - fuses          | ################################################## | 100% 0.02 s 
 - fuse0          | ################################################## | 100% 0.00 s 
 - fuse1          | ################################################## | 100% 0.00 s 
 - fuse2          | ################################################## | 100% 0.00 s 
 - fuse4          | ################################################## | 100% 0.00 s 
 - fuse5          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - calibration    | ################################################## | 100% 0.00 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - tempsense      | ################################################## | 100% 0.00 s 
 - usersig        | ################################################## | 100% 0.02 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 553560 bytes to output file bak-pickit5_pdi-atxmega256a3bu.hex

Processing -T fact reset
(factory)  unchanged fuse0 0xff
(factory)  unchanged fuse1 0x00
(factory)  unchanged fuse2 0xff
(factory)  unchanged fuse4 0xfe
(factory)  unchanged fuse5 0xff
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
(write) writing 4096 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.52 s 
(write) writing 270336 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.03 s 
(write) writing 512 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.02 s 
(factory)  unchanged lock 0xff
after the next reset the part will have F_CPU = 2.000 MHz

Processing -U ALL:w:bak-pickit5_pdi-atxmega256a3bu.hex:I
Reading 275007 bytes for multiple memories from input file bak-pickit5_pdi-atxmega256a3bu.hex
4096 bytes eeprom in 1 section [0, 0xfff]: 128 pages and 0 pad bytes
Writing 4096 bytes to eeprom
Writing | ################################################## | 100% 1.07 s 
Reading | ################################################## | 100% 0.51 s 
4096 bytes of eeprom verified
270336 bytes flash in 1 section [0, 0x41fff]: 264 pages and 0 pad bytes
Writing 270336 bytes to flash
Writing | ################################################## | 100% 15.97 s 
Reading | ################################################## | 100% 10.04 s 
270336 bytes of flash verified
262144 bytes application in 1 section [0, 0x3ffff]: 256 pages and 0 pad bytes
Writing 262144 bytes to application
Writing | ################################################## | 100% 15.16 s 
Reading | ################################################## | 100% 9.30 s 
262144 bytes of application verified
8192 bytes apptable in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to apptable
Writing | ################################################## | 100% 0.46 s 
Reading | ################################################## | 100% 0.28 s 
8192 bytes of apptable verified
8192 bytes boot in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to boot
Writing | ################################################## | 100% 0.33 s 
Reading | ################################################## | 100% 0.28 s 
8192 bytes of boot verified
7 bytes fuses in 1 section [0, 6]
Writing 7 bytes to fuses
Writing | ################################################## | 100% 0.07 s 
Reading | ################################################## | 100% 0.02 s 
Warning avr_verify_mem() avr.c 1350: fuses verification mismatch
  device 0x00 != input 0xff at addr 0x0000 (error)
  device 0x00 != input 0xff at addr 0x0002 (error)
  device 0x00 != input 0xfe at addr 0x0004 (error)
  device 0x00 != input 0xff at addr 0x0005 (error)
Error update_avr_verify() update.c 563: fuses verification mismatch
1 byte fuse0 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse0
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse0 verified
1 byte fuse1 in 1 section [0, 0]
Writing 1 byte (0x00) to fuse1
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse1 verified
1 byte fuse2 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse2
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse2 verified
1 byte fuse4 in 1 section [0, 0]
Writing 1 byte (0xFE) to fuse4
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse4 verified
1 byte fuse5 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse5
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse5 verified
1 byte lock in 1 section [0, 0]
Writing 1 byte (0xFF) to lock
Writing | ################################################## | 100% 0.00 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of lock verified
512 bytes usersig in 1 section [0, 0x1ff]: 1 page and 0 pad bytes
Writing 512 bytes to usersig
Writing | ################################################## | 100% 0.03 s 
Reading | ################################################## | 100% 0.02 s 
512 bytes of usersig verified

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs
performing chip erase; discarded pending writes to flash and EEPROM
after the next reset the part will have F_CPU = 2.000 MHz
$ ./test8 -a"-vv" pickit5_pdi atxmega256a3bu
$ ./test8 -a"-vv" pickit5_pdi atxmega256a3bu
Avrdude version 8.0-20241222 (26b5fdf2)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_pdi
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
AVR part              : ATxmega256A3BU
Programming modes     : SPM, PDI, XMEGAJTAG

Memory            Size  Pg size     Offset
------------------------------------------
eeprom            4096       32   0x8c0000 
flash           270336      512   0x800000 
application     262144      512   0x800000 
apptable          8192      512   0x83e000 
boot              8192      512   0x840000 
fuses                7        1   0x8f0020 
fuse0                1        1   0x8f0020 
fuse1                1        1   0x8f0021 
fuse2                1        1   0x8f0022 
fuse4                1        1   0x8f0024 
fuse5                1        1   0x8f0025 
lock                 1        1   0x8f0027 
prodsig/sigrow      52        1   0x8e0200 
calibration          4        1   0x8e0200 
sernum              14        1   0x8e0208 
tempsense            2        1   0x8e022e 
usersig            512      512   0x8e0400 
io                4096        1          0 
sram             16384        1     0x2000 
signature            3        1  0x1000090 

Variants            Package  F max   T range        V range       
------------------------------------------------------------------
ATxmega256A3BU-AU   TQFP64   32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]
ATxmega256A3BU-AUR  TQFP64   N/A     [N/A,    N/A]  [N/A,     N/A]
ATxmega256A3BU-MH   QFN64    32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]
ATxmega256A3BU-MHR  VQFN64   32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in PDI Mode
Application version   : 02.01.80
Serial number         : BUR204071896
Target Vdd: 3.38 V, target current: 0 mA
External Voltage detected: will not supply power

AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 98 43 (ATxmega256A3B, ATxmega256A3BU)

Processing -U ALL:r:bak-pickit5_pdi-atxmega256a3bu.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.52 s 
 - flash          | ################################################## | 100% 9.28 s 
 - application    | ################################################## | 100% 9.20 s 
 - apptable       | ################################################## | 100% 0.28 s 
 - boot           | ################################################## | 100% 0.28 s 
 - fuses          | ################################################## | 100% 0.02 s 
 - fuse0          | ################################################## | 100% 0.00 s 
 - fuse1          | ################################################## | 100% 0.00 s 
 - fuse2          | ################################################## | 100% 0.00 s 
 - fuse4          | ################################################## | 100% 0.00 s 
 - fuse5          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - calibration    | ################################################## | 100% 0.01 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - tempsense      | ################################################## | 100% 0.00 s 
 - usersig        | ################################################## | 100% 0.02 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 553560 bytes to output file bak-pickit5_pdi-atxmega256a3bu.hex

Processing -T fact reset
(factory)  unchanged fuse0 0xff
(factory)  unchanged fuse1 0x00
(factory)  unchanged fuse2 0xff
(factory)  unchanged fuse4 0xfe
(factory)  unchanged fuse5 0xff
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
(write) writing 4096 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.52 s 
(write) writing 270336 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.03 s 
(write) writing 512 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.02 s 
(factory)  unchanged lock 0xff
after the next reset the part will have F_CPU = 2.000 MHz

Processing -U ALL:w:bak-pickit5_pdi-atxmega256a3bu.hex:I
Reading 275007 bytes for multiple memories from input file bak-pickit5_pdi-atxmega256a3bu.hex
4096 bytes eeprom in 1 section [0, 0xfff]: 128 pages and 0 pad bytes
Writing 4096 bytes to eeprom
Writing | ################################################## | 100% 1.08 s 
Reading | ################################################## | 100% 0.52 s 
4096 bytes of eeprom verified
270336 bytes flash in 1 section [0, 0x41fff]: 264 pages and 0 pad bytes
Writing 270336 bytes to flash
Writing | ################################################## | 100% 15.18 s 
Reading | ################################################## | 100% 9.39 s 
270336 bytes of flash verified
262144 bytes application in 1 section [0, 0x3ffff]: 256 pages and 0 pad bytes
Writing 262144 bytes to application
Writing | ################################################## | 100% 14.89 s 
Reading | ################################################## | 100% 8.96 s 
262144 bytes of application verified
8192 bytes apptable in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to apptable
Writing | ################################################## | 100% 0.46 s 
Reading | ################################################## | 100% 0.29 s 
8192 bytes of apptable verified
8192 bytes boot in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to boot
Writing | ################################################## | 100% 0.33 s 
Reading | ################################################## | 100% 0.28 s 
8192 bytes of boot verified
7 bytes fuses in 1 section [0, 6]
Writing 7 bytes to fuses
Writing | ################################################## | 100% 0.07 s 
Reading | ################################################## | 100% 0.02 s 
Warning avr_verify_mem() avr.c 1350: fuses verification mismatch
  device 0x00 != input 0xff at addr 0x0000 (error)
  device 0x00 != input 0xff at addr 0x0002 (error)
  device 0x00 != input 0xfe at addr 0x0004 (error)
  device 0x00 != input 0xff at addr 0x0005 (error)
Error update_avr_verify() update.c 563: fuses verification mismatch
1 byte fuse0 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse0
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse0 verified
1 byte fuse1 in 1 section [0, 0]
Writing 1 byte (0x00) to fuse1
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse1 verified
1 byte fuse2 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse2
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse2 verified
1 byte fuse4 in 1 section [0, 0]
Writing 1 byte (0xFE) to fuse4
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse4 verified
1 byte fuse5 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse5
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse5 verified
1 byte lock in 1 section [0, 0]
Writing 1 byte (0xFF) to lock
Writing | ################################################## | 100% 0.00 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of lock verified
512 bytes usersig in 1 section [0, 0x1ff]: 1 page and 0 pad bytes
Writing 512 bytes to usersig
Writing | ################################################## | 100% 0.03 s 
Reading | ################################################## | 100% 0.02 s 
512 bytes of usersig verified

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs
$ ./test-avrdude -d1 -p "-c pickit5_jtag -p atxmega256a3bu"
$ ./test-avrdude -d1 -p "-c pickit5_jtag -p atxmega256a3bu"
Testing /usr/local/bin/avrdude 8.0-20241222 (26b5fdf2)
Prepare "-c pickit5_jtag -p atxmega256a3bu" and press 'enter' or 'space' to continue. Press any other key to skip
❌   0.107 s: fuse access: clear, set and read eesave fuse bit (failed command below)
$ avrdude -qq -c pickit5_jtag -p atxmega256a3bu -T "config eesave=0; config eesave=1; config eesave"
❌   0.100 s: fuse access: set eesave fusebit to delete EEPROM on chip erase (failed command below)
$ avrdude -qq -c pickit5_jtag -p atxmega256a3bu -T "config eesave=ee*erased"
^C

[power cycled the programmer and the target]

$ ./test-avrdude -d1 -p "-c pickit5_jtag -p atxmega256a3bu"
Testing /usr/local/bin/avrdude 8.0-20241222 (26b5fdf2)
Prepare "-c pickit5_jtag -p atxmega256a3bu" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.387 s: fuse access: clear, set and read eesave fuse bit
✅   0.276 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.738 s: chip erase
✅  10.874 s: flash -U write/verify holes_rjmp_loops_270336B.hex
✅   5.049 s: flash -T write/verify holes_rjmp_loops_270336B.hex
❌   0.344 s: eeprom check whether programmer can flip 0s to 1s (failed command below)
$ avrdude -qq -c pickit5_jtag -p atxmega256a3bu -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅  41.923 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_4096B.hex
✅   5.450 s: chip erase and spot check flash is actually erased
✅   0.575 s: spot check eeprom is erased, too
✅   0.748 s: usersig -T/-U write/read random_data_512B.bin

One or more AVRDUDE "-c pickit5_jtag -p atxmega256a3bu" tests failed. Do you want to retry this particular test? (y/n): n
$ ./test8 -a"-vv" pickit5_jtag atxmega256a3bu
$ ./test8 -a"-vv" pickit5_jtag atxmega256a3bu
Avrdude version 8.0-20241222 (26b5fdf2)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_jtag
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
AVR part              : ATxmega256A3BU
Programming modes     : SPM, PDI, XMEGAJTAG

Memory            Size  Pg size     Offset
------------------------------------------
eeprom            4096       32   0x8c0000 
flash           270336      512   0x800000 
application     262144      512   0x800000 
apptable          8192      512   0x83e000 
boot              8192      512   0x840000 
fuses                7        1   0x8f0020 
fuse0                1        1   0x8f0020 
fuse1                1        1   0x8f0021 
fuse2                1        1   0x8f0022 
fuse4                1        1   0x8f0024 
fuse5                1        1   0x8f0025 
lock                 1        1   0x8f0027 
prodsig/sigrow      52        1   0x8e0200 
calibration          4        1   0x8e0200 
sernum              14        1   0x8e0208 
tempsense            2        1   0x8e022e 
usersig            512      512   0x8e0400 
io                4096        1          0 
sram             16384        1     0x2000 
signature            3        1  0x1000090 

Variants            Package  F max   T range        V range       
------------------------------------------------------------------
ATxmega256A3BU-AU   TQFP64   32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]
ATxmega256A3BU-AUR  TQFP64   N/A     [N/A,    N/A]  [N/A,     N/A]
ATxmega256A3BU-MH   QFN64    32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]
ATxmega256A3BU-MHR  VQFN64   32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in JTAG Mode
Application version   : 02.01.80
Serial number         : BUR204071896
Target Vdd: 3.38 V, target current: 0 mA
External Voltage detected: will not supply power

AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 98 43 (ATxmega256A3B, ATxmega256A3BU)

Processing -U ALL:r:bak-pickit5_jtag-atxmega256a3bu.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 1.15 s 
 - flash          | ################################################## | 100% 28.69 s 
 - application    | ################################################## | 100% 27.57 s 
 - apptable       | ################################################## | 100% 0.85 s 
 - boot           | ################################################## | 100% 0.85 s 
 - fuses          | ################################################## | 100% 0.04 s 
 - fuse0          | ################################################## | 100% 0.01 s 
 - fuse1          | ################################################## | 100% 0.01 s 
 - fuse2          | ################################################## | 100% 0.01 s 
 - fuse4          | ################################################## | 100% 0.01 s 
 - fuse5          | ################################################## | 100% 0.01 s 
 - lock           | ################################################## | 100% 0.01 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - calibration    | ################################################## | 100% 0.01 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - tempsense      | ################################################## | 100% 0.00 s 
 - usersig        | ################################################## | 100% 0.05 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 553560 bytes to output file bak-pickit5_jtag-atxmega256a3bu.hex

Processing -T fact reset
(factory)  unchanged fuse0 0xff
(factory)  unchanged fuse1 0x00
(factory)  unchanged fuse2 0xff
(factory)  unchanged fuse4 0xfe
(factory)  unchanged fuse5 0xff
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
(write) writing 4096 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 1.51 s 
(write) writing 270336 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.03 s 
(write) writing 512 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.05 s 
(factory)  unchanged lock 0xff
after the next reset the part will have F_CPU = 2.000 MHz

Processing -U ALL:w:bak-pickit5_jtag-atxmega256a3bu.hex:I
Reading 275007 bytes for multiple memories from input file bak-pickit5_jtag-atxmega256a3bu.hex
4096 bytes eeprom in 1 section [0, 0xfff]: 128 pages and 0 pad bytes
Writing 4096 bytes to eeprom
Writing | ################################################## | 100% 1.98 s 
Reading | ################################################## | 100% 1.59 s 
4096 bytes of eeprom verified
270336 bytes flash in 1 section [0, 0x41fff]: 264 pages and 0 pad bytes
Writing 270336 bytes to flash
Writing | ################################################## | 100% 34.15 s 
Reading | ################################################## | 100% 28.23 s 
270336 bytes of flash verified
262144 bytes application in 1 section [0, 0x3ffff]: 256 pages and 0 pad bytes
Writing 262144 bytes to application
Writing | ################################################## | 100% 32.98 s 
Reading | ################################################## | 100% 28.28 s 
262144 bytes of application verified
8192 bytes apptable in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to apptable
Writing | ################################################## | 100% 1.02 s 
Reading | ################################################## | 100% 0.85 s 
8192 bytes of apptable verified
8192 bytes boot in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to boot
Writing | ################################################## | 100% 0.91 s 
Reading | ################################################## | 100% 0.90 s 
8192 bytes of boot verified
7 bytes fuses in 1 section [0, 6]
Writing 7 bytes to fuses
Writing | ################################################## | 100% 0.09 s 
Reading | ################################################## | 100% 0.04 s 
Warning avr_verify_mem() avr.c 1350: fuses verification mismatch
  device 0x00 != input 0xff at addr 0x0000 (error)
  device 0x00 != input 0xff at addr 0x0002 (error)
  device 0x00 != input 0xfe at addr 0x0004 (error)
  device 0x00 != input 0xff at addr 0x0005 (error)
Error update_avr_verify() update.c 563: fuses verification mismatch
1 byte fuse0 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse0
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse0 verified
1 byte fuse1 in 1 section [0, 0]
Writing 1 byte (0x00) to fuse1
Writing | ################################################## | 100% 0.02 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse1 verified
1 byte fuse2 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse2
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse2 verified
1 byte fuse4 in 1 section [0, 0]
Writing 1 byte (0xFE) to fuse4
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse4 verified
1 byte fuse5 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse5
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse5 verified
1 byte lock in 1 section [0, 0]
Writing 1 byte (0xFF) to lock
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of lock verified
512 bytes usersig in 1 section [0, 0x1ff]: 1 page and 0 pad bytes
Writing 512 bytes to usersig
Writing | ################################################## | 100% 0.07 s 
Reading | ################################################## | 100% 0.05 s 
512 bytes of usersig verified

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs
performing chip erase; discarded pending writes to flash and EEPROM
after the next reset the part will have F_CPU = 2.000 MHz

@xedbg
Copy link

xedbg commented Jan 6, 2025

It would provide an extra communication channel for ebugging. Of course, due to the limited bandwith the use would be limited.
It might be most useful on small pincount devices.

The OCD Messaging register can be quite cool - I have some code lying around somewhere for getting it to work; but I/we never really put a full system in place, and went all-in on just using a UART on separate pins for printf. Let me know if someone wants to look into this further. (Can't remember, but I think it needs OCD enabled since its an "OCD message").

@stefanrueger
Copy link
Collaborator

debugging communication

Sounds useful, but would need good documentation (at least in the .tex documentation) and documented application examples. Maybe have this as a separate PR after this one has been merged: the main priority for this PR should be to iron out the corner cases for r/w of memories. Thanks for the wonderful collaboration @MX682X and @MCUdude; I sense we are getting closer to finishing this with every iteration.

@MX682X
Copy link
Contributor Author

MX682X commented Jan 6, 2025

@stefanrueger For some reason I'm getting a weird error when running test8: there is always a flash verification mismatch when running -r1 on jtag targets, but never on other tests or other programming interfaces. I've tested it on a 32u4 and on a mega2560. Is this something to be concerned of?

./test8 -e ../build_linux/src/avrdude -a"-xvtarg=4.5" -a"-B500kHz" -r1 pickit5_jtag m2560
Target successfully erased
Reading 266272 bytes for multiple memories from input file bak-pickit5_jtag-m2560.hex
Writing 4096 bytes to eeprom
Writing | ################################################## | 100% 2.57 s 
Reading | ################################################## | 100% 1.92 s 
4096 bytes of eeprom verified
Writing 262144 bytes to flash
Writing | ################################################## | 100% 41.58 s 
Reading | ################################################## | 100% 35.35 s 
Warning: flash verification mismatch
  device 0x33 != input 0x73 at addr 0x0000 (error)
Error: flash verification mismatch
Writing 1 byte (0x62) to lfuse, 1 byte written, 1 verified
Writing 1 byte (0x9E) to hfuse, 1 byte written, 1 verified
Writing 1 byte (0xFF) to efuse, 1 byte written, 1 verified
Writing 1 byte (0xFF) to lock, 1 byte written, 1 verified

@MCUdude
Copy link
Collaborator

MCUdude commented Jan 6, 2025

It would provide an extra communication channel for debugging. Of course, due to the limited bandwith the use would be limited.
It might be most useful on small pincount devices.

The OCD Messaging register can be quite cool - I have some code lying around somewhere for getting it to work; but I/we never really put a full system in place, and went all-in on just using a UART on separate pins for printf. Let me know if someone wants to look into this further. (Can't remember, but I think it needs OCD enabled since its an "OCD message").

I just looked AVR OCD messaging up, and this looks really interesting! It would be really cool if one could "printf" to the UPDI port instead of using UART for crude debugging. Maybe Avrdude could implement this in terminal mode? And could this be implemented for the SerialUPDI programmer as well? This could be really useful when you don't have a spare UART port.

$ avrdude -cpickit5 -pattiny402 -T "ocd"

Feel free to open a dedicated issue to discus this, if this is something that could be possible to implement.

@stefanrueger
Copy link
Collaborator

Is this something to be concerned of?

I'd say so!

Maybe first create a random contents file my-pickit5_jtag-m2560.hex:

avrdude -qqc dryrun -p m2560 -U ALL:r:my-pickit5_jtag-m2560.hex:I -x random=1

Then try out some versions of below

avrdude -xvtarg=4.5 -B500kHz -c pickit5_jtag -p m2560 -U ALL:w:my-pickit5_jtag-m2560.hex:I

Maybe try out only writing flash from that my-pickit5_jtag-m2560.hex file

avrdude -xvtarg=4.5 -B500kHz -c pickit5_jtag -p m2560 -U flash:w:my-pickit5_jtag-m2560.hex:I

And see what happens... Perhaps -vvv helps debugging?

@MX682X
Copy link
Contributor Author

MX682X commented Jan 13, 2025

figured out why jtag was failing - they are using word addresses instead of byte addressing. Luckily, I noticed the inconsistency on the end-address in MPLAB logging.

About xJTAG - when I started working on the script decoder I decided to use strncmp with a length of 10 - enough for UPDI devices, but not for xJTAG, so I suspect the code might have loaded the wrong scripts, which might lead to the fails? replaced with strcmp as I can be sure that one string is definitely NULL terminated.

I've also added the upcoming EC Series from the scripts.

@stefanrueger
Copy link
Collaborator

Looks like great progress @MX682X. Let the team know when you think this PR can be tested.

@MX682X
Copy link
Contributor Author

MX682X commented Jan 14, 2025

it is ready to test, I'm just not sure if the changes that I made will have an effect.

As exams are coming up, I'm not able to work much on the code right now though.

@stefanrueger
Copy link
Collaborator

@MX682X Cool, thank you! I am sure @MCUdude or @mcuee will be able to test the code and report back whether it's suitable for merging. After a brief(!) glance over the code I think it's OK to merge from a coding perspective (just saw one tiny inconsequential typo: redundand -> redundant).

@MCUdude
Copy link
Collaborator

MCUdude commented Jan 15, 2025

Here's a new test with the PICKit4/5 in xJTAG mode connected to the ATxmega256A3BU. Looks promising!

[power to programmer and target applied]

 ./test-avrdude -d1 -p "-c pickit5_jtag -p atxmega256a3bu"
Testing /usr/local/bin/avrdude 8.0-20250113 (29438a2b)
Prepare "-c pickit5_jtag -p atxmega256a3bu" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.317 s: fuse access: clear, set and read eesave fuse bit
✅   0.276 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.731 s: chip erase
❌   0.927 s: flash -U write/verify holes_rjmp_loops_270336B.hex (failed command below)
$ avrdude -qq -c pickit5_jtag -p atxmega256a3bu -Uflash:w:./test_files/holes_rjmp_loops_270336B.hex
❌   0.527 s: flash -U write/verify rjmp_loops_for_bootloaders_270336B.hex (failed command below)
$ avrdude -qq -c pickit5_jtag -p atxmega256a3bu -Uflash:w:./test_files/rjmp_loops_for_bootloaders_270336B.hex
❌  10.251 s: flash -T write/verify holes_rjmp_loops_270336B.hex (failed command below)
$ avrdude -qq -c pickit5_jtag -p atxmega256a3bu -T "write flash ./test_files/holes_rjmp_loops_270336B.hex:a"
✅  45.430 s: flash -T write/verify rjmp_loops_for_bootloaders_270336B.hex
❌   0.338 s: eeprom check whether programmer can flip 0s to 1s (failed command below)
$ avrdude -qq -c pickit5_jtag -p atxmega256a3bu -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅  62.272 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_4096B.hex
✅   5.447 s: chip erase and spot check flash is actually erased
✅   0.570 s: spot check eeprom is erased, too
✅   0.749 s: usersig -T/-U write/read random_data_512B.bin

One or more AVRDUDE "-c pickit5_jtag -p atxmega256a3bu" tests failed. Do you want to retry this particular test? (y/n): n

[power cycled the programmer]

$ ./test8 -a"-vv" pickit5_jtag atxmega256a3bu
Avrdude version 8.0-20250113 (29438a2b)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_jtag
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
AVR part              : ATxmega256A3BU
Programming modes     : SPM, PDI, XMEGAJTAG

Memory            Size  Pg size     Offset
------------------------------------------
eeprom            4096       32   0x8c0000 
flash           270336      512   0x800000 
application     262144      512   0x800000 
apptable          8192      512   0x83e000 
boot              8192      512   0x840000 
fuses                7        1   0x8f0020 
fuse0                1        1   0x8f0020 
fuse1                1        1   0x8f0021 
fuse2                1        1   0x8f0022 
fuse4                1        1   0x8f0024 
fuse5                1        1   0x8f0025 
lock                 1        1   0x8f0027 
prodsig/sigrow      52        1   0x8e0200 
calibration          4        1   0x8e0200 
sernum              14        1   0x8e0208 
tempsense            2        1   0x8e022e 
usersig            512      512   0x8e0400 
io                4096        1          0 
sram             16384        1     0x2000 
signature            3        1  0x1000090 

Variants            Package  F max   T range        V range       
------------------------------------------------------------------
ATxmega256A3BU-AU   TQFP64   32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]
ATxmega256A3BU-AUR  TQFP64   N/A     [N/A,    N/A]  [N/A,     N/A]
ATxmega256A3BU-MH   QFN64    32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]
ATxmega256A3BU-MHR  VQFN64   32 MHz  [-40 C, 85 C]  [1.6 V, 3.6 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in JTAG Mode
Application version   : 02.01.80
Serial number         : BUR204071896
Target Vdd: 3.38 V, target current: 0 mA
External Voltage detected: will not supply power

AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 98 43 (ATxmega256A3B, ATxmega256A3BU)

Processing -U ALL:r:bak-pickit5_jtag-atxmega256a3bu.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 1.16 s 
 - flash          | ################################################## | 100% 28.09 s 
 - application    | ################################################## | 100% 27.30 s 
 - apptable       | ################################################## | 100% 0.85 s 
 - boot           | ################################################## | 100% 0.85 s 
 - fuses          | ################################################## | 100% 0.04 s 
 - fuse0          | ################################################## | 100% 0.01 s 
 - fuse1          | ################################################## | 100% 0.01 s 
 - fuse2          | ################################################## | 100% 0.01 s 
 - fuse4          | ################################################## | 100% 0.01 s 
 - fuse5          | ################################################## | 100% 0.01 s 
 - lock           | ################################################## | 100% 0.01 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - calibration    | ################################################## | 100% 0.01 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - tempsense      | ################################################## | 100% 0.00 s 
 - usersig        | ################################################## | 100% 0.05 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 553560 bytes to output file bak-pickit5_jtag-atxmega256a3bu.hex

Processing -T fact reset
(factory)  unchanged fuse0 0xff
(factory)  unchanged fuse1 0x00
(factory)  unchanged fuse2 0xff
(factory)  unchanged fuse4 0xfe
(factory)  unchanged fuse5 0xff
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
(write) writing 4096 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 1.15 s 
(write) writing 270336 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.03 s 
(write) writing 512 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.06 s 
(factory)  unchanged lock 0xff
after the next reset the part will have F_CPU = 2.000 MHz

Processing -U ALL:w:bak-pickit5_jtag-atxmega256a3bu.hex:I
Reading 275007 bytes for multiple memories from input file bak-pickit5_jtag-atxmega256a3bu.hex
4096 bytes eeprom in 1 section [0, 0xfff]: 128 pages and 0 pad bytes
Writing 4096 bytes to eeprom
Writing | ################################################## | 100% 1.79 s 
Reading | ################################################## | 100% 1.15 s 
4096 bytes of eeprom verified
270336 bytes flash in 1 section [0, 0x41fff]: 264 pages and 0 pad bytes
Writing 270336 bytes to flash
Writing | ################################################## | 100% 33.67 s 
Reading | ################################################## | 100% 28.10 s 
270336 bytes of flash verified
262144 bytes application in 1 section [0, 0x3ffff]: 256 pages and 0 pad bytes
Writing 262144 bytes to application
Writing | ################################################## | 100% 27.69 s 
Reading | ################################################## | 100% 27.43 s 
262144 bytes of application verified
8192 bytes apptable in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to apptable
Writing | ################################################## | 100% 1.02 s 
Reading | ################################################## | 100% 0.85 s 
8192 bytes of apptable verified
8192 bytes boot in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to boot
Writing | ################################################## | 100% 0.90 s 
Reading | ################################################## | 100% 0.85 s 
8192 bytes of boot verified
7 bytes fuses in 1 section [0, 6]
Writing 7 bytes to fuses
Writing | ################################################## | 100% 0.08 s 
Reading | ################################################## | 100% 0.04 s 
7 bytes of fuses verified
1 byte fuse0 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse0
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse0 verified
1 byte fuse1 in 1 section [0, 0]
Writing 1 byte (0x00) to fuse1
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse1 verified
1 byte fuse2 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse2
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse2 verified
1 byte fuse4 in 1 section [0, 0]
Writing 1 byte (0xFE) to fuse4
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse4 verified
1 byte fuse5 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse5
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse5 verified
1 byte lock in 1 section [0, 0]
Writing 1 byte (0xFF) to lock
Writing | ################################################## | 100% 0.00 s 
Reading | ################################################## | 100% 0.01 s 
1 byte of lock verified
512 bytes usersig in 1 section [0, 0x1ff]: 1 page and 0 pad bytes
Writing 512 bytes to usersig
Writing | ################################################## | 100% 0.07 s 
Reading | ################################################## | 100% 0.05 s 
512 bytes of usersig verified

Processing -U ALL:v:bak-pickit5_jtag-atxmega256a3bu.hex:I
Verifying 275007 bytes of multiple memories against input file bak-pickit5_jtag-atxmega256a3bu.hex
Reading | ################################################## | 100% 1.15 s 
4096 bytes of eeprom verified
Reading | ################################################## | 100% 28.07 s 
270336 bytes of flash verified
Reading | ################################################## | 100% 27.24 s 
262144 bytes of application verified
Reading | ################################################## | 100% 0.85 s 
8192 bytes of apptable verified
Reading | ################################################## | 100% 0.93 s 
8192 bytes of boot verified
Reading | ################################################## | 100% 0.04 s 
7 bytes of fuses verified
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse0 verified
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse1 verified
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse2 verified
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse4 verified
Reading | ################################################## | 100% 0.01 s 
1 byte of fuse5 verified
Reading | ################################################## | 100% 0.00 s 
1 byte of lock verified
Reading | ################################################## | 100% 0.02 s 
52 bytes of prodsig/sigrow verified
Reading | ################################################## | 100% 0.02 s 
4 bytes of calibration verified
Reading | ################################################## | 100% 0.01 s 
14 bytes of sernum verified
Reading | ################################################## | 100% 0.00 s 
2 bytes of tempsense verified
Reading | ################################################## | 100% 0.06 s 
512 bytes of usersig verified
Reading | ################################################## | 100% 0.00 s 
3 bytes of signature verified

Avrdude done.  Thank you.

$ ./test-avrdude -d1 -p "-c pickit5_jtag -p atxmega256a3bu"
Testing /usr/local/bin/avrdude 8.0-20250113 (29438a2b)
Prepare "-c pickit5_jtag -p atxmega256a3bu" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.307 s: fuse access: clear, set and read eesave fuse bit
✅   0.277 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.851 s: chip erase
✅  10.864 s: flash -U write/verify holes_rjmp_loops_270336B.hex
✅   4.992 s: flash -T write/verify holes_rjmp_loops_270336B.hex
❌   0.334 s: eeprom check whether programmer can flip 0s to 1s (failed command below)
$ avrdude -qq -c pickit5_jtag -p atxmega256a3bu -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅  41.563 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_4096B.hex
✅   5.516 s: chip erase and spot check flash is actually erased
✅   0.574 s: spot check eeprom is erased, too
✅   0.751 s: usersig -T/-U write/read random_data_512B.bin

One or more AVRDUDE "-c pickit5_jtag -p atxmega256a3bu" tests failed. Do you want to retry this particular test? (y/n): n

$ ./test-avrdude -d1 -p "-c pickit5_jtag -p atxmega256a3bu"
Testing /usr/local/bin/avrdude 8.0-20250113 (29438a2b)
Prepare "-c pickit5_jtag -p atxmega256a3bu" and press 'enter' or 'space' to continue. Press any other key to skip
✅   0.316 s: fuse access: clear, set and read eesave fuse bit
✅   0.279 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅   0.747 s: chip erase
✅  10.906 s: flash -U write/verify holes_rjmp_loops_270336B.hex
✅   4.990 s: flash -T write/verify holes_rjmp_loops_270336B.hex
❌   0.335 s: eeprom check whether programmer can flip 0s to 1s (failed command below)
$ avrdude -qq -c pickit5_jtag -p atxmega256a3bu -Ueeprom:w:0x55:m -Ueeprom:w:0xaa:m
# ... the next test may therefore take longer
✅  41.544 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_4096B.hex
✅   5.440 s: chip erase and spot check flash is actually erased
✅   0.572 s: spot check eeprom is erased, too
✅   0.744 s: usersig -T/-U write/read random_data_512B.bin

One or more AVRDUDE "-c pickit5_jtag -p atxmega256a3bu" tests failed. Do you want to retry this particular test? (y/n): n

@MCUdude
Copy link
Collaborator

MCUdude commented Jan 15, 2025

The PDI test with the ATxmega128A3U failed at the first attempt, but suceeded at the second attempt, without power
cycling the programmer or the target. Not sure if this is caused by a flakey USB connector, or if it's Avrdude's fault.

EDIT: It is caused by a sloppy micro USB cable. It fails immediately if I tap the PICkit4 while it's programming.

$ ./test8 -a"-vv" pickit5_pdi atxmega128a3u
Avrdude version 8.0-20250113 (29438a2b)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_pdi
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
AVR part              : ATxmega128A3U
Programming modes     : SPM, PDI, XMEGAJTAG

Memory            Size  Pg size     Offset
------------------------------------------
eeprom            2048       32   0x8c0000 
flash           139264      512   0x800000 
application     131072      512   0x800000 
apptable          8192      512   0x81e000 
boot              8192      512   0x820000 
fuses                7        1   0x8f0020 
fuse0                1        1   0x8f0020 
fuse1                1        1   0x8f0021 
fuse2                1        1   0x8f0022 
fuse4                1        1   0x8f0024 
fuse5                1        1   0x8f0025 
lock                 1        1   0x8f0027 
prodsig/sigrow      52        1   0x8e0200 
calibration          4        1   0x8e0200 
sernum              14        1   0x8e0208 
tempsense            2        1   0x8e022e 
usersig            512      512   0x8e0400 
io                4096        1          0 
sram              8192        1     0x2000 
signature            3        1  0x1000090 

Variants           Package  F max   T range         V range       
------------------------------------------------------------------
ATxmega128A3U-AN   TQFP64   32 MHz  [-40 C, 105 C]  [1.6 V, 3.6 V]
ATxmega128A3U-AU   TQFP64   32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-AUR  TQFP64   32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-MH   QFN64    32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-MHR  QFN64    32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-MN   QFN64    32 MHz  [-40 C, 105 C]  [1.6 V, 3.6 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in PDI Mode
Application version   : 02.01.80
Serial number         : BUR204071896
Target Vdd: 3.38 V, target current: 0 mA
External Voltage detected: will not supply power

AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 97 42 (ATxmega128A3, ATxmega128A3U)

Processing -U ALL:r:bak-pickit5_pdi-atxmega128a3u.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.26 s 
 - flash          | #                                                  | 2% 0.10 s 
Usbdev_bulk_recv(): usb_bulk_read() error: Input/output error
 - flash          | #------------------------------------------------- | 2% 0.40 s 
Error pickit5_upload_data() pickit5.c 479: reading data memory failed
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 158 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read flash (ret = -2), skipping...
 - application    | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 158 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 158 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read application (ret = -2), skipping...
 - apptable       | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 158 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 158 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read apptable (ret = -2), skipping...
 - boot           | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 158 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 158 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read boot (ret = -2), skipping...
 - fuses          | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read fuses (ret = -2), skipping...
 - fuse0          | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read fuse0 (ret = -2), skipping...
 - fuse1          | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read fuse1 (ret = -2), skipping...
 - fuse2          | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read fuse2 (ret = -2), skipping...
 - fuse4          | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read fuse4 (ret = -2), skipping...
 - fuse5          | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read fuse5 (ret = -2), skipping...
 - lock           | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read lock (ret = -2), skipping...
 - prodsig/sigrow | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read prodsig/sigrow (ret = -2), skipping...
 - calibration    | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read calibration (ret = -2), skipping...
 - sernum         | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read sernum (ret = -2), skipping...
 - tempsense      | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -2 out of 138 bytes, err = No such file or directory
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read tempsense (ret = -2), skipping...
 - usersig        | -------------------------------------------------- | 0% 0.00 s 
Error usbdev_send() usb_libusb.c 293: wrote -34 out of 158 bytes, err = Result too large
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error usbdev_send() usb_libusb.c 293: wrote -34 out of 158 bytes, err = Result too large
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_upload_data() pickit5.c 472: sending script with upload failed
Error avr_read_mem() avr.c 485: unable to read byte at address 0x0000
Warning do_op() update.c 721: unable to read usersig (ret = -2), skipping...
 - signature      | ################################################## | 100% 0.00 s 
Writing 2051 bytes to output file bak-pickit5_pdi-atxmega128a3u.hex
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 64 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_send_script_cmd() pickit5.c 427: sending script failed
Error main() main.c 1828: could not end programming, aborting
Error usbdev_send() usb_libusb.c 293: wrote -6 out of 29 bytes, err = Device not configured
Error pickit5_send_script() pickit5.c 333: Sending script failed
Error pickit5_send_script_cmd() pickit5.c 427: sending script failed

Avrdude done.  Thank you.
-------------------------------
Re-running to create error logs

[ran the same command again without power cycling the programmer or the target]

$ ./test8 -a"-vv" pickit5_pdi atxmega128a3u
Avrdude version 8.0-20250113 (29438a2b)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit5_pdi
Usbdev_open(): found MPLAB? PICkit 4, serno: BUR204071896
AVR part              : ATxmega128A3U
Programming modes     : SPM, PDI, XMEGAJTAG

Memory            Size  Pg size     Offset
------------------------------------------
eeprom            2048       32   0x8c0000 
flash           139264      512   0x800000 
application     131072      512   0x800000 
apptable          8192      512   0x81e000 
boot              8192      512   0x820000 
fuses                7        1   0x8f0020 
fuse0                1        1   0x8f0020 
fuse1                1        1   0x8f0021 
fuse2                1        1   0x8f0022 
fuse4                1        1   0x8f0024 
fuse5                1        1   0x8f0025 
lock                 1        1   0x8f0027 
prodsig/sigrow      52        1   0x8e0200 
calibration          4        1   0x8e0200 
sernum              14        1   0x8e0208 
tempsense            2        1   0x8e022e 
usersig            512      512   0x8e0400 
io                4096        1          0 
sram              8192        1     0x2000 
signature            3        1  0x1000090 

Variants           Package  F max   T range         V range       
------------------------------------------------------------------
ATxmega128A3U-AN   TQFP64   32 MHz  [-40 C, 105 C]  [1.6 V, 3.6 V]
ATxmega128A3U-AU   TQFP64   32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-AUR  TQFP64   32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-MH   QFN64    32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-MHR  QFN64    32 MHz  [-40 C,  85 C]  [1.6 V, 3.6 V]
ATxmega128A3U-MN   QFN64    32 MHz  [-40 C, 105 C]  [1.6 V, 3.6 V]

Programmer type       : pickit5
Description           : MPLAB(R) PICkit 5, PICkit 4 and SNAP (PIC) in PDI Mode
Application version   : 02.01.80
Serial number         : BUR204071896
Target Vdd: 3.38 V, target current: 0 mA
External Voltage detected: will not supply power

AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00 s 
Device signature = 1E 97 42 (ATxmega128A3, ATxmega128A3U)

Processing -U ALL:r:bak-pickit5_pdi-atxmega128a3u.hex:I
Reading multiple memories ...
 - eeprom         | ################################################## | 100% 0.26 s 
 - flash          | ################################################## | 100% 4.77 s 
 - application    | ################################################## | 100% 4.49 s 
 - apptable       | ################################################## | 100% 0.28 s 
 - boot           | ################################################## | 100% 0.28 s 
 - fuses          | ################################################## | 100% 0.02 s 
 - fuse0          | ################################################## | 100% 0.00 s 
 - fuse1          | ################################################## | 100% 0.00 s 
 - fuse2          | ################################################## | 100% 0.00 s 
 - fuse4          | ################################################## | 100% 0.00 s 
 - fuse5          | ################################################## | 100% 0.00 s 
 - lock           | ################################################## | 100% 0.00 s 
 - prodsig/sigrow | ################################################## | 100% 0.01 s 
 - calibration    | ################################################## | 100% 0.00 s 
 - sernum         | ################################################## | 100% 0.00 s 
 - tempsense      | ################################################## | 100% 0.00 s 
 - usersig        | ################################################## | 100% 0.02 s 
 - signature      | ################################################## | 100% 0.00 s 
Writing 289368 bytes to output file bak-pickit5_pdi-atxmega128a3u.hex

Processing -T fact reset
(factory)  unchanged fuse0 0xff
(factory)  unchanged fuse1 0x00
(factory)  unchanged fuse2 0xff
(factory)  unchanged fuse4 0xfe
(factory)  unchanged fuse5 0xff
performing chip erase; discarded pending writes to flash and EEPROM
Target successfully erased
(write) writing 2048 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.26 s 
(write) writing 139264 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.02 s 
(write) writing 512 bytes starting from address 0x0000; remaining space filled with 0xff
Caching | ################################################## | 100% 0.02 s 
(factory)  unchanged lock 0xff
after the next reset the part will have F_CPU = 2.000 MHz

Processing -U ALL:w:bak-pickit5_pdi-atxmega128a3u.hex:I
Reading 141887 bytes for multiple memories from input file bak-pickit5_pdi-atxmega128a3u.hex
2048 bytes eeprom in 1 section [0, 0x7ff]: 64 pages and 0 pad bytes
Writing 2048 bytes to eeprom
Writing | ################################################## | 100% 0.58 s 
Reading | ################################################## | 100% 0.26 s 
2048 bytes of eeprom verified
139264 bytes flash in 1 section [0, 0x21fff]: 136 pages and 0 pad bytes
Writing 139264 bytes to flash
Writing | ################################################## | 100% 7.83 s 
Reading | ################################################## | 100% 4.93 s 
139264 bytes of flash verified
131072 bytes application in 1 section [0, 0x1ffff]: 128 pages and 0 pad bytes
Writing 131072 bytes to application
Writing | ################################################## | 100% 7.47 s 
Reading | ################################################## | 100% 4.49 s 
131072 bytes of application verified
8192 bytes apptable in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to apptable
Writing | ################################################## | 100% 0.46 s 
Reading | ################################################## | 100% 0.28 s 
8192 bytes of apptable verified
8192 bytes boot in 1 section [0, 0x1fff]: 8 pages and 0 pad bytes
Writing 8192 bytes to boot
Writing | ################################################## | 100% 0.33 s 
Reading | ################################################## | 100% 0.28 s 
8192 bytes of boot verified
7 bytes fuses in 1 section [0, 6]
Writing 7 bytes to fuses
Writing | ################################################## | 100% 0.07 s 
Reading | ################################################## | 100% 0.02 s 
7 bytes of fuses verified
1 byte fuse0 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse0
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse0 verified
1 byte fuse1 in 1 section [0, 0]
Writing 1 byte (0x00) to fuse1
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse1 verified
1 byte fuse2 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse2
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse2 verified
1 byte fuse4 in 1 section [0, 0]
Writing 1 byte (0xFE) to fuse4
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse4 verified
1 byte fuse5 in 1 section [0, 0]
Writing 1 byte (0xFF) to fuse5
Writing | ################################################## | 100% 0.01 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse5 verified
1 byte lock in 1 section [0, 0]
Writing 1 byte (0xFF) to lock
Writing | ################################################## | 100% 0.00 s 
Reading | ################################################## | 100% 0.00 s 
1 byte of lock verified
512 bytes usersig in 1 section [0, 0x1ff]: 1 page and 0 pad bytes
Writing 512 bytes to usersig
Writing | ################################################## | 100% 0.03 s 
Reading | ################################################## | 100% 0.02 s 
512 bytes of usersig verified

Processing -U ALL:v:bak-pickit5_pdi-atxmega128a3u.hex:I
Verifying 141887 bytes of multiple memories against input file bak-pickit5_pdi-atxmega128a3u.hex
Reading | ################################################## | 100% 0.27 s 
2048 bytes of eeprom verified
Reading | ################################################## | 100% 4.85 s 
139264 bytes of flash verified
Reading | ################################################## | 100% 4.51 s 
131072 bytes of application verified
Reading | ################################################## | 100% 0.28 s 
8192 bytes of apptable verified
Reading | ################################################## | 100% 0.28 s 
8192 bytes of boot verified
Reading | ################################################## | 100% 0.03 s 
7 bytes of fuses verified
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse0 verified
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse1 verified
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse2 verified
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse4 verified
Reading | ################################################## | 100% 0.00 s 
1 byte of fuse5 verified
Reading | ################################################## | 100% 0.00 s 
1 byte of lock verified
Reading | ################################################## | 100% 0.01 s 
52 bytes of prodsig/sigrow verified
Reading | ################################################## | 100% 0.00 s 
4 bytes of calibration verified
Reading | ################################################## | 100% 0.00 s 
14 bytes of sernum verified
Reading | ################################################## | 100% 0.00 s 
2 bytes of tempsense verified
Reading | ################################################## | 100% 0.02 s 
512 bytes of usersig verified
Reading | ################################################## | 100% 0.00 s 
3 bytes of signature verified

Avrdude done.  Thank you.

@mcuee
Copy link
Collaborator

mcuee commented Jan 17, 2025

I think @MCUdude has done very comprehensive tests on this PR. I will see if I can carry out some sanity tests under Windows and Linux.

@MX682X
Copy link
Contributor Author

MX682X commented Jan 17, 2025

the "err = No such file or directory" sounds like an error with the usb connection indeed.

I also have an idea how to improve handling of transfer errors, I'll try to implement it on the weekend

@MX682X
Copy link
Contributor Author

MX682X commented Jan 18, 2025

fixed the typo and improved error handling. I'd say it's done.

@MCUdude
Copy link
Collaborator

MCUdude commented Jan 27, 2025

I'm very pleased with this PR, and also I approve it.

But there are a few tiny quality-of-life improvements that would be neat, but may be dealt with later.

Let's say I have a PICkit4 that I recently used with MPLAB. If I try to use it with Avrdude (-c pickit4_updi) I'll get an error telling me it's in PIC mode and you'll have to switch modes manually. It would be really neat if it still would print the error (even in non-verbose mode), but automatically switch over to PIC mode and continue the operation. I'm not sure if this is possible (switching programmer internally), but it would make the experience better for those who know nothing about the different "modes".

$ avrdude -cpickit4_updi -pavr128da28

Error: PICkit 4 in PIC mode detected
Error: to switch into AVR mode try
$ avrdude -c pickit4_updi -p avr128da28 -P usb -x mode=avr

Avrdude done.  Thank you.

$ avrdude -cpickit4_updi -pavr128da28 -xmode=avr

Error: PICkit 4 in PIC mode detected
switching to AVR mode; 
run avrdude again to continue the session

Avrdude done.  Thank you.

$ avrdude -cpickit4_updi -pavr128da28 -v
Avrdude version 8.0-20240824 (4fa07e56)
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file /Users/hans/.avrduderc does not exist

Using port            : usb
Using programmer      : pickit4_updi
AVR part              : AVR128DA28
Programming modes     : SPM, UPDI
Programmer type       : JTAGICE3_UPDI
Description           : MPLAB(R) PICkit 4 in UPDI mode
ICE HW version        : 4
ICE FW version        : 1.15 (rel. 20)
Serial number         : BUR204071812
Vtarget               : 5.24 V
PDI/UPDI clk          : 100 kHz

Partial Family_ID returned: "    "
Silicon revision: 1.7

AVR device initialized and ready to accept instructions
Device signature = 1E 97 0A (AVR128DA28)

Avrdude done.  Thank you.

@stefanrueger
Copy link
Collaborator

stefanrueger commented Jan 28, 2025

The functionality looks great! Thanks for your contribution, @MX682X

I couldn't help noticing that the pmsg_...() messaging slightly deviates from what AVRDUDE has converged using. They normally should look sth like pmsg_error("there is a problem\n"):

  • Lower case message start (unless, eg, acronym or proper name)
  • No full stop or exclamation mark at the end
  • Terminates with \n unless there are continuation messages using msg_...("xyz") or imsg_...("xyz")
  • Should not start with error or warning as that's automatically done

I realise that currently AVRDUDE automatically capitalises messages, but that fashion might change and it's trivial to capitalise messages but very hard to automatically lowercase messages. I also realise that a missing final \n is often masked by current AVRDUDE behaviour to start pmsg_...() at a new line, but again that behaviour might change.

AVRDUDE tends to spell debugWIRE like so, not Debug Wire or similar.

Some error messages say PICkit5 (good), some PICkit (there may be a reason for this), and some Pickit 5. Please review.

Sometimes messages refer to CS Reg, sometimes to CS reg (my preference).

Here a sample(!) of messages that I feel should be reviewed:

pmsg_error("Invalid script pointer passed!");
pmsg_error("Requested message size (%u) too large!", message_len);
pmsg_error("Sending script failed");
pmsg_error("Script Error returned: 0x%2X\n", error_code);
pmsg_error("PICkit error status report: %s", buf);
pmsg_error("Transmission failed on the data channel\n");
pmsg_error("Failed to abort download mode, please power-cycle the programmer and part\n");
pmsg_notice("Attemting to recover from transmission error\n");
pmsg_error("Failed to disable programming mode, please power-cycle the programmer and part\n");
pmsg_error("Failed to reenable programming mode, please power-cycle the programmer and part\n");
pmsg_notice("Successfully recovered from transmission error, please retry the previous operation\n");
pmsg_error("Failed to abort download mode, please power-cycle the programmer and part\n");
pmsg_error("Failed to abort upload mode, please power-cycle the programmer and part\n");
pmsg_error("Failed to disable programming mode, please power-cycle the programmer and part\n");
pmsg_error("Failed to reenable programming mode, please power-cycle the programmer and part\n");
pmsg_error("Failed to enable programming mode\n");
pmsg_error("Failed to set speed.\n");
pmsg_error("Debug Wire transmission error, Aborting. (Is the Reset Pullup >=10 kOhms?)");
pmsg_error("Debug Wire transmission error, Aborting. (Please remove any caps on Reset line)");
pmsg_error("Error: %d", my.rxBuf[16]);
pmsg_error("Length (%u) mismatch of returned Device ID.\n", len);
pmsg_error("Failed switching scripts, aborting.\n");
pmsg_notice("Switched to ISP mode");
pmsg_error("Failed switching scripts, aborting.\n");
pmsg_error("Pickit 5 switched the part to ISP mode when writing fuses.");
pmsg_error("To continue, the part has to be power cycled and the operation restarted.");
pmsg_error("Write Fuse Script failed");
pmsg_error("Write Fuse Script did not receive a status response");
pmsg_error("Failed to start fuse write operation(%d)", my.rxBuf[24]);
pmsg_error("Read Fuse Script failed");
pmsg_error("Unexpected amount (%d) of bytes returned.", my.rxBuf[20]);
pmsg_error("Failed to start fuse read operation (%d)", my.rxBuf[24]);
pmsg_error("Write Fuse Script failed");
pmsg_error("Read Fuse Script failed");
pmsg_warning("Requested memory is outside of the progsig on the device");

Note Attemting -> Attempting and reenable -> re-enable

And, I absolutely agree with @MCUdude and @mcuee that this PR is a great enhancement for AVRDUDE!

@stefanrueger
Copy link
Collaborator

automatically switch over to PIC mode and continue the operation

@MCUdude Good idea, but itsn't the example you give pickit4 (so outside scope of current pickit5 PR)?

@MCUdude
Copy link
Collaborator

MCUdude commented Jan 28, 2025

automatically switch over to PIC mode and continue the operation

@MCUdude Good idea, but itsn't the example you give pickit4 (so outside scope of current pickit5 PR)?

Not necessarily, because both the SNAP and PICkit4 is automatically switched to PIC mode when used with a recent version of MPLAB X. So ideally, Avrdude shouldn't care if you're trying to use a PICkit4/SNAP in PIC or AVR mode. It should only warn/tell you which mode it is in and continue the session. This PR adds support for both the PICkit4 and SNAP in PIC mode.

@MX682X
Copy link
Contributor Author

MX682X commented Feb 1, 2025

I fixed the messaging, I hope I haven't missed anything.
I would also recommend to make a "contribution guidelines" or something that has all the rules summed up that were brought up during this endeavor.

Also, about the PICkit4 and SNAP topic: From the user's perspective it is extremely unintuitive and non-standard to use -c pickit5 for their SNAP or PICkit4. At least the messaging should be extended on a detected programmer in PIC mode.

@stefanrueger stefanrueger merged commit 0771b7f into avrdudes:main Feb 5, 2025
4 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants