Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
melon87
PostPosted: Apr 19, 2012 - 05:23 PM
Wannabe


Joined: Feb 21, 2012
Posts: 66


Hi AVR GCC forum,

I normally post on the xmega forum but I think this error with avr gcc 4.3.2. I have an application which worked for the atxmega32a4. I now want to get it work for the atxmega128d4. I looked at the make file which defines COMMON = -mmcu=$(MCU)and so I changed MCU = atxmega32a4 to atxmega128d4. When I compile on the command line I get,

Code:
avr-gcc  -mmcu=atxmega128d4 -Wall -gdwarf-2 -std=gnu99     -DF_CPU=2000000UL -Os
 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT ee
prom_driver.o -MF dep/eeprom_driver.o.d -c  eeprom_driver.c
unknown MCU 'atxmega128d4' specified
Known MCU names:
   avr2
   ...
eeprom_driver.c:1: error: MCU 'atxmega128d4' supported for assembler only
In file included from avr_compiler.h:129,
                 from eeprom_driver.h:62,
                 from eeprom_driver.c:59:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h:404:6: warning: #warning "
device type not defined"
eeprom_driver.c: In function 'EEPROM_WriteByte':
eeprom_driver.c:78: error: 'NVM' undeclared (first use in this function)
...
make: *** [eeprom_driver.o] Error 1


What further informations it is requiring to transfer the code onto an atxmega128d4?

Kind Regards
 
 View user's profile Send private message  
Reply with quote Back to top
lfmorrison
PostPosted: Apr 19, 2012 - 05:51 PM
Raving lunatic


Joined: Dec 08, 2004
Posts: 4719
Location: Nova Scotia, Canada

It seems likely that you are using a version of the compiler which is too old to include support for the Xmega series of AVRs.

The official GNU sources for avr-gcc only recently started to add Xmega support, with an apparently fully functional implementation slated to be released in the upcoming version 4.7.1.

Several 3rd party distributions of avr-gcc include patches which add varying levels of additional functionality not found in the regular GNU edition of the compiler. At the distribution maintainers' discretion, such patches may or may not include support for new AVR parts such as Xmega.

So, where did you obtain your copy of avr-gcc?
- Did it come as part of WinAVR? (Which version of WinAVR?)
- Did it come as a package in a Linux distribution? (Which distribution? Which version?)
- Did you compile the compiler yourself? (Which patches did you apply?)
- Elsewhere?
 
 View user's profile Send private message  
Reply with quote Back to top
melon87
PostPosted: Apr 19, 2012 - 06:31 PM
Wannabe


Joined: Feb 21, 2012
Posts: 66


Hi Ifmorrison,

Thanks so much for taking a look at my problem.

I have to admit I am an AVR studio person but I've always wanted to learn more about the 'rawer' form. I also went this route as I needed to use an external make file - which was just easier on the command line.

I installed avr-gcc as part of WinAVR-20100110 on to my windows 7 64 bit machine. I didn't compile it myself - all I did was make my hex file. And because I am too new, I wouldn't know how to patch it.

Ofcourse, I agree, its a version issue. I managed to find the files to update (compared to my avr studio 5 project) but I assume I would need to 'recompile' gcc for the changes to take affect?
 
 View user's profile Send private message  
Reply with quote Back to top
SprinterSB
PostPosted: Apr 19, 2012 - 07:01 PM
Posting Freak


Joined: Dec 21, 2006
Posts: 1483
Location: Saar-Lor-Lux

The 4.7 supported devices are:
Code:
avr2
    “Classic” devices with up to 8 KiB of program memory.
    mcu = at90s2313, at90s2323, at90s2333, at90s2343,
    attiny22, attiny26, at90s4414, at90s4433,
    at90s4434, at90s8515, at90c8534, at90s8535.
avr25
    “Classic” devices with up to 8 KiB of program
    memory and with the MOVW instruction.
    mcu = ata6289, attiny13, attiny13a, attiny2313,
    attiny2313a, attiny24, attiny24a, attiny4313,
    attiny44, attiny44a, attiny84, attiny84a,
    attiny25, attiny45, attiny85, attiny261,
    attiny261a, attiny461, attiny461a, attiny861,
    attiny861a, attiny43u, attiny87, attiny48,
    attiny88, at86rf401.
avr3
    “Classic” devices with 16 KiB up to 64 KiB of
    program memory.
    mcu = at43usb355, at76c711.
avr31
    “Classic” devices with 128 KiB of program memory.
    mcu = atmega103, at43usb320.
avr35
    “Classic” devices with 16 KiB up to 64 KiB of
    program memory and with the MOVW instruction.
    mcu = at90usb82, at90usb162, atmega8u2,
    atmega16u2, atmega32u2, attiny167.
avr4
    “Enhanced” devices with up to 8 KiB of program
    memory.
    mcu = atmega8, atmega48, atmega48a, atmega48p,
    atmega88, atmega88a, atmega88p, atmega88pa,
    atmega8515, atmega8535, atmega8hva, at90pwm1,
    at90pwm2, at90pwm2b, at90pwm3, at90pwm3b,
    at90pwm81.
avr5
    “Enhanced” devices with 16 KiB up to 64 KiB of
    program memory.
    mcu = atmega16, atmega16a, atmega161, atmega162,
    atmega163, atmega164a, atmega164p, atmega165,
    atmega165a, atmega165p, atmega168, atmega168a,
    atmega168p, atmega169, atmega169a, atmega169p,
    atmega169pa, atmega32, atmega323, atmega324a,
    atmega324p, atmega324pa, atmega325, atmega325a,
    atmega325p, atmega3250, atmega3250a, atmega3250p,
    atmega328, atmega328p, atmega329, atmega329a,
    atmega329p, atmega329pa, atmega3290, atmega3290a,
    atmega3290p, atmega406, atmega64, atmega640,
    atmega644, atmega644a, atmega644p, atmega644pa,
    atmega645, atmega645a, atmega645p, atmega6450,
    atmega6450a, atmega6450p, atmega649, atmega649a,
    atmega649p, atmega6490, atmega16hva,
    atmega16hva2, atmega16hvb, atmega32hvb,
    atmega64hve, at90can32, at90can64, at90pwm216,
    at90pwm316, atmega32c1, atmega64c1, atmega16m1,
    atmega32m1, atmega64m1, atmega16u4, atmega32u4,
    atmega32u6, at90scr100, at90usb646, at90usb647,
    at94k, m3000.
avr51
    “Enhanced” devices with 128 KiB of program memory.
    mcu = atmega128, atmega1280, atmega1281,
    atmega1284p, atmega128rfa1, at90can128,
    at90usb1286, at90usb1287.
avr6
    “Enhanced” devices with 3-byte PC, i.e. with
    more than 128 KiB of program memory.
    mcu = atmega2560, atmega2561.
avrxmega2
    “XMEGA” devices with more than 8 KiB and up
    to 64 KiB of program memory.
    mcu = atxmega16a4, atxmega16d4, atxmega16x1,
    atxmega32a4, atxmega32d4, atxmega32x1.
avrxmega4
    “XMEGA” devices with more than 64 KiB and up
    to 128 KiB of program memory.
    mcu = atxmega64a3, atxmega64d3.
avrxmega5
    “XMEGA” devices with more than 64 KiB and up to
    128 KiB of program memory and more than 64 KiB
    of RAM.
    mcu = atxmega64a1, atxmega64a1u.
avrxmega6
    “XMEGA” devices with more than 128 KiB of
    program memory.
    mcu = atxmega128a3, atxmega128d3, atxmega192a3,
    atxmega192d3, atxmega256a3, atxmega256a3b,
    atxmega256a3bu, atxmega256d3.
avrxmega7
    “XMEGA” devices with more than 128 KiB of
    program memory and more than 64 KiB of RAM.
    mcu = atxmega128a1, atxmega128a1u.
avr1
    This ISA is implemented by the minimal AVR core
    and supported for assembler only.
    mcu = at90s1200, attiny11, attiny12, attiny15,
    attiny28.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
melon87
PostPosted: Apr 20, 2012 - 06:55 AM
Wannabe


Joined: Feb 21, 2012
Posts: 66


Hi SprinterSB,

Thanks for the information - so the atxmega128d4 is not supported in the latest version.

But as I mentioned, I believe I have updated the files with the information it requires i.e. I've included the header file which avr studio 5.1 uses and ammended the MCU supported list. But how do I compile these changes?
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Apr 20, 2012 - 09:22 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62219
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

I've included the header file which avr studio 5.1

Which may not be enough depending on what AVR-LibC functions you use:
Code:
C:\Program Files\Atmel\AVR Studio 5.1\extensions\Atmel\AVRGCC\3.3.1\AVRToolchain\avr\include\avr>grep -i atxmega128d4 *.
h
eeprom.h:#elif defined (__AVR_ATxmega128D4__)
io.h:#elif (defined __AVR_ATxmega128D4__)
iox128d4.h:#ifndef _AVR_ATXMEGA128D4_H_INCLUDED
iox128d4.h:#define _AVR_ATXMEGA128D4_H_INCLUDED
iox128d4.h:#endif /* #ifdef _AVR_ATXMEGA128D4_H_INCLUDED */
power.h:|| defined(__AVR_ATxmega128D4__)
sleep.h:|| defined(__AVR_ATxmega128D4__) \
wdt.h:|| defined(__AVR_ATxmega128D4__) \

So if you use EEPROM or power or Sleep or Watchdog then you need those amended too. But again that may not be sufficient. For example the EEPROM support one just tags the model number onto eerd_byte or whatever and that is a function that needs to exist in one of the system .a files - so you need that too. Also you need to link with the right crtXXXX.o so things like the stack and vector tables are initialised correctly.

As SprinterSB said elsewhere you can get round some of this by using the family name in -mmcu= rather than the actual model name.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
EW
PostPosted: Apr 20, 2012 - 03:34 PM
Raving lunatic


Joined: Mar 01, 2001
Posts: 4951
Location: Rocky Mountains

melon87 wrote:

I installed avr-gcc as part of WinAVR-20100110 on to my windows 7 64 bit machine.


You may have to download and install Atmel Studio 6 to get the latest support.

_________________
Eric Weddington
Marketing Manager
Open Source & Community
Atmel
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits