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

Read chip silicon revision and add IO memory on chips with PDI and UPDI #1474

Merged
merged 21 commits into from
Aug 5, 2023

Conversation

MCUdude
Copy link
Collaborator

@MCUdude MCUdude commented Jul 24, 2023

Resolves #1472.

This PR allows the jtag2updi or any JTAG3 compatible programmer that speaks UPDI to read the chip silicon revision. pymcuprog already has this feature, and I thought it might be useful in case someone is chasing a silicon bug "ghost" and don't know the revision of their chip.

I've tested this PR with an AVR128DA48, AVR128DB48, ATtiny3217, and AVR64DD32 using the pkobn_updi programmer.

I've tested the AVR128DA32 and the ATmega4809 using the jtag2updi and the xplainedmini_updi programmer.

I still haven't been able to figure out how to add this feature to the serialUPDI programmer. I'm having a really hard time navigating the pymcuprog source code. If you have time @dbuchwald, could you please have a look at this?

pymcuprog output:
$ pymcuprog -d avr64dd32 ping -v info
Connecting to anything possible
Connected to nEDBG CMSIS-DAP from Microchip (serial number MC020019502HIP000497)
Debugger firmware version 1.23.91
Debugger hardware revision 0
Device mounted: 'avr64dd32'
pymcuprog.programmer - INFO - Setting up programming session for 'avr64dd32'
pymcuprog.deviceinfo.deviceinfo - INFO - Looking for device avr64dd32
pymcuprog.nvm - INFO - UPDI baud rate: 900000bps
pymcuprog.nvm - INFO - UPDI-specific initialiser
Pinging device...
pymcuprog.programmer - INFO - Reading device ID...
pymcuprog.serialupdi.application - INFO - SIB: 'AVR     P:2D:1-3M2 (A3.KV00K.0)'
pymcuprog.serialupdi.application - INFO - Device family ID: 'AVR'
pymcuprog.serialupdi.application - INFO - NVM interface: 'P:2'
pymcuprog.serialupdi.application - INFO - Debug interface: 'D:1'
pymcuprog.serialupdi.application - INFO - PDI oscillator: '3M2'
pymcuprog.serialupdi.application - INFO - Extra info: '(A3.KV00K.0)'
pymcuprog.nvm - INFO - PDI revision = 0x03
pymcuprog.nvm - INFO - Device ID: '1E961A'
pymcuprog.nvm - INFO - Device revision: '1.3'
Ping response: 1E961A
pymcupr
avrdude output:
$ ./avrdude -cpkobn_updi -pavr64dd32 -v

avrdude: Version 7.2-20230720
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is /Users/hans/Downloads/avrdude/src/avrdude.conf
         User configuration file is /Users/hans/.avrduderc

         Using Port                    : usb
         Using Programmer              : pkobn_updi
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : AVR64DD32
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           fuse0       wdtcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse1       bodcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse2       osccfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse5       syscfg0     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse6       syscfg1     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse7       codesize    0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse8       bootsize    0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuses                   0     0     0    0 no          9   16      0     0     0 0x00 0x00
           lock                    0     0     0    0 no          4    1      0     0     0 0x00 0x00
           tempsense               0     0     0    0 no          2    1      0     0     0 0x00 0x00
           signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
           prodsig                 0     0     0    0 no        125  125      0     0     0 0x00 0x00
           sernum                  0     0     0    0 no         16    1      0     0     0 0x00 0x00
           userrow     usersig     0     0     0    0 no         32   32      0     0     0 0x00 0x00
           data                    0     0     0    0 no          0    1      0     0     0 0x00 0x00
           eeprom                  0     0     0    0 no        256    1      0     0     0 0x00 0x00
           flash                   0     0     0    0 no      65536  512      0     0     0 0x00 0x00

         Programmer Type : JTAGICE3_UPDI
         Description     : Curiosity nano (nEDBG) in UPDI mode
         ICE HW version  : 0
         ICE FW version  : 1.23 (rel. 91)
         Serial number   : MC020019502HIP000497
         Vtarget         : 5.01 V
         PDI/UPDI clk    : 100 kHz

avrdude: partial Family_ID returned: "AVR "
avrdude: silicon revision: 1.3
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e961a (probably avr64dd32)

avrdude done.  Thank you.

@MCUdude
Copy link
Collaborator Author

MCUdude commented Jul 24, 2023

BTW the sernum offset was incorrect for the megaAVR-0 and tinyAVR-0,1,2 so I fixed this as well.

@dbuchwald
Copy link
Contributor

This is indeed interesting feature, @MCUdude, and I'm happy to look into it. Just give me couple of days to play with it and understand the code again :)

@MCUdude
Copy link
Collaborator Author

MCUdude commented Jul 25, 2023

Excellent @dbuchwald!

@dbuchwald
Copy link
Contributor

Hello, since this change in serialupdi.c requires your changes (definition of syscfg_base), I created PR against your repository here:

https://github.com/MCUdude/avrdude/pull/4/files

Have fun and let me know if there are any issues with this implementation.

Add serialupdi chip silicon revision number read
@MCUdude
Copy link
Collaborator Author

MCUdude commented Jul 25, 2023

Thank you for the PR @dbuchwald! I've tested it, merged it and it works flawlessly.

I think this PR is ready to be merged. Anyone else that wants to give this PR a try?

@mcuee mcuee added the enhancement New feature or request label Jul 25, 2023
@mcuee
Copy link
Collaborator

mcuee commented Jul 25, 2023

Looks good for the AVR64EA48.

(py310x64venv) PS C:\work\avr\avrdude_test\avrdude_bin> pymcuprog -d avr64ea48 ping -v info
Connecting to anything possible
Connected to nEDBG CMSIS-DAP from Microchip (serial number MCHP3428031800001161)
Debugger firmware version 1.27.129
Debugger hardware revision 0
Device mounted: 'avr64ea48'
pymcuprog.programmer - INFO - Setting up programming session for 'avr64ea48'
pymcuprog.deviceinfo.deviceinfo - INFO - Looking for device avr64ea48
pymcuprog.nvm - INFO - UPDI baud rate: 900000bps
pymcuprog.nvm - INFO - UPDI-specific initialiser
Pinging device...
pymcuprog.programmer - INFO - Reading device ID...
pymcuprog.serialupdi.application - INFO - SIB: 'AVR     P:3D:1-3M2 (B1.59F02.0)'
pymcuprog.serialupdi.application - INFO - Device family ID: 'AVR'
pymcuprog.serialupdi.application - INFO - NVM interface: 'P:3'
pymcuprog.serialupdi.application - INFO - Debug interface: 'D:1'
pymcuprog.serialupdi.application - INFO - PDI oscillator: '3M2'
pymcuprog.serialupdi.application - INFO - Extra info: '(B1.59F02.0)'
pymcuprog.nvm - INFO - PDI revision = 0x03
pymcuprog.nvm - INFO - Device ID: '1E961E'
pymcuprog.nvm - INFO - Device revision: '2.1'
Ping response: 1E961E
pymcuprog.nvm - INFO - UPDI-specific de-initialiser
Done.
(py310x64venv) PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_pr1474 -C .\avrdude_pr1474.conf -c pkobn_updi -p avr64ea48 -v

avrdude_pr1474: Version 7.2-20230725 (6c4414e6)
                Copyright the AVRDUDE authors;
                see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

                System wide configuration file is C:\work\avr\avrdude_test\avrdude_bin\avrdude_pr1474.conf
                User configuration file is C:\work\avr\avrdude_test\avrdude_bin\avrdude.rc

                Using Port                    : usb
                Using Programmer              : pkobn_updi
avrdude_pr1474: found CMSIS-DAP compliant device, using EDBG protocol
                AVR Part                      : AVR64EA48
                RESET disposition             : dedicated
                RETRY pulse                   : SCK
                Serial program mode           : yes
                Parallel program mode         : yes
                Memory Detail                 :

                                                  Block Poll               Page                       Polled
                  Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
                  ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
                  fuse0       wdtcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse1       bodcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse2       osccfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse5       syscfg0     0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse6       syscfg1     0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse7       codesize    0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse8       bootsize    0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuses                   0     0     0    0 no          9   16      0     0     0 0x00 0x00
                  lock                    0     0     0    0 no          4    1      0     0     0 0x00 0x00
                  tempsense               0     0     0    0 no          2    1      0     0     0 0x00 0x00
                  signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
                  prodsig                 0     0     0    0 no        125  125      0     0     0 0x00 0x00
                  sernum                  0     0     0    0 no         16    1      0     0     0 0x00 0x00
                  userrow     usersig     0     0     0    0 no         64   64      0     0     0 0x00 0x00
                  data                    0     0     0    0 no          0    1      0     0     0 0x00 0x00
                  eeprom                  0     0     0    0 no        512    8      0     0     0 0x00 0x00
                  flash                   0     0     0    0 no      65536  128      0     0     0 0x00 0x00

                Programmer Type : JTAGICE3_UPDI
                Description     : Curiosity nano (nEDBG) in UPDI mode
                ICE HW version  : 0
                ICE FW version  : 1.27 (rel. 129)
                Serial number   : MCHP3428031800001161
                Vtarget         : 3.31 V
                PDI/UPDI clk    : 100 kHz

avrdude_pr1474: partial Family_ID returned: "AVR "
avrdude_pr1474: silicon revision: 2.1
avrdude_pr1474: AVR device initialized and ready to accept instructions
avrdude_pr1474: device signature = 0x1e961e (probably avr64ea48)

avrdude_pr1474 done.  Thank you.

@mcuee
Copy link
Collaborator

mcuee commented Jul 25, 2023

Good for the ATtiny817 as well.

(py310x64venv) PS C:\work\avr\avrdude_test\avrdude_bin> pymcuprog -d attiny817 ping -v info
Connecting to anything possible
Connected to EDBG CMSIS-DAP from ATMEL (serial number ATML2654061800002660)
Debugger firmware version 3.34.435
Debugger hardware revision 240
Device mounted: 'attiny817'
pymcuprog.programmer - INFO - Setting up programming session for 'attiny817'
pymcuprog.deviceinfo.deviceinfo - INFO - Looking for device attiny817
pymcuprog.nvm - INFO - UPDI baud rate: 900000bps
pymcuprog.nvm - INFO - UPDI-specific initialiser
Pinging device...
pymcuprog.programmer - INFO - Reading device ID...
pymcuprog.serialupdi.application - INFO - SIB: 'tinyAVR P:0D:0-3M2 (01.59B16.0)'
pymcuprog.serialupdi.application - INFO - Device family ID: 'tinyAVR'
pymcuprog.serialupdi.application - INFO - NVM interface: 'P:0'
pymcuprog.serialupdi.application - INFO - Debug interface: 'D:0'
pymcuprog.serialupdi.application - INFO - PDI oscillator: '3M2'
pymcuprog.serialupdi.application - INFO - Extra info: '(01.59B16.0)'
pymcuprog.nvm - INFO - PDI revision = 0x02
pymcuprog.nvm - INFO - Device ID: '1E9320'
pymcuprog.nvm - INFO - Device revision: '0.1'
Ping response: 1E9320
pymcuprog.nvm - INFO - UPDI-specific de-initialiser
Done.
(py310x64venv) PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_pr1474 -C .\avrdude_pr1474.conf -c xplainedpro_updi -p t817 -v

avrdude_pr1474: Version 7.2-20230725 (6c4414e6)
                Copyright the AVRDUDE authors;
                see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

                System wide configuration file is C:\work\avr\avrdude_test\avrdude_bin\avrdude_pr1474.conf
                User configuration file is C:\work\avr\avrdude_test\avrdude_bin\avrdude.rc

                Using Port                    : usb
                Using Programmer              : xplainedpro_updi
avrdude_pr1474: found CMSIS-DAP compliant device, using EDBG protocol
                AVR Part                      : ATtiny817
                RESET disposition             : dedicated
                RETRY pulse                   : SCK
                Serial program mode           : yes
                Parallel program mode         : yes
                Memory Detail                 :

                                                  Block Poll               Page                       Polled
                  Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
                  ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
                  fuse0       wdtcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse1       bodcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse2       osccfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse5       syscfg0     0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse6       syscfg1     0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse7       append      0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuse8       bootend     0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  fuses                   0     0     0    0 no          9   10      0     0     0 0x00 0x00
                  lock                    0     0     0    0 no          1    1      0     0     0 0x00 0x00
                  tempsense               0     0     0    0 no          2    1      0     0     0 0x00 0x00
                  signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
                  prodsig                 0     0     0    0 no         61   61      0     0     0 0x00 0x00
                  sernum                  0     0     0    0 no         10    1      0     0     0 0x00 0x00
                  osccal16                0     0     0    0 no          2    1      0     0     0 0x00 0x00
                  osccal20                0     0     0    0 no          2    1      0     0     0 0x00 0x00
                  osc16err                0     0     0    0 no          2    1      0     0     0 0x00 0x00
                  osc20err                0     0     0    0 no          2    1      0     0     0 0x00 0x00
                  data                    0     0     0    0 no          0    1      0     0     0 0x00 0x00
                  userrow     usersig     0     0     0    0 no         32   32      0     0     0 0x00 0x00
                  eeprom                  0     0     0    0 no        128   32      0     0     0 0x00 0x00
                  flash                   0     0     0    0 no       8192   64      0     0     0 0x00 0x00
                  fuse4       tcd0cfg     0     0     0    0 no          1    1      0     0     0 0x00 0x00

                Programmer Type : JTAGICE3_UPDI
                Description     : Atmel AVR XplainedPro in UPDI mode
                ICE HW version  : 240
                ICE FW version  : 3.34 (rel. 435)
                Serial number   : ATML2654061800002660
                Vtarget         : 3.34 V
                PDI/UPDI clk    : 1000 kHz

avrdude_pr1474: partial Family_ID returned: "tiny"
avrdude_pr1474: silicon revision: 0.1
avrdude_pr1474: AVR device initialized and ready to accept instructions
avrdude_pr1474: device signature = 0x1e9320 (probably t817)

avrdude_pr1474 done.  Thank you.

@mcuee
Copy link
Collaborator

mcuee commented Jul 25, 2023

I think this PR is ready to be merged. Anyone else that wants to give this PR a try?

@MCUdude

This PR is good from my side. Thanks.

src/jtag3.c Outdated Show resolved Hide resolved
@MCUdude
Copy link
Collaborator Author

MCUdude commented Jul 28, 2023

I managed to add the REVID memory to avrdude.conf, and be able to read it using a PDI or JTAG programmer using the EDBG protocol. I'll have to look into how I can accomplish the same using the jtagmkII protocol and the stk500v2 protocol.

./avrdude -cpowerdebugger -patxmega256a3bu -v

avrdude: Version 7.2-20230720
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is /Users/hans/Downloads/avrdude/src/avrdude.conf
         User configuration file is /Users/hans/.avrduderc

         Using Port                    : usb
         Using Programmer              : powerdebugger
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : ATxmega256A3BU
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

[...]

         Programmer Type : JTAGICE3
         Description     : Atmel PowerDebugger (ARM/AVR) in JTAG mode
         ICE HW version  : 1
         ICE FW version  : 1.61 (rel. 184)
         Serial number   :
         Vtarget         : 3.30 V
         JTAG clk Xmega  : 100 kHz
         Vout set        : 0.00 V
         Vout measured   : 1.47 V
         Ch A voltage    : 1.475 V
         Ch A current    : -1.059 mA
         Ch B voltage    : 1.525 V
         Ch B current    : 0.000 mA

avrdude: JTAG ID returned: 0x3f 0x30 0x84 0x69
avrdude: silicon revision: 0.6
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)

avrdude done.  Thank you.
./avrdude -cxplainedpro_pdi -patxmega128a1u -v

avrdude: Version 7.2-20230720
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is /Users/hans/Downloads/avrdude/src/avrdude.conf
         User configuration file is /Users/hans/.avrduderc

         Using Port                    : usb
         Using Programmer              : xplainedpro_pdi
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : ATxmega128A1U
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

         Programmer Type : JTAGICE3_PDI
         Description     : Atmel AVR XplainedPro in PDI mode
         ICE HW version  : 240
         ICE FW version  : 3.37 (rel. 438)
         Serial number   :
         Vtarget         : 3.29 V
         PDI/UPDI clk    : 1000 kHz

avrdude: silicon revision: 0.b
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e974c (probably x128a1u)

avrdude done.  Thank you.

@MCUdude MCUdude changed the title Read chip silicon revision on chips with UPDI Read chip silicon revision on chips with PDI and UPDI Jul 29, 2023
@MCUdude
Copy link
Collaborator Author

MCUdude commented Jul 29, 2023

I've now updated the PR to support Xmegas as well. You can add -v to have Avrdude read and print the chip revision when avrdude is executed, or the revid memory can either be read in immediate mode or terminal mode.

Supported protocols are jtag3 (PDI and JTAG), stk500v2/xprog (PDI) and jtagmkii (PDI and JTAG).

Tested with a Power Debugger, AVRISPmkII, and an AVR dragon in PDI and JTAG mode.

Feel free to give it a try using your favorite Xmega-compatible programmer!

./avrdude -cdragon_jtag -patxmega256a3bu -v

avrdude: Version 7.2-20230720
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is /Users/hans/Downloads/avrdude/src/avrdude.conf
         User configuration file is /Users/hans/.avrduderc

         Using Port                    : usb
         Using Programmer              : dragon_jtag
avrdude: usbdev_open(): found AVRDRAGON, serno:
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              2
Serial number:                   00:a2:00:00:0f:1a
Device ID:                       AVRDRAGON
         AVR Part                      : ATxmega256A3BU

[...] 

         Programmer Type : DRAGON_JTAG
         Description     : Atmel AVR Dragon in JTAG mode
         M_MCU HW version: 1
         M_MCU FW version: 7.39
         S_MCU HW version: 2
         S_MCU FW version: 7.39
         Serial number   : 
         Vtarget         : 3.3 V
         JTAG clock      : 891.7 kHz (1.1 us)
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              2
Serial number:                   00:a2:00:00:0f:1a
Device ID:                       AVRDRAGON
avrdude: silicon revision: 0.6
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9843 (probably x256a3bu)

avrdude done.  Thank you.

@MCUdude
Copy link
Collaborator Author

MCUdude commented Jul 29, 2023

One thing I just realized I haven't made sure that Avrdude won't attempt to read the chip revision(revid) when using JTAG and connected to a classic part. Will look at this tomorrow Done!

@xedbg
Copy link

xedbg commented Aug 3, 2023

Hmmm. I suspect there is a gating in silicon in that case, but can't confirm without asking an expert...
(SRAM memtype is the right one - there is an undocumented variant (0xB7) which is the same but without that offset, which is worth a try, but a long shot)

@stefanrueger
Copy link
Collaborator

Sanity check: The following table shows the parts by their io size; is that the same as above?

io size Parts
4096 ATxmega16A4U ATxmega16C4 ATxmega16D4 ATxmega16A4 ATxmega32A4U ATxmega32C4 ATxmega32D4 ATxmega32A4 ATxmega64A4U ATxmega32C3 ATxmega32D3 ATxmega64C3 ATxmega64D3 ATxmega64D4 ATxmega64A1 ATxmega64A1U ATxmega64A3 ATxmega64A3U ATxmega64A4 ATxmega64B1 ATxmega64B3 ATxmega128C3 ATxmega128D3 ATxmega128D4 ATxmega128A1 ATxmega128A1revD ATxmega128A1U ATxmega128A3 ATxmega128A3U ATxmega128A4 ATxmega128A4U ATxmega128B1 ATxmega128B3 ATxmega192C3 ATxmega192D3 ATxmega192A1 ATxmega192A3 ATxmega192A3U ATxmega256C3 ATxmega256D3 ATxmega256A1 ATxmega256A3 ATxmega256A3U ATxmega256A3B ATxmega256A3BU ATxmega384C3 ATxmega384D3 ATxmega8E5 ATxmega16E5 ATxmega32E5 ATtiny202 ATtiny204 ATtiny402 ATtiny404 ATtiny406 ATtiny804 ATtiny806 ATtiny807 ATtiny1604 ATtiny1606 ATtiny1607 ATtiny212 ATtiny214 ATtiny412 ATtiny414 ATtiny416 ATtiny416auto ATtiny417 ATtiny814 ATtiny816 ATtiny817 ATtiny1614 ATtiny1616 ATtiny1617 ATtiny3216 ATtiny3217 ATmega808 ATmega809 ATmega1608 ATmega1609 ATmega3208 ATmega3209 ATmega4808 ATmega4809
4160 AVR32DA28 AVR32DA32 AVR32DA48 AVR64DA28 AVR64DA32 AVR64DA48 AVR64DA64 AVR128DA28 AVR128DA32 AVR128DA48 AVR128DA64 AVR32DB28 AVR32DB32 AVR32DB48 AVR64DB28 AVR64DB32 AVR64DB48 AVR64DB64 AVR128DB28 AVR128DB32 AVR128DB48 AVR128DB64 AVR16DD14 AVR16DD20 AVR16DD28 AVR16DD32 AVR32DD14 AVR32DD20 AVR32DD28 AVR32DD32 AVR64DD14 AVR64DD20 AVR64DD28 AVR64DD32 AVR8EA28 AVR8EA32 AVR16EA28 AVR16EA32 AVR16EA48 AVR32EA28 AVR32EA32 AVR32EA48 AVR64EA28 AVR64EA32 AVR64EA48
4224 ATtiny424 ATtiny426 ATtiny427 ATtiny824 ATtiny826 ATtiny827 ATtiny1624 ATtiny1626 ATtiny1627 ATtiny3224 ATtiny3226 ATtiny3227

@MCUdude
Copy link
Collaborator Author

MCUdude commented Aug 3, 2023

Hmmm. I suspect there is a gating in silicon in that case, but can't confirm without asking an expert...
(SRAM memtype is the right one - there is an undocumented variant (0xB7) which is the same but without that offset, which is worth a try, but a long shot)

@xedbg I tried 0xB7 as well (AVR8_MEMTYPE_TBUS according to pyedbglib), with and without the 0x1000000 offset, and it didn't work either.

Sanity check: The following table shows the parts by their io size; is that the same as #1474 (comment)?

I had a look at the family datasheets, and I'm pretty sure I've gotten the sizes right. Feel free to double check!

@stefanrueger
Copy link
Collaborator

gotten the sizes right

Good, I put the table there to ward off inheritance errors.

@MCUdude MCUdude changed the title Read chip silicon revision on chips with PDI and UPDI Read chip silicon revision and add IO memory on chips with PDI and UPDI Aug 4, 2023
@stefanrueger
Copy link
Collaborator

@MCUdude You were right about the merge conflicts. Thanks for dealing with them.

I did another sanity cross check of the io sizes against the .atdf files:

io start io size No of parts Parts
0x00 0x1000 45 ATxmega128A1 ATxmega128A1U ATxmega128A3 ATxmega128A3U ATxmega128A4U ATxmega128B1 ATxmega128B3 ATxmega128C3 ATxmega128D3 ATxmega128D4 ATxmega16A4 ATxmega16A4U ATxmega16C4 ATxmega16D4 ATxmega16E5 ATxmega192A3 ATxmega192A3U ATxmega192C3 ATxmega192D3 ATxmega256A3 ATxmega256A3B ATxmega256A3BU ATxmega256A3U ATxmega256C3 ATxmega256D3 ATxmega32A4 ATxmega32A4U ATxmega32C3 ATxmega32C4 ATxmega32D3 ATxmega32D4 ATxmega32E5 ATxmega384C3 ATxmega384D3 ATxmega64A1 ATxmega64A1U ATxmega64A3 ATxmega64A3U ATxmega64A4U ATxmega64B1 ATxmega64B3 ATxmega64C3 ATxmega64D3 ATxmega64D4 ATxmega8E5
0x00 0x103f(!) 43 AVR128DA28 AVR128DA32 AVR128DA48 AVR128DA64 AVR128DB28 AVR128DB32 AVR128DB48 AVR128DB64 AVR16DD14 AVR16DD20 AVR16DD28 AVR16DD32 AVR16EA28 AVR16EA32 AVR16EA48 AVR32DA28 AVR32DA32 AVR32DA48 AVR32DB28 AVR32DB32 AVR32DB48 AVR32DD14 AVR32DD20 AVR32DD28 AVR32DD32 AVR32EA28 AVR32EA32 AVR32EA48 AVR64DA28 AVR64DA32 AVR64DA48 AVR64DA64 AVR64DB28 AVR64DB32 AVR64DB48 AVR64DB64 AVR64DD14 AVR64DD20 AVR64DD28 AVR64DD32 AVR64EA28 AVR64EA32 AVR64EA48
0x00 0x1100 46 ATmega1608 ATmega1609 ATmega3208 ATmega3209 ATmega4808 ATmega4809 ATmega808 ATmega809 ATtiny1604 ATtiny1606 ATtiny1607 ATtiny1614 ATtiny1616 ATtiny1617 ATtiny1624 ATtiny1626 ATtiny1627 ATtiny202 ATtiny204 ATtiny212 ATtiny214 ATtiny3216 ATtiny3217 ATtiny3224 ATtiny3226 ATtiny3227 ATtiny402 ATtiny404 ATtiny406 ATtiny412 ATtiny414 ATtiny416 ATtiny416auto ATtiny417 ATtiny424 ATtiny426 ATtiny427 ATtiny804 ATtiny806 ATtiny807 ATtiny814 ATtiny816 ATtiny817 ATtiny824 ATtiny826 ATtiny827
0x00 0x0040 11 ATtiny10 ATtiny102 ATtiny104 ATtiny11 ATtiny12 ATtiny15 ATtiny20 ATtiny4 ATtiny40 ATtiny5 ATtiny9
0x20 0x0040 31 ATmega16 ATmega16A ATmega32 ATmega32A ATmega8 ATmega8515 ATmega8535 ATmega8A ATtiny13 ATtiny13A ATtiny2313 ATtiny2313A ATtiny24 ATtiny24A ATtiny25 ATtiny26 ATtiny261 ATtiny261A ATtiny28 ATtiny4313 ATtiny43U ATtiny44 ATtiny44A ATtiny45 ATtiny461 ATtiny461A ATtiny84 ATtiny84A ATtiny85 ATtiny861 ATtiny861A
0x20 0x00e0 127 AT90CAN128 AT90CAN32 AT90CAN64 AT90PWM1 AT90PWM161 AT90PWM216 AT90PWM2B AT90PWM3 AT90PWM316 AT90PWM3B AT90PWM81 AT90USB1286 AT90USB1287 AT90USB162 AT90USB646 AT90USB647 AT90USB82 ATA5272 ATA5505 ATA5790 ATA5790N ATA5791 ATA5795 ATA6285 ATA6286 ATA6612C ATA6613C ATA6614Q ATA6616C ATA6617C ATA664251 ATmega128 ATmega1284 ATmega1284P ATmega128A ATmega162 ATmega164A ATmega164P ATmega164PA ATmega165A ATmega165P ATmega165PA ATmega168 ATmega168A ATmega168P ATmega168PA ATmega168PB ATmega169A ATmega169P ATmega169PA ATmega16HVA ATmega16HVB ATmega16HVBrevB ATmega16M1 ATmega16U2 ATmega16U4 ATmega324A ATmega324P ATmega324PA ATmega324PB ATmega325 ATmega3250 ATmega3250A ATmega3250P ATmega3250PA ATmega325A ATmega325P ATmega325PA ATmega328 ATmega328P ATmega328PB ATmega329 ATmega3290 ATmega3290A ATmega3290P ATmega3290PA ATmega329A ATmega329P ATmega329PA ATmega32C1 ATmega32HVB ATmega32HVBrevB ATmega32M1 ATmega32U2 ATmega32U4 ATmega406 ATmega48 ATmega48A ATmega48P ATmega48PA ATmega48PB ATmega64 ATmega644 ATmega644A ATmega644P ATmega644PA ATmega645 ATmega6450 ATmega6450A ATmega6450P ATmega645A ATmega645P ATmega649 ATmega6490 ATmega6490A ATmega6490P ATmega649A ATmega649P ATmega64A ATmega64C1 ATmega64HVE2 ATmega64M1 ATmega88 ATmega88A ATmega88P ATmega88PA ATmega88PB ATmega8HVA ATmega8U2 ATtiny1634 ATtiny167 ATtiny441 ATtiny48 ATtiny828 ATtiny841 ATtiny87 ATtiny88
0x20 0x01e0 26 ATA5700M322 ATA5702M322 ATA5781 ATA5782 ATA5783 ATA5787 ATA5831 ATA5832 ATA5833 ATA5835 ATA8210 ATA8215 ATA8510 ATA8515 ATmega1280 ATmega1281 ATmega1284RFR2 ATmega128RFA1 ATmega128RFR2 ATmega2560 ATmega2561 ATmega2564RFR2 ATmega256RFR2 ATmega640 ATmega644RFR2 ATmega64RFR2

Ignoring the classic parts for now (I will deal with them in an automated way for completeness later) there are still differences between the .atdf files and this PR but I think this PR is right. The 0x103f size looks wrong (probably caused by mistaking the last address for the size of a memory).

@MCUdude
Copy link
Collaborator Author

MCUdude commented Aug 5, 2023

@stefanrueger I've now resolved the merge conflict, so the PR is now ready.

@MCUdude
Copy link
Collaborator Author

MCUdude commented Aug 5, 2023

Wait, why is the size of IO 0x1100 for megaAVR0 and tinyAVR0/1/2? This doesn't comply with the information provided in the datasheet! What's correct, and what isn't?

From ioavr128da48.h:

/* NVMCTRL - Non-volatile Memory Controller */
#define NVMCTRL_CTRLA  _SFR_MEM8(0x1000)
#define NVMCTRL_CTRLB  _SFR_MEM8(0x1001)
#define NVMCTRL_STATUS  _SFR_MEM8(0x1002)
#define NVMCTRL_INTCTRL  _SFR_MEM8(0x1003)
#define NVMCTRL_INTFLAGS  _SFR_MEM8(0x1004)
#define NVMCTRL_DATA  _SFR_MEM16(0x1006)
#define NVMCTRL_DATAL  _SFR_MEM8(0x1006)
#define NVMCTRL_DATAH  _SFR_MEM8(0x1007)
#define NVMCTRL_ADDR  _SFR_MEM32(0x1008)
#define NVMCTRL_ADDR0  _SFR_MEM8(0x1008)
#define NVMCTRL_ADDR1  _SFR_MEM8(0x1009)
#define NVMCTRL_ADDR2  _SFR_MEM8(0x100A)
#define NVMCTRL_ADDR3  _SFR_MEM8(0x100B)


/* LOCK - Lockbits */
#define LOCK_KEY  _SFR_MEM32(0x1040)
#define LOCK_KEY0  _SFR_MEM8(0x1040)
#define LOCK_KEY1  _SFR_MEM8(0x1041)
#define LOCK_KEY2  _SFR_MEM8(0x1042)
#define LOCK_KEY3  _SFR_MEM8(0x1043)

From iom4809.h:

/* SYSCFG - System Configuration Registers */
#define SYSCFG_REVID  _SFR_MEM8(0x0F01)
#define SYSCFG_EXTBRK  _SFR_MEM8(0x0F02)
#define SYSCFG_OCDM  _SFR_MEM8(0x0F18)
#define SYSCFG_OCDMS  _SFR_MEM8(0x0F19)


/* NVMCTRL - Non-volatile Memory Controller */
#define NVMCTRL_CTRLA  _SFR_MEM8(0x1000)
#define NVMCTRL_CTRLB  _SFR_MEM8(0x1001)
#define NVMCTRL_STATUS  _SFR_MEM8(0x1002)
#define NVMCTRL_INTCTRL  _SFR_MEM8(0x1003)
#define NVMCTRL_INTFLAGS  _SFR_MEM8(0x1004)
#define NVMCTRL_DATA  _SFR_MEM16(0x1006)
#define NVMCTRL_DATAL  _SFR_MEM8(0x1006)
#define NVMCTRL_DATAH  _SFR_MEM8(0x1007)
#define NVMCTRL_ADDR  _SFR_MEM16(0x1008)
#define NVMCTRL_ADDRL  _SFR_MEM8(0x1008)
#define NVMCTRL_ADDRH  _SFR_MEM8(0x1009)


/* SIGROW - Signature row */
#define SIGROW_DEVICEID0  _SFR_MEM8(0x1100)
#define SIGROW_DEVICEID1  _SFR_MEM8(0x1101)
#define SIGROW_DEVICEID2  _SFR_MEM8(0x1102)
#define SIGROW_SERNUM0  _SFR_MEM8(0x1103)
#define SIGROW_SERNUM1  _SFR_MEM8(0x1104)
#define SIGROW_SERNUM2  _SFR_MEM8(0x1105)
#define SIGROW_SERNUM3  _SFR_MEM8(0x1106)
#define SIGROW_SERNUM4  _SFR_MEM8(0x1107)
#define SIGROW_SERNUM5  _SFR_MEM8(0x1108)
#define SIGROW_SERNUM6  _SFR_MEM8(0x1109)
#define SIGROW_SERNUM7  _SFR_MEM8(0x110A)
#define SIGROW_SERNUM8  _SFR_MEM8(0x110B)
#define SIGROW_SERNUM9  _SFR_MEM8(0x110C)
#define SIGROW_OSCCAL32K  _SFR_MEM8(0x1114)
#define SIGROW_OSCCAL16M0  _SFR_MEM8(0x1118)
#define SIGROW_OSCCAL16M1  _SFR_MEM8(0x1119)
#define SIGROW_OSCCAL20M0  _SFR_MEM8(0x111A)
#define SIGROW_OSCCAL20M1  _SFR_MEM8(0x111B)
#define SIGROW_TEMPSENSE0  _SFR_MEM8(0x1120)
#define SIGROW_TEMPSENSE1  _SFR_MEM8(0x1121)
#define SIGROW_OSC16ERR3V  _SFR_MEM8(0x1122)
#define SIGROW_OSC16ERR5V  _SFR_MEM8(0x1123)
#define SIGROW_OSC20ERR3V  _SFR_MEM8(0x1124)
#define SIGROW_OSC20ERR5V  _SFR_MEM8(0x1125)
#define SIGROW_CHECKSUM1  _SFR_MEM8(0x112F)

From iotn3227.h:

/* SYSCFG - System Configuration Registers */
#define SYSCFG_REVID  _SFR_MEM8(0x0F01)


/* NVMCTRL - Non-volatile Memory Controller */
#define NVMCTRL_CTRLA  _SFR_MEM8(0x1000)
#define NVMCTRL_CTRLB  _SFR_MEM8(0x1001)
#define NVMCTRL_STATUS  _SFR_MEM8(0x1002)
#define NVMCTRL_INTCTRL  _SFR_MEM8(0x1003)
#define NVMCTRL_INTFLAGS  _SFR_MEM8(0x1004)
#define NVMCTRL_DATA  _SFR_MEM16(0x1006)
#define NVMCTRL_DATAL  _SFR_MEM8(0x1006)
#define NVMCTRL_DATAH  _SFR_MEM8(0x1007)
#define NVMCTRL_ADDR  _SFR_MEM16(0x1008)
#define NVMCTRL_ADDRL  _SFR_MEM8(0x1008)
#define NVMCTRL_ADDRH  _SFR_MEM8(0x1009)


/* SIGROW - Signature row */
#define SIGROW_DEVICEID0  _SFR_MEM8(0x1100)
#define SIGROW_DEVICEID1  _SFR_MEM8(0x1101)
#define SIGROW_DEVICEID2  _SFR_MEM8(0x1102)
#define SIGROW_SERNUM0  _SFR_MEM8(0x1103)
#define SIGROW_SERNUM1  _SFR_MEM8(0x1104)
#define SIGROW_SERNUM2  _SFR_MEM8(0x1105)
#define SIGROW_SERNUM3  _SFR_MEM8(0x1106)
#define SIGROW_SERNUM4  _SFR_MEM8(0x1107)
#define SIGROW_SERNUM5  _SFR_MEM8(0x1108)
#define SIGROW_SERNUM6  _SFR_MEM8(0x1109)
#define SIGROW_SERNUM7  _SFR_MEM8(0x110A)
#define SIGROW_SERNUM8  _SFR_MEM8(0x110B)
#define SIGROW_SERNUM9  _SFR_MEM8(0x110C)
#define SIGROW_OSCCAL16M0  _SFR_MEM8(0x1118)
#define SIGROW_OSCCAL16M1  _SFR_MEM8(0x1119)
#define SIGROW_OSCCAL20M0  _SFR_MEM8(0x111A)
#define SIGROW_OSCCAL20M1  _SFR_MEM8(0x111B)

@dbuchwald
Copy link
Contributor

dbuchwald commented Aug 5, 2023 via email

@MCUdude
Copy link
Collaborator Author

MCUdude commented Aug 5, 2023

@dbuchwald a separate PR that deals with SIB read has already been merged, and @stefanrueger did the serialupdi implementation, see #1480

@MCUdude
Copy link
Collaborator Author

MCUdude commented Aug 5, 2023

@stefanrueger I suggest we change the size of the IO memory for the megaAVR-0 and tinyAVR-0/1/2 to 0x1100, as the atdf files do. Then we are also able to access the NVM registers as well.

from the megaAVR-0 family datasheet:

image


from the AVR128DA48 datasheet:
image

@dbuchwald
Copy link
Contributor

dbuchwald commented Aug 5, 2023 via email

@stefanrueger
Copy link
Collaborator

changes in serialupdi.c

@dbuchwald PR #1480 introduced these changes: some overcautious sanity checks, returning OK if a read-only memory is written to with its unchanged content (for a future backup/restore extension of AVRDUDE so that there is no error restoring the existing contents to read-only memories). It turned out that the info needed was already there as you pointed out (thank you). If you feel strongly about formatting/programming style (the PR uses a particularly dense writing style) feel free to put in a PR that adjusts the code to your style.

change the size of the IO memory for the megaAVR-0 and tinyAVR-0/1/2 [to] access the NVM registers as well

@MCUdude Yes, can do. I would first check whether this creates overlapping memories. These are a nightmare in the dryrun programmer b/c whenever the dryrun programmer writes to one memory, it needs to update the other memory as well, and the overlaps may be hard to figure out. If the extended io doesn't overlap with other NVM memory then OK. The other aspect is documentation in avrdude.1 and avrdude.texi: normally io is volatile memory, so the doc would say that anything written to these memories will be undefined/lost after reset and that writing may have limited utility for modern AVRs, eg, to test ports I/O. If io is a mixture of volatile and non-volatile for some parts, we would need to say so, too.

I will later, in a separate PR, add io memories of classic parts; there the io memory cannot be programmed externally, only with bootloaders, which has limited use unless the bootloader jumps to the application directly, ie, without a WDT reset.

@stefanrueger
Copy link
Collaborator

For info, now this PR has the following sizes

