Freaks,
A new hairy problem I've encountered in AVR-GCC.
Essentially, I'm trying to embed a file "InputEEData.bin" (raw binary) into the PROGMEM space of a custom application, so that I can read it out at runtime with the appropriate pgm_read_*() macros.
To do this, I'm following the avr-libc FAQ entry at http://www.nongnu.org/avr-libc/u... . So far so good, my makefile generates a nice InputEEData.o file from the input InputEEData.bin file with the appropriate renamed symbols:
InputEEData.o: InputEEData.bin $(MAKEFILE_LIST) avr-objcopy -I binary -O elf32-avr -B avr \ --rename-section .data=.progmem.data,contents,alloc,load,readonly,data \ --redefine-sym _binary_InputEEData_bin_start=InputEEData \ --redefine-sym _binary_InputEEData_bin_end=InputEEData_end \ --redefine-sym _binary_InputEEData_bin_size=InputEEData_size_sym \ InputEEData.bin InputEEData.o
Now the problem. When I compile my application for the atmega48, everything works. However, when I rebuild for some other AVRs such as the at90usb162, linking fails with the message:
ld.exe: avr architecture of input file `InputEEData.o' is incompatible with avr:35 output
Or something similar, replacing "avr:35" with "avr:{some number}".
If I change the "-B avr" parameter of avr-objcopy to "-B avr35" linking works, however I'm looking for a more general solution that will allow me to compile with any input MCU model.
Any ideas?
- Dean :twisted: