Author Topic: Has anyone tried the XC8 PRO compiler with AVRs?  (Read 7134 times)

0 Members and 3 Guests are viewing this topic.

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 806
  • Country: gb
Re: Has anyone tried the XC8 PRO compiler with AVRs?
« Reply #50 on: September 24, 2019, 12:23:13 pm »
For Windows-
C:\Program Files (x86)\Microchip\xc8\v2.00\avr\libexec\gcc\avr\5.4.0\cc1.exe  - file offset 0xBF5890 - change FFFFFFFFFFFFFFFF to 0200000000000000

Address has shifted a little for AVR "PRO" mode in XC8 v2.10 (MS Windows):
C:\Program Files (x86)\Microchip\xc8\v2.10\avr\libexec\gcc\avr\5.4.0\cc1.exe  - file offset 0xC22690 - change FFFFFFFFFFFFFFFF to 0200000000000000
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3292
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Has anyone tried the XC8 PRO compiler with AVRs?
« Reply #51 on: September 24, 2019, 04:27:23 pm »
For Windows-
C:\Program Files (x86)\Microchip\xc8\v2.00\avr\libexec\gcc\avr\5.4.0\cc1.exe  - file offset 0xBF5890 - change FFFFFFFFFFFFFFFF to 0200000000000000

Address has shifted a little for AVR "PRO" mode in XC8 v2.10 (MS Windows):
C:\Program Files (x86)\Microchip\xc8\v2.10\avr\libexec\gcc\avr\5.4.0\cc1.exe  - file offset 0xC22690 - change FFFFFFFFFFFFFFFF to 0200000000000000
Can I just compile upstream avr-gcc and avr-libc, and use that as a drop-in? Also how good is Microchip's optimizer for GCC 5.4 than that in mainline GCC 8.2?
 

Online westfw

  • Super Contributor
  • ***
  • Posts: 3125
  • Country: us
Re: Has anyone tried the XC8 PRO compiler with AVRs?
« Reply #52 on: September 24, 2019, 11:42:18 pm »
Quote
Can I just compile upstream avr-gcc and avr-libc, and use that as a drop-in?
People have done it. ( https://www.avrfreaks.net/forum/avr-gcc-91-avr-libc-xmega3-device-support )  IMO, it's risky - the gcc developers don't pay much attention to AVR, and they tend to break things.  One of the reasons that AS7 and XC8 are behind is because of wanting to stay with "known working" code.
avr-libc is thornier.  BSD rather than GPL, so Microchip can in theory develop a divergent version of avr-libc with undocumented changes :-(
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 1652
  • Country: pl
Re: Has anyone tried the XC8 PRO compiler with AVRs?
« Reply #53 on: September 25, 2019, 07:10:40 am »
I noticed that Atmel/Microchip switched from preprocessor macros to structures and enums in their official C headers for the "xmega3" chips.
Is avr-libc doing the same, are they source-level compatible?

Also, does anyone know why they added suffixes like _gc to the names of enum values? Any official explanation what those things mean? :-//

edit
Nevermind, found it. It's another thing carried over from the Xmega line, documented in AVR1000. The 3rd party avr-libc appears to follow this convention for classic Xmegas so they surely will for the new chips too. If they ever wake up and release an update, that is :)
« Last Edit: September 25, 2019, 08:44:06 am by magic »
 

Online westfw

  • Super Contributor
  • ***
  • Posts: 3125
  • Country: us
Re: Has anyone tried the XC8 PRO compiler with AVRs?
« Reply #54 on: September 25, 2019, 10:23:16 am »
Quote
noticed that Atmel/Microchip switched from preprocessor macros to structures and enums in their official C headers for the "xmega3" chips.
Is avr-libc doing the same, are they source-level compatible?
Yes.  This started with the ARM and XMega chips (CMSIS compatible, more or less.)  Long overdue, IMO.  Having 4 sets of individual registers for the 4 UARTs on an ATmega1280 was silly.
Quote
Also, does anyone know why they added suffixes like _gc to the names of enum values?
_bm: bitmask, for single bits.  _bp: bit position for single bits_gm: group(?) mask, for multibit fields.  _gp: group position.  _gc: group(?) code(?) individual values of multibit field


Quote
documented in AVR1000.
Oh cool!  You found documentation!  ('c' is apparently "configuration", not code.)

Quote
The 3rd party avr-libc ...  surely will for the new chips too. If they ever wake up and release an update, that is
As far as the #include files and compiler specs are concerned, the OSSW compilers can use the files included in the "packs" that microchip distributes.  (supposedly, the chip .h files are generated automatically from some common .xml files that come out of the chip design.  Despite the large number of fixes in avr-libc that say "fixed a particular definition in a particular chip .h file."  Hmmph.)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf