FatFs on xmega?

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am trying to use FatFs.

I edited the makefile for atxmega64a3

### Target device
DEVICE  = atxmega64a3
#DEVICE = atmega2560

That's the only line I edited.

I can compile for m2560 but not for my xmega.

avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


main.c :
avr-gcc -c -std=c99 -gdwarf-2 -mmcu=atmega2560 -Os -mcall-prologues -Wall -Wextra  -DF_CPU=8000000 -Wp,-MM,-MP,-MT,obj/main.o,-MF,obj/main.d main.c -o obj/main.
o

ff.c :
avr-gcc -c -std=c99 -gdwarf-2 -mmcu=atmega2560 -Os -mcall-prologues -Wall -Wextra  -DF_CPU=8000000 -Wp,-MM,-MP,-MT,obj/ff.o,-MF,obj/ff.d ff.c -o obj/ff.o

sdmm.c :
avr-gcc -c -std=c99 -gdwarf-2 -mmcu=atmega2560 -Os -mcall-prologues -Wall -Wextra  -DF_CPU=8000000 -Wp,-MM,-MP,-MT,obj/sdmm.o,-MF,obj/sdmm.d sdmm.c -o obj/sdmm.
o

Linking...
avr-gcc -std=c99 -gdwarf-2 -mmcu=atmega2560 -Os -mcall-prologues -Wall -Wextra  -DF_CPU=8000000 -Wp,-MM,-MP,-MT,obj/avrfp.o,-MF,obj/avrfp.d  obj/main.o obj/ff.o
 obj/sdmm.o -o obj/avrfp.elf

avr-objcopy -j .text -j .data -j .eeprom -j .fuse -O ihex obj/avrfp.elf obj/avrfp.hex

avr-objdump -h -S -C obj/avrfp.elf > obj/avrfp.lst

avr-nm -n obj/avrfp.elf > obj/avrfp.sym

avr-size -C --mcu=atmega2560 obj/avrfp.elf
AVR Memory Usage
----------------
Device: atmega2560

Program:   15646 bytes (6.0% Full)
(.text + .data + .bootloader)

Data:        637 bytes (7.8% Full)
(.data + .bss + .noinit)
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


main.c :
avr-gcc -c -std=c99 -gdwarf-2 -mmcu=atxmega64a3 -Os -mcall-prologues -Wall -Wextra  -DF_CPU=8000000 -Wp,-MM,-MP,-MT,obj/main.o,-MF,obj/main.d main.c -o obj/main
.o
main.c: In function 'main':
main.c:26: error: 'DDRB' undeclared (first use in this function)
main.c:26: error: (Each undeclared identifier is reported only once
main.c:26: error: for each function it appears in.)
main.c:26: error: invalid operands to binary | (have 'PORT_t' and 'int')
make: *** [obj/main.o] Error 1

What could I be doing wrong?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ooops. forgot about the PORTB thing in xmega. :oops:
fixed.

just replaced
DDRB >> PORTB.DIRSET
PORTB >> PORTB.OUT
PINB >> PORTB.IN

AVR Memory Usage
----------------
Device: atxmega64a3

Program:   16316 bytes (23.4% Full)
(.text + .data + .bootloader)

Data:        637 bytes (15.6% Full)
(.data + .bss + .noinit)
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does the Xmega really have SPCR/SPDR/SPSR for the SPI then? I would have thought you need to change the MMC code to use the Xmega equivalent of those too?

BTW as this is about Xmega I'll move it to that forum.