patchAVR Downloader/UploaDEr - Patches: patch #9482, Add support for UPDI and AVR8X

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9482: Add support for UPDI and AVR8X

Submitted by:  Jan Egil Ruud <je_ruud>
Submitted on:  Thu 09 Nov 2017 09:30:56 AM UTC  
 
Category: NonePriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Joerg Wunsch <joerg_wunsch>Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Thu 30 Nov 2017 05:42:25 PM UTC, comment #6:

Good work!
I will try to update the public edbg protocol documentation as it is lagging behind somewhat...

Judd <edbg>
Wed 29 Nov 2017 11:13:17 PM UTC, comment #5:

Thanks a lot, good work!

Just committed to SVN, with only few changes (white space only).

I think everything was in good enough shape to go to the
repository, we can hash out any remaining things on the
mailinglist now.

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Mon 27 Nov 2017 12:46:53 PM UTC, comment #4:

When programming flash over UPDI the flash offset is set up in the device context. So when writing to flash memory you start at address 0x0000. For the other memories you use absolute address. FUSES start at 0x1280, EEPROM start at 0x1400.

So then I guess it actually makes sense to use the offsets in avrdude.conf for these values. It simplifies things quite a bit.

Jan Egil Ruud <je_ruud>
Mon 27 Nov 2017 10:47:00 AM UTC, comment #3:

After digging a bit through the ATtiny816 datasheet, it doesn't
seem the UPDI uses something like the memory offsets that can
be seen in the Xmega PDI.

Note that the GNU tools offsets (0x810000 for EEPROM etc.) are
only relevant when reading directly from an ELF file. They are
supposed to already be correctly handled in AVRDUDE's ELF loader,
so don't need to be taken care of later on.

Figure 6-1 in the ATtiny817 datasheet suggests we might need
to apply an offset of 0x8000 when programming flash, as the
CPU's address 0 maps to an UPDI address 0x8000.

My toolchain hasn't been updated yet to handle the ATtiny817.
Could you perhaps an ELF file flashing a LED on the Xplained Pro
kit I could use as a starting point for tests?

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Sat 25 Nov 2017 11:38:36 PM UTC, comment #2:

I had to dig around for all this, too.

The offsets used in the linker scripts are based on historical
decisions, to merge all the distinct AVR Harvard address spaces
into a single, flat 32-bit address space which used to be the
default for GNU tools. That's where the 0x810000 for the
EEPROM comes from. The GNU tools use 0 through 0x800000 for
Flash, allowing for up to 8 MiB of flash. SRAM then starts
at 0x800000 (but is not of interest for AVRDUDE).

However, with the advent of the Xmega and PDI, the tools need
to talk to the NVM controller. The NVM controller uses a
different 32-bit address space model to map the Xmega's
individual memory regions. For an example, see Figure 30-3
in the Xmega A datasheet:

Thanks for your patch contributions, Jan Egil! They are
certainly welcome, and I'm going to look at all this now.

I'm glad to see guys from Atmel / Microchip contributing
here!

Joerg Wunsch <joerg_wunsch>
Project AdministratorIn charge of this item.
Wed 15 Nov 2017 09:28:56 AM UTC, comment #1:

Working with the device configuration for the AVR8X devices I'm struggling a bit with offsets. With AVR8X things like eeprom, fuses and lockbits are no longer in separate address spaces, they're mapped in the data address space. (EEPROM at 0x1400, fuses at 0x1280,...) These offsets should be mapped in the .conf file in my opinion, but how? I could add a new "mapped_offset", but where is the current memory offset used? Could that be reused for this?
I thought the memory offset in the .conf file was related to where the gcc linker maps content like eeprom, but from what I can see the linker uses 0x810000 for eeprom while avrdude uses 0x8c0000.
Could somebody enlighten me, please?

Jan Egil Ruud <je_ruud>
Thu 09 Nov 2017 09:30:56 AM UTC, original submission:

Add support for the UPDI interface. This programming and debugging interface is used in the AVR8X (2017->) series of devices and is supported in JTAGICE3, AtmelICE, EDBG, mEDBG, nEDBG and PowerDebugger.
Specification is located here: (will post a link when it finally goes public)

By adding support for UPDI it opens up for supporting the AVR8X range of devices; ATtiny212 - ATtiny416 - ATtiny817 - ATtiny1617 - ... (To be continued)

Jan Egil Ruud <je_ruud>

 

Attached Files
file #42523:  add-updi-support.patch added by je_ruud (20KiB - application/octet-stream - Patch update 2017-11-29 #2. Paged non-flash access working.)
file #42521:  tiny817_led_blink_button_xpro.elf added by je_ruud (23KiB - application/octet-stream - Led blinker for ATtiny817 Xplained Pro)
file #42519:  add-updi-support.patch added by je_ruud (20KiB - application/octet-stream - Patch update 2017-11-29. AVR8X device context done. Reading fuses is OK.)
file #42518:  tiny817_led_blink_button_xmini.elf added by je_ruud (21KiB - application/octet-stream - Led blinker for ATtiny817 Xplained Mini)
file #42406:  add-updi-support.patch added by je_ruud (19KiB - application/octet-stream - Patch update 2017-11-15.)
file #42391:  pgm_type.c.patch added by je_ruud (632B - text/x-patch - Flash seems to be working. EEPROM and fuses need more work.)
file #42387:  jtag3.h.patch added by je_ruud (605B - text/x-patch - Flash seems to be working. EEPROM and fuses need more work.)
file #42388:  jtag3_private.h.patch added by je_ruud (2KiB - text/x-patch - Flash seems to be working. EEPROM and fuses need more work.)
file #42389:  lexer.l.patch added by je_ruud (587B - text/x-patch - Flash seems to be working. EEPROM and fuses need more work.)
file #42390:  libavrdude.h.patch added by je_ruud (581B - text/x-patch - Flash seems to be working. EEPROM and fuses need more work.)
file #42383:  avrdude.conf.in.patch added by je_ruud (4KiB - text/x-patch - Flash seems to be working. EEPROM and fuses need more work.)
file #42384:  config_gram.y.patch added by je_ruud (1KiB - text/x-patch - Flash seems to be working. EEPROM and fuses need more work.)
file #42385:  avrdude.texi.patch added by je_ruud (636B - text/x-patch - Flash seems to be working. EEPROM and fuses need more work.)
file #42386:  jtag3.c.patch added by je_ruud (5KiB - text/x-patch - Flash seems to be working. EEPROM and fuses need more work.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by edbg (Posted a comment)
  • -unavailable- added by joerg_wunsch (Posted a comment)
  • -unavailable- added by je_ruud (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 18 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 29 Nov 2017 11:13:17 PM UTCjoerg_wunschStatusIn Progress=>Done
      Open/ClosedOpen=>Closed
    Wed 29 Nov 2017 01:48:05 PM UTCje_ruudAttached File-=>Added add-updi-support.patch, #42523
    Wed 29 Nov 2017 10:54:16 AM UTCje_ruudAttached File-=>Added tiny817_led_blink_button_xpro.elf, #42521
    Wed 29 Nov 2017 09:28:22 AM UTCje_ruudAttached File-=>Added add-updi-support.patch, #42519
    Wed 29 Nov 2017 09:22:24 AM UTCje_ruudAttached File-=>Added tiny817_led_blink_button_xmini.elf, #42518
    Mon 27 Nov 2017 10:47:00 AM UTCjoerg_wunschStatusNone=>In Progress
      Assigned toNone=>joerg_wunsch
    Wed 15 Nov 2017 08:57:13 AM UTCje_ruudAttached File-=>Added add-updi-support.patch, #42406
    Mon 13 Nov 2017 08:13:45 AM UTCje_ruudAttached File-=>Added pgm_type.c.patch, #42391
    Mon 13 Nov 2017 08:13:26 AM UTCje_ruudAttached File-=>Added jtag3.h.patch, #42387
      Attached File-=>Added jtag3_private.h.patch, #42388
      Attached File-=>Added lexer.l.patch, #42389
      Attached File-=>Added libavrdude.h.patch, #42390
    Mon 13 Nov 2017 08:12:09 AM UTCje_ruudAttached File-=>Added avrdude.conf.in.patch, #42383
      Attached File-=>Added config_gram.y.patch, #42384
      Attached File-=>Added avrdude.texi.patch, #42385
      Attached File-=>Added jtag3.c.patch, #42386

    Back to the top


    Powered by Savane 3.1-cleanup1