patchAVR C Runtime Library - Patches: patch #9543, Add avrxmega3 devices.


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

patch #9543: Add avrxmega3 devices.

Submitted by:  Balint Cristian <cbalint>
Submitted on:  Wed 17 Jan 2018 03:29:03 PM UTC  
Category: NonePriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open

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

Tue 23 Jan 2018 02:09:12 PM UTC, comment #13:

The avrxmega3-v6.diff.bz2 includes a ATDF parser for AVR8X.

- The new parser addition does:

  • Generates iotn*.h just from atdf schema.
  • Parse only AVR8X family types (constrained in script).
  • Adds few alieases (hardcoded) as older coding-style.
  • Headers generated are functional the same as Atmel's 3.6.1.
  • Parser license is BSD (the very avr-libc one).

- BTW, One of main difference BSD vs Apache would be that Apache license grants patents (patents will not circumvent the license terms). But I am not lawyer.

Balint Cristian <cbalint>
Fri 19 Jan 2018 10:42:09 AM UTC, comment #12:

Mixing the licenses is doable, it's just a little cumbersome
since we need to LICENSE documents then at the toplevel.

If #b is not too much work, it would be my personally preferred
solution, as it makes us completely independent from Microchip.
They've chosen to distribute their own version of the headers
independently from us anyway.

Joerg Wunsch <joerg_wunsch>
Project Administrator
Fri 19 Jan 2018 10:33:27 AM UTC, comment #11:
  • The Apache license on io*.h might expose a problem.

- Some possible solutions.

a) Mchip/Atmel right now mixes BSD+Apache in their packages, so avr-libc could do it too ? (not a lawyer).

b) Make new headers from scratch based from docs. A simple one (no fancy struct), just simple enumerations.

  • I incline to choose #b, and i am willing to do the task if You all here agree. Probably wise would be to have a common avr8x.h and some alias files that adds extras for each particular devices.
Balint Cristian <cbalint>
Thu 18 Jan 2018 04:32:53 PM UTC, comment #10:

Ok, better now. At least the trivial example builds now.

Some final notes on xmega.h:

Constraint "d" for [ccp_ioreg] resp. [ccp_spm_mask] could be relaxed to the less restrictive "r".

And from a strict point of view, both _PROTECTED_WRITE and _PROTECTED_WRITE_SPM are clobbering memory.

Georg-Johann Lay <gjlayde>
Thu 18 Jan 2018 03:53:50 PM UTC, comment #9:


Uploaded avrxmega3-v5.diff.bz2 .

  • Add _PROTECTED_WRITE_SPM in xmega.h (as per Atmel's upstream 3.6.1).
Balint Cristian <cbalint>
Thu 18 Jan 2018 03:10:27 PM UTC, comment #8:

There must still be missing something, at least _PROTECTED_WRITE_SPM. Apart from a build warning for a missing prototype, it's neither resolved by a macro nor my a symbol:

Georg-Johann Lay <gjlayde>
Thu 18 Jan 2018 02:07:09 PM UTC, comment #7:


- Thank you for the quick review.
- I believe your proposed changes are fine.

  • The task presented here is fairly easy to do, all basic ingredients are Atmel's upstream stuff. Not sure why they are not collaborating with you guys. They started to keep lots of changes on their own fork (their changes have no logs or names).
  • Perhaps migrating to a more collaborative platform like github would help this project a lot.
  • I attached outputs of a sample main() program for atn1616 target that looks good to me [attiny16161-disasm.txt.bz2]. Cannot validate yet on real device (waiting for real chip samples) .
  • I am working on avrdude & USBASP-firmware too for support UPDI

too (is quite similar to TPI). As reference for UPDI there is, you probably already know that.

Balint Cristian <cbalint>
Thu 18 Jan 2018 11:50:34 AM UTC, comment #6:

Thanks, I can build avr-libc now and a quick test looks good.

Regarding the changes to eewr_block_xmega.c, maybe it's clearer to special-case the different NVM flavours instead of #define + #undef + #define chains?

I allowed me to attach a respective patch as avrxmega3-v4.diff.bz2

Georg-Johann Lay <gjlayde>
Wed 17 Jan 2018 05:13:17 PM UTC, comment #5:
  • Compiles with avrxmega3-v3.patch.bz2 .

+ Backports changes from Atmel 3.6.1 [1] toolchain:

- eedef.h
- eewr_block_xmega.c
- eewr_byte.S


Balint Cristian <cbalint>
Wed 17 Jan 2018 04:15:45 PM UTC, comment #4:

With that patch, avr-libc fails to build:

Notice that avr-gcc defines AVR_XMEGA for these devices (in case that matters).

Georg-Johann Lay <gjlayde>
Wed 17 Jan 2018 04:14:14 PM UTC, comment #3:

Johann, Joerg,

* Attached avrxmega3-v2.patch.bz2 to add ChangeLog as new file.

Balint Cristian <cbalint>
Wed 17 Jan 2018 04:12:13 PM UTC, comment #2:

I agree with Johann's comment regarding ChangeLog, though it's
not too hard to simply extract the text from the diff.

It might be the first commit in 2018, so it's going to be a
completely new ChangeLog file anyway.

Joerg Wunsch <joerg_wunsch>
Project Administrator
Wed 17 Jan 2018 03:56:18 PM UTC, comment #1:

> Changed files: [...] ChangeLog

The delta to ChangeLog is not reasonable, too much lines affected.

Usually, ChangeLog is prone to conflicts as each push is touching it; hence it might be more comfortable to supply it as plain text snipped and leave it out of the patch.

Georg-Johann Lay <gjlayde>
Wed 17 Jan 2018 03:29:03 PM UTC, original submission:
  • This patch adds support for avrxmega3 devices already supported by latest gcc8 compiler:

attiny1614, attiny1616, attiny1617, attiny212, attiny214,
attiny3214, attiny3216, attiny3217, attiny412, attiny414,
attiny416, attiny417, attiny814, attiny816, attiny817 .

  • New files:

- attinny*.S are generated from latest .xml (.atdf) files.

- iotn*.h are from latest avr8-gnu-toolchain-osx- ( ).

- ChangeLog-2017

  • Changed files:

- include/avr/io.h
- include/avr/
- devtools/
- devtools/
- avr-libc/
- ChangeLog

Balint Cristian <cbalint>


Attached Files
file #43034:  avrxmega3-v6.diff.bz2 added by cbalint (292KiB - application/x-bzip - V6 of patch [includes ioavr8x.h gen])
file #42957:  avrxmega3-v5.diff.bz2 added by cbalint (284KiB - application/x-bzip - V5 patch [add _PROTECTED_WRITE_SPM])
file #42956:  attiny16161-disasm.txt.bz2 added by cbalint (2KiB - application/x-bzip - ATTINY1616 sample disasm prog.)
file #42952:  avrxmega3-v4.diff.bz2 added by gjlayde (284KiB - application/x-bzip - Avoid #define + #undef + #define chains)
file #42939:  avrxmega3-v3.patch.bz2 added by cbalint (285KiB - application/x-bzip - Patch V3 [backports Atmel's NVM])
file #42938:  avrxmega3-v2.patch.bz2 added by cbalint (284KiB - application/x-bzip - Fixed ChangeLog [now as new file].)
file #42937:  avrxmega3.patch.bz2 added by cbalint (285KiB - application/x-bzip - Add avrxmega3 devices.)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by joerg_wunsch (Posted a comment)
  • -unavailable- added by gjlayde (Posted a comment)
  • -unavailable- added by cbalint (Submitted the item)
  • -unavailable- added by cbalint (Add avrxmega3 devices.)

    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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 23 Jan 2018 01:59:05 PM UTCcbalintAttached File-=>Added avrxmega3-v6.diff.bz2, #43034
    Thu 18 Jan 2018 03:52:12 PM UTCcbalintAttached File-=>Added avrxmega3-v5.diff.bz2, #42957
    Thu 18 Jan 2018 01:53:33 PM UTCcbalintAttached File-=>Added attiny16161-disasm.txt.bz2, #42956
    Thu 18 Jan 2018 11:48:45 AM UTCgjlaydeAttached File-=>Added avrxmega3-v4.diff.bz2, #42952
    Wed 17 Jan 2018 05:10:43 PM UTCcbalintAttached File-=>Added avrxmega3-v3.patch.bz2, #42939
    Wed 17 Jan 2018 04:12:11 PM UTCcbalintAttached File-=>Added avrxmega3-v2.patch.bz2, #42938
    Wed 17 Jan 2018 03:29:03 PM UTCcbalintAttached File-=>Added avrxmega3.patch.bz2, #42937
      Carbon-Copy-=>Added -unavailable-

    Back to the top

    Powered by Savane 3.1-cleanup1