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

Arduino Nano Every EEPROM writing #1604

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

askn37
Copy link
Contributor

@askn37 askn37 commented Dec 27, 2023

Fix derived from #1602. You can write EEPROM to Arduino Nano Every.

Modify the PM_UPDI write subcommand of jtagmkII_paged_write as follows:
"MTYPE_EEPROM" -> "MTYPE_EEPROM_XMEGA"

This can lead to regression.

@MCUdude
Copy link
Collaborator

MCUdude commented Dec 27, 2023

Thanks for the PR!
Works great with the Nano Every, and I also tested it with an AVR Dragon in PDI mode connected to an ATxmega128A3U.
I can confirm that it works great in both terminal and CLI mode.

@mcuee mcuee added the bug Something isn't working label Dec 28, 2023
@mcuee
Copy link
Collaborator

mcuee commented Dec 28, 2023

There are still a few other places we use MTYPE_EEPROM and not MTYPE_EEPROM_XMEGA for PDI/UPDI parts, just wondering if they should be changed to MTYPE_EEPROM_XMEGA or not.

I was thinking of changing them all previously.

@mcuee
Copy link
Collaborator

mcuee commented Dec 28, 2023

This PR works great with Arduino Nano Every.

Previously failed EEPROM writing and erasing now work fine.
Failed test case previously:

With this PR:

PS>.\avrdude_pr1604 -C .\avrdude_pr1604.conf -c jtag2updi -P COM8 -p m4809 -T "erase eeprom" -r
avrdude_pr1604: touching serial port COM8 at 1200 baud
avrdude_pr1604: waiting for new port... using same port COM8
avrdude_pr1604: AVR device initialized and ready to accept instructions
avrdude_pr1604: device signature = 0x1e9651 (probably m4809)

avrdude_pr1604: processing -T erase eeprom
Caching | ################################################## | 100% 0.38 s
avrdude_pr1604: synching cache to device ... done

avrdude_pr1604 done.  Thank you.

PS>.\avrdude_pr1604 -C .\avrdude_pr1604.conf -c jtag2updi -P COM8 -p m4809 -T "read eeprom" -r
avrdude_pr1604: touching serial port COM8 at 1200 baud
avrdude_pr1604: waiting for new port... using same port COM8
avrdude_pr1604: AVR device initialized and ready to accept instructions
avrdude_pr1604: device signature = 0x1e9651 (probably m4809)

avrdude_pr1604: processing -T read eeprom
Reading | ################################################## | 100% 0.38 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_pr1604 done.  Thank you.

PS>.\avrdude_pr1604 -C .\avrdude_pr1604.conf -c jtag2updi -P COM8 -p m4809 -U eeprom:w:entest1.hex:i -r
avrdude_pr1604: touching serial port COM8 at 1200 baud
avrdude_pr1604: waiting for new port... using same port COM8
avrdude_pr1604: AVR device initialized and ready to accept instructions
avrdude_pr1604: device signature = 0x1e9651 (probably m4809)

avrdude_pr1604: processing -U eeprom:w:entest1.hex:i
avrdude_pr1604: reading input file entest1.hex for eeprom
                with 256 bytes in 1 section within [0, 0xff]
                using 4 pages and 0 pad bytes
avrdude_pr1604: writing 256 bytes eeprom ...
Writing | ################################################## | 100% 0.23 s
avrdude_pr1604: 256 bytes of eeprom written
avrdude_pr1604: verifying eeprom memory against entest1.hex
Reading | ################################################## | 100% 0.06 s
avrdude_pr1604: 256 bytes of eeprom verified

avrdude_pr1604 done.  Thank you.

PS>.\avrdude_pr1604 -C .\avrdude_pr1604.conf -c jtag2updi -P COM8 -p m4809 -T "read eeprom" -r
avrdude_pr1604: touching serial port COM8 at 1200 baud
avrdude_pr1604: waiting for new port... using same port COM8
avrdude_pr1604: AVR device initialized and ready to accept instructions
avrdude_pr1604: device signature = 0x1e9651 (probably m4809)

avrdude_pr1604: processing -T read eeprom
Reading | ################################################## | 100% 0.37 s
0000  54 68 65 20 71 75 69 63  6b 20 62 72 6f 77 6e 20  |The quick brown |
0010  66 6f 78 20 6a 75 6d 70  73 20 6f 76 65 72 20 74  |fox jumps over t|
0020  68 65 20 6c 61 7a 79 20  64 6f 67 0a 54 68 65 20  |he lazy dog The |
0030  71 75 69 63 6b 20 62 72  6f 77 6e 20 66 6f 78 20  |quick brown fox |
0040  6a 75 6d 70 73 20 6f 76  65 72 20 74 68 65 20 6c  |jumps over the l|
0050  61 7a 79 20 64 6f 67 0a  54 68 65 20 71 75 69 63  |azy dog The quic|
0060  6b 20 62 72 6f 77 6e 20  66 6f 78 20 6a 75 6d 70  |k brown fox jump|
0070  73 20 6f 76 65 72 20 74  68 65 20 6c 61 7a 79 20  |s over the lazy |
0080  64 6f 67 0a 54 68 65 20  71 75 69 63 6b 20 62 72  |dog The quick br|
0090  6f 77 6e 20 66 6f 78 20  6a 75 6d 70 73 20 6f 76  |own fox jumps ov|
00a0  65 72 20 74 68 65 20 6c  61 7a 79 20 64 6f 67 0a  |er the lazy dog |
00b0  54 68 65 20 71 75 69 63  6b 20 62 72 6f 77 6e 20  |The quick brown |
00c0  66 6f 78 20 6a 75 6d 70  73 20 6f 76 65 72 20 74  |fox jumps over t|
00d0  68 65 20 6c 61 7a 79 20  64 6f 67 0a 54 68 65 20  |he lazy dog The |
00e0  71 75 69 63 6b 20 62 72  6f 77 6e 20 66 6f 78 20  |quick brown fox |
00f0  6a 75 6d 70 73 20 6f 76  65 72 20 74 68 65 20 6c  |jumps over the l|

avrdude_pr1604 done.  Thank you.

@stefanrueger
Copy link
Collaborator

The question here really is which programmers that use code from jtagmkII.c expect MTYPE_EEPROM (and only this) and which programmers expect MTYPE_EEPROM_XMEGA (and only this) for UPDI or PDI EEPROM access. That needs extensive testing. If the tests find that all those use MTYPE_EEPROM_XMEGA then good. If not, we will need a more complex rule for when to use one and when the other.

@MCUdude
Copy link
Collaborator

MCUdude commented Dec 28, 2023

I have an AVR Dragon and a few Xmega boards I can test with. However, I don't have a JTAGmkII, but I'll assume testing with a Dragon is sufficient.

@askn37
Copy link
Contributor Author

askn37 commented Dec 31, 2023

@stefanrueger
Copy link
Collaborator

@askn37 Thanks for analysing. This gives us more confidence for applying this PR. Let's wait and see whether @MCUdude could carry out tests with Microchip tools

@MCUdude
Copy link
Collaborator

MCUdude commented Jan 2, 2024

With this PR, I haven't stumbled across any regressions when using the Dragon in PDI mode along with the ATxmega128A3U.

dragon_pdi + ATxmega128A3U
# EEPROM erased and EEPROM fuse setting set to erase EE on -e
$ ./avrdude -cdragon_pdi -patxmega128a3u -T 'read eeprom 0 0x100; config eesave' -qq
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  |................|
config eesave=ee_erased # 1

$ cat 0x55_256b.hex 
:020000040000FA
:20000000555555555555555555555555555555555555555555555555555555555555555540
:20002000555555555555555555555555555555555555555555555555555555555555555520
:20004000555555555555555555555555555555555555555555555555555555555555555500
:200060005555555555555555555555555555555555555555555555555555555555555555E0
:200080005555555555555555555555555555555555555555555555555555555555555555C0
:2000A0005555555555555555555555555555555555555555555555555555555555555555A0
:2000C000555555555555555555555555555555555555555555555555555555555555555580
:2000E000555555555555555555555555555555555555555555555555555555555555555560
:00000001FF
$ cat 0xaa_256b.hex 
:020000040000FA
:20000000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0
:20002000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA80
:20004000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA60
:20006000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA40
:20008000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA20
:2000A000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA00
:2000C000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE0
:2000E000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0
:00000001FF

$ ./avrdude -cdragon_pdi -patxmega128a3u -Ueeprom:w:0x55_256b.hex 
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9742 (probably x128a3u)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -U eeprom:w:0x55_256b.hex:i
avrdude: reading input file 0x55_256b.hex for eeprom
         with 256 bytes in 1 section within [0, 0xff]
         using 8 pages and 0 pad bytes
avrdude: writing 256 bytes eeprom ...
Writing | ################################################## | 100% 0.18 s 
avrdude: 256 bytes of eeprom written
avrdude: verifying eeprom memory against 0x55_256b.hex
Reading | ################################################## | 100% 0.03 s 
avrdude: 256 bytes of eeprom verified

avrdude done.  Thank you.

$ ./avrdude -cdragon_pdi -patxmega128a3u -Ueeprom:w:0xaa_256b.hex 
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9742 (probably x128a3u)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -U eeprom:w:0xaa_256b.hex:i
avrdude: reading input file 0xaa_256b.hex for eeprom
         with 256 bytes in 1 section within [0, 0xff]
         using 8 pages and 0 pad bytes
avrdude: writing 256 bytes eeprom ...
Writing | ################################################## | 100% 0.18 s 
avrdude: 256 bytes of eeprom written
avrdude: verifying eeprom memory against 0xaa_256b.hex
Reading | ################################################## | 100% 0.03 s 
avrdude: 256 bytes of eeprom verified

avrdude done.  Thank you.

$ ./avrdude -cdragon_pdi -patxmega128a3u -e
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9742 (probably x128a3u)
avrdude: erasing chip

avrdude done.  Thank you.

$ ./avrdude -cdragon_pdi -patxmega128a3u -T 'read eeprom 0 0x100' -qq
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 -cdragon_pdi -patxmega128a3u -T 'write eeprom 0x55_256b.hex'
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9742 (probably x128a3u)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -T write eeprom 0x55_256b.hex
Caching | ################################################## | 100% 0.03 s 
avrdude: synching cache to device ... 
Writing | ################################################## | 100% 0.16 s 

avrdude done.  Thank you.

$ ./avrdude -cdragon_pdi -patxmega128a3u -T 'write eeprom 0xaa_256b.hex'
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9742 (probably x128a3u)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -T write eeprom 0xaa_256b.hex
Caching | ################################################## | 100% 0.03 s 
avrdude: synching cache to device ... 
Writing | ################################################## | 100% 0.14 s 

avrdude done.  Thank you.

$ ./avrdude -cdragon_pdi -patxmega128a3u -T 'read eeprom 0 0x100' -qq
0000  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0010  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0020  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0030  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0040  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0050  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0060  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0070  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0080  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0090  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00a0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00b0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00c0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00d0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00e0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00f0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|

$ ./avrdude -cdragon_pdi -patxmega128a3u -Ueeprom:w:test_avrdude_info_1k.hex 
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9742 (probably x128a3u)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -U eeprom:w:test_avrdude_info_1k.hex:i
avrdude: reading input file test_avrdude_info_1k.hex for eeprom
         with 524 bytes in 1 section within [0, 0x20b]
         using 17 pages and 20 pad bytes
avrdude: writing 524 bytes eeprom ...
Writing | ################################################## | 100% 0.39 s 
avrdude: 524 bytes of eeprom written
avrdude: verifying eeprom memory against test_avrdude_info_1k.hex
Reading | ################################################## | 100% 0.07 s 
avrdude: 524 bytes of eeprom verified

avrdude done.  Thank you.

$ ./avrdude -cdragon_pdi -patxmega128a3u -Ueeprom:w:0x55_256b.hex 
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9742 (probably x128a3u)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -U eeprom:w:0x55_256b.hex:i
avrdude: reading input file 0x55_256b.hex for eeprom
         with 256 bytes in 1 section within [0, 0xff]
         using 8 pages and 0 pad bytes
avrdude: writing 256 bytes eeprom ...
Writing | ################################################## | 100% 0.18 s 
avrdude: 256 bytes of eeprom written
avrdude: verifying eeprom memory against 0x55_256b.hex
Reading | ################################################## | 100% 0.03 s 
avrdude: 256 bytes of eeprom verified

avrdude done.  Thank you.

$ ./avrdude -cdragon_pdi -patxmega128a3u -T 'read eeprom 0 0x280'
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9742 (probably x128a3u)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -T read eeprom 0 0x280
Reading | ################################################## | 100% 0.08 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  41 56 52 44 55 44 45 20  2d 20 41 56 52 20 44 6f  |AVRDUDE - AVR Do|
0050  77 6e 6c 6f 61 64 65 72  20 55 70 6c 6f 61 64 65  |wnloader Uploade|
0060  72 20 2d 20 69 73 20 61  20 70 72 6f 67 72 61 6d  |r - is a program|
0070  20 66 6f 72 20 64 6f 77  6e 6c 6f 61 64 69 6e 67  | for downloading|
0080  20 61 6e 64 20 75 70 6c  6f 61 64 69 6e 67 20 74  | and uploading t|
0090  68 65 20 6f 6e 2d 63 68  69 70 20 6d 65 6d 6f 72  |he on-chip memor|
00a0  69 65 73 20 6f 66 20 4d  69 63 72 6f 63 68 69 70  |ies of Microchip|
00b0  e2 80 99 73 20 41 56 52  20 6d 69 63 72 6f 63 6f  |...s AVR microco|
00c0  6e 74 72 6f 6c 6c 65 72  73 2e 20 49 74 20 63 61  |ntrollers. It ca|
00d0  6e 20 70 72 6f 67 72 61  6d 20 74 68 65 20 46 6c  |n program the Fl|
00e0  61 73 68 20 61 6e 64 20  45 45 50 52 4f 4d 2c 20  |ash and EEPROM, |
00f0  61 6e 64 20 77 68 65 72  65 20 73 75 70 70 6f 72  |and where suppor|
0100  74 65 64 20 62 79 20 74  68 65 20 70 72 6f 67 72  |ted by the progr|
0110  61 6d 6d 69 6e 67 20 70  72 6f 74 6f 63 6f 6c 2c  |amming protocol,|
0120  20 69 74 20 63 61 6e 20  70 72 6f 67 72 61 6d 20  | it can program |
0130  66 75 73 65 20 61 6e 64  20 6c 6f 63 6b 20 62 69  |fuse and lock bi|
0140  74 73 2e 20 41 56 52 44  55 44 45 20 61 6c 73 6f  |ts. AVRDUDE also|
0150  20 73 75 70 70 6c 69 65  73 20 61 20 64 69 72 65  | supplies a dire|
0160  63 74 20 69 6e 73 74 72  75 63 74 69 6f 6e 20 6d  |ct instruction m|
0170  6f 64 65 20 61 6c 6c 6f  77 69 6e 67 20 6f 6e 65  |ode allowing one|
0180  20 74 6f 20 69 73 73 75  65 20 61 6e 79 20 70 72  | to issue any pr|
0190  6f 67 72 61 6d 6d 69 6e  67 20 69 6e 73 74 72 75  |ogramming instru|
01a0  63 74 69 6f 6e 20 74 6f  20 74 68 65 20 41 56 52  |ction to the AVR|
01b0  20 63 68 69 70 20 72 65  67 61 72 64 6c 65 73 73  | chip regardless|
01c0  20 6f 66 20 77 68 65 74  68 65 72 20 41 56 52 44  | of whether AVRD|
01d0  55 44 45 20 69 6d 70 6c  65 6d 65 6e 74 73 20 74  |UDE implements t|
01e0  68 61 74 20 73 70 65 63  69 66 69 63 20 66 65 61  |hat specific fea|
01f0  74 75 72 65 20 6f 66 20  61 20 70 61 72 74 69 63  |ture of a partic|
0200  75 6c 61 72 20 63 68 69  70 2e 00 ff ff ff ff ff  |ular chip.......|
0210  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0220  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0230  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0240  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0250  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0260  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0270  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|

avrdude done.  Thank you.

@MCUdude
Copy link
Collaborator

MCUdude commented Jan 2, 2024

No issues with the Dragon in JTAG mode together with the ATxmega256A3BU:

dragon_jtag + ATxmega256A3BU
$ ./avrdude -cdragon_jtag -patxmega256a3bu -T 'read eeprom 0 0x100; config eesave' -qq
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  |................|
config eesave=ee_erased # 1

$ ./avrdude -cdragon_jtag -patxmega256a3bu -Ueeprom:w:0x55_256b.hex
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -U eeprom:w:0x55_256b.hex:i
avrdude: reading input file 0x55_256b.hex for eeprom
         with 256 bytes in 1 section within [0, 0xff]
         using 8 pages and 0 pad bytes
avrdude: writing 256 bytes eeprom ...
Writing | ################################################## | 100% 0.36 s 
avrdude: 256 bytes of eeprom written
avrdude: verifying eeprom memory against 0x55_256b.hex
Reading | ################################################## | 100% 0.11 s 
avrdude: 256 bytes of eeprom verified

avrdude done.  Thank you.

$ ./avrdude -cdragon_jtag -patxmega256a3bu -Ueeprom:w:0xaa_256b.hex
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -U eeprom:w:0xaa_256b.hex:i
avrdude: reading input file 0xaa_256b.hex for eeprom
         with 256 bytes in 1 section within [0, 0xff]
         using 8 pages and 0 pad bytes
avrdude: writing 256 bytes eeprom ...
Writing | ################################################## | 100% 0.35 s 
avrdude: 256 bytes of eeprom written
avrdude: verifying eeprom memory against 0xaa_256b.hex
Reading | ################################################## | 100% 0.11 s 
avrdude: 256 bytes of eeprom verified

avrdude done.  Thank you.

$ ./avrdude -cdragon_jtag -patxmega256a3bu -e
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)
avrdude: erasing chip

avrdude done.  Thank you.

$ ./avrdude -cdragon_jtag -patxmega256a3bu -T 'read eeprom 0 0x100' -qq
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 -cdragon_jtag -patxmega256a3bu -T 'write eeprom 0x55_256b.hex'
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -T write eeprom 0x55_256b.hex
Caching | ################################################## | 100% 0.11 s 
avrdude: synching cache to device ... 
Writing | ################################################## | 100% 0.33 s 

avrdude done.  Thank you.

$ ./avrdude -cdragon_jtag -patxmega256a3bu -T 'write eeprom 0xaa_256b.hex'
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -T write eeprom 0xaa_256b.hex
Caching | ################################################## | 100% 0.11 s 
avrdude: synching cache to device ... 
Writing | ################################################## | 100% 0.29 s 

avrdude done.  Thank you.

$ ./avrdude -cdragon_jtag -patxmega256a3bu -T 'read eeprom 0 0x100'
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -T read eeprom 0 0x100
Reading | ################################################## | 100% 0.11 s 
0000  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0010  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0020  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0030  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0040  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0050  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0060  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0070  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0080  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
0090  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00a0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00b0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00c0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00d0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00e0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|
00f0  aa aa aa aa aa aa aa aa  aa aa aa aa aa aa aa aa  |................|

avrdude done.  Thank you.

$ ./avrdude -cdragon_jtag -patxmega256a3bu -Ueeprom:w:test_avrdude_info_1k.hex 
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -U eeprom:w:test_avrdude_info_1k.hex:i
avrdude: reading input file test_avrdude_info_1k.hex for eeprom
         with 524 bytes in 1 section within [0, 0x20b]
         using 17 pages and 20 pad bytes
avrdude: writing 524 bytes eeprom ...
Writing | ################################################## | 100% 0.77 s 
avrdude: 524 bytes of eeprom written
avrdude: verifying eeprom memory against test_avrdude_info_1k.hex
Reading | ################################################## | 100% 0.23 s 
avrdude: 524 bytes of eeprom verified

avrdude done.  Thank you.

$ ./avrdude -cdragon_jtag -patxmega256a3bu -Ueeprom:w:0x55_256b.hex 
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -U eeprom:w:0x55_256b.hex:i
avrdude: reading input file 0x55_256b.hex for eeprom
         with 256 bytes in 1 section within [0, 0xff]
         using 8 pages and 0 pad bytes
avrdude: writing 256 bytes eeprom ...
Writing | ################################################## | 100% 0.35 s 
avrdude: 256 bytes of eeprom written
avrdude: verifying eeprom memory against 0x55_256b.hex
Reading | ################################################## | 100% 0.11 s 
avrdude: 256 bytes of eeprom verified

avrdude done.  Thank you.

$ ./avrdude -cdragon_jtag -patxmega256a3bu -T 'write eeprom test_avrdude_info_1k.hex'
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)
avrdude: Note: programmer supports page erase for Xmega devices.
         Each page will be erased before programming it, but no chip erase is performed.
         To disable page erases, specify the -D option; for a chip-erase, use the -e option.

avrdude: processing -T write eeprom test_avrdude_info_1k.hex
Caching | ################################################## | 100% 0.23 s 
avrdude: synching cache to device ... 
Writing | ################################################## | 100% 0.29 s 

avrdude done.  Thank you.

@stefanrueger stefanrueger merged commit 593ea4f into avrdudes:main Jan 3, 2024
10 checks passed
@MCUdude MCUdude linked an issue Jan 3, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Two keep-alive functions and one memory read extension.
4 participants