io size No of parts Parts
4096 50 ATxmega128A1 ATxmega128A1revD ATxmega128A1U ATxmega128A3 ATxmega128A3U ATxmega128A4 ATxmega128A4 ATxmega128A4U ATxmega128A4U ATxmega128B1 ATxmega128B3 ATxmega128C3 ATxmega128D3 ATxmega128D4 ATxmega16A4 ATxmega16A4 ATxmega16A4 ATxmega16A4 ATxmega16A4U ATxmega16A4U ATxmega16A4U ATxmega16A4U ATxmega16C4 ATxmega16C4 ATxmega16C4 ATxmega16C4 ATxmega16D4 ATxmega16D4 ATxmega16D4 ATxmega16D4 ATxmega16E5 ATxmega16E5 ATxmega16E5 ATxmega16E5 ATxmega192A1 ATxmega192A3 ATxmega192A3U ATxmega192C3 ATxmega192D3 ATxmega256A1 ATxmega256A1 ATxmega256A3 ATxmega256A3 ATxmega256A3B ATxmega256A3B ATxmega256A3BU ATxmega256A3BU ATxmega256A3U ATxmega256A3U ATxmega256C3 ATxmega256C3 ATxmega256D3 ATxmega256D3 ATxmega32A4 ATxmega32A4 ATxmega32A4 ATxmega32A4 ATxmega32A4U ATxmega32A4U ATxmega32A4U ATxmega32A4U ATxmega32C3 ATxmega32C3 ATxmega32C3 ATxmega32C3 ATxmega32C4 ATxmega32C4 ATxmega32C4 ATxmega32C4 ATxmega32D3 ATxmega32D3 ATxmega32D3 ATxmega32D3 ATxmega32D4 ATxmega32D4 ATxmega32D4 ATxmega32D4 ATxmega32E5 ATxmega32E5 ATxmega32E5 ATxmega32E5 ATxmega384C3 ATxmega384C3 ATxmega384D3 ATxmega384D3 ATxmega64A1 ATxmega64A1 ATxmega64A1 ATxmega64A1 ATxmega64A1U ATxmega64A1U ATxmega64A1U ATxmega64A1U ATxmega64A3 ATxmega64A3 ATxmega64A3 ATxmega64A3 ATxmega64A3U ATxmega64A3U ATxmega64A3U ATxmega64A3U ATxmega64A4 ATxmega64A4 ATxmega64A4 ATxmega64A4 ATxmega64A4U ATxmega64A4U ATxmega64A4U ATxmega64A4U ATxmega64B1 ATxmega64B1 ATxmega64B1 ATxmega64B1 ATxmega64B3 ATxmega64B3 ATxmega64B3 ATxmega64B3 ATxmega64C3 ATxmega64C3 ATxmega64C3 ATxmega64C3 ATxmega64D3 ATxmega64D3 ATxmega64D3 ATxmega64D3 ATxmega64D4 ATxmega64D4 ATxmega64D4 ATxmega64D4 ATxmega8E5
4160 45 AVR128DA28 AVR128DA32 AVR128DA48 AVR128DA64 AVR128DB28 AVR128DB32 AVR128DB48 AVR128DB64 AVR16DD14 AVR16DD20 AVR16DD28 AVR16DD32 AVR16EA28 AVR16EA32 AVR16EA48 AVR32DA28 AVR32DA32 AVR32DA48 AVR32DB28 AVR32DB32 AVR32DB48 AVR32DD14 AVR32DD20 AVR32DD28 AVR32DD32 AVR32EA28 AVR32EA32 AVR32EA48 AVR64DA28 AVR64DA32 AVR64DA48 AVR64DA64 AVR64DB28 AVR64DB32 AVR64DB48 AVR64DB64 AVR64DD14 AVR64DD20 AVR64DD28 AVR64DD32 AVR64EA28 AVR64EA32 AVR64EA48 AVR8EA28 AVR8EA32
4352 46 ATmega1608 ATmega1609 ATmega3208 ATmega3209 ATmega4808 ATmega4809 ATmega808 ATmega809 ATtiny1604 ATtiny1606 ATtiny1607 ATtiny1614 ATtiny1616 ATtiny1617 ATtiny1624 ATtiny1626 ATtiny1627 ATtiny202 ATtiny204 ATtiny212 ATtiny214 ATtiny3216 ATtiny3217 ATtiny3224 ATtiny3226 ATtiny3227 ATtiny402 ATtiny404 ATtiny406 ATtiny412 ATtiny414 ATtiny416 ATtiny416auto ATtiny417 ATtiny424 ATtiny426 ATtiny427 ATtiny804 ATtiny806 ATtiny807 ATtiny814 ATtiny816 ATtiny817 ATtiny824 ATtiny826 ATtiny827

@stefanrueger
Copy link
Collaborator

stefanrueger commented Aug 5, 2023

@MCUdude Having looked closer at the io datasheet definitions I would not extend the io to stretch to the NVM controller and (some) NVM memories. This to avoid overlapping memories in the memory layout. So far, we only have two cases where memories overlap: flash memories in XMEGAs (apptable, application, boot and flash) and the general fuses memory (10 bytes) and the fuse$n$ individual bytes, $n\in{0, ... 9}$. The latter has been considered in the dryrun programmer, the former has not (yet) but should. It is better to not create more memories with overlaps.

[EDIT: the dryrun programmer does the right thing for XMEGA's apptable, application and boot memories, at least in terminal mode]

@MCUdude
Copy link
Collaborator Author

MCUdude commented Aug 5, 2023

I would not extend the io to stretch to the NVM controller and (some) NVM memories

This means that the IO memory size can't be larger than 0x1000 bytes on megaAVR0, tinyAVR0/1/2, and AVR-Dx/Ex. Do you want me to update the PR where I change the size to 0x1000?

@stefanrueger
Copy link
Collaborator

update the PR where I change the size

Yes, I think this is how it was before. Your first analysis was right, the .atdf are wrong as they cover more than the volatile memories.

@stefanrueger
Copy link
Collaborator

@MCUdude If you are happy and have finished testing I can merge

@MCUdude
Copy link
Collaborator Author

MCUdude commented Aug 5, 2023

if we extend io to 0x1100 (all except for XMEGA) there still won't be an overlap in avrdude.conf? AFAIK Avrdude doesn't utilize he NVM controller

@stefanrueger
Copy link
Collaborator

stefanrueger commented Aug 5, 2023

extend io to 0x1100

Your call. Please just make sure io won't overlap with any other memory in avrdude.conf (eg, lock bits, fuses, eeprom, ...)

@MCUdude
Copy link
Collaborator Author

MCUdude commented Aug 5, 2023

Please just make sure io won't overlap with any other memory in avrdude.conf (eg, lock bits, fuses, eeprom, ...)

I'll double-check that this won't lead to any overlap what so ever.

@MCUdude
Copy link
Collaborator Author

MCUdude commented Aug 5, 2023

I've rolled back the last commit, so now the IO memory correlates with the ATDF files (well, except for the 0x103F/0x1040 typo). The registers for the NVM controller (which I'm pretty sure are volatile) are now included in the IO memory,

I'm fine with merging this PR. Too bad I couldn't figure out how to write to the Xmega IO registers...

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.

Read silicon revision from "modern" AVRs
5 participants