AVR-Programming icon indicating copy to clipboard operation
AVR-Programming copied to clipboard

Makefile not working xmega

Open JosiahCochran opened this issue 7 years ago • 1 comments

I am trying to program the xmega128a1u with blink code. I made the changes form DDRB to PORTB.DIRSET and so on, but the makefile is having an error in compiling the code.

avr-gcc -Os -g -std=gnu99 -Wall -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -DF_CPU=8000000UL -DBAUD=9600UL -I. -I../../xmegalibrary -mmcu=atxmega128a1u -c -o blinkLED.o blinkLED.c :0:6: error: expected identifier or ‘(’ before numeric constant : recipe for target 'blinkLED.o' failed make: *** [blinkLED.o] Error 1

JosiahCochran avatar Jul 17 '17 20:07 JosiahCochran

The XMegas are an entirely different chip, with (as you noted) a completely different set of register macros and etc. If you're going to be porting any of my Mega code to the XMega chips, just know up front that it's going to be a big challenge, and that some decent prior low-level experience with at least one, and probably both of the chips is needed -- or else you'll acquire it along the way, the hard way. :)

Still, that looks like a deeper error. What's in line 6 of blinkLED.c? Did you accidentally create a name collision with a macro that's defined in the XMega headers? Unfortunately, without having all the code at hand, it's a very tough remote debug.

hexagon5un avatar Jul 21 '17 20:07 hexagon5un