AVRStudio can't read .elf file

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

Hi All,

I just upgraded to the 4-20 release of WinAVR and AVRStudio 4.11, got my makefile fixed up, found some changes in the libraries I had to accommodate (including an error in the eeprom.h library that claims a whole bunch of AVR's are no longer supported because their EEPROM control registers moved, which is nonsense, as the references are symbolic) and got everything compiled.

I then created a new project based on the .elf/dwarf file and got the following error message from AVRStudio:

"Coordinator and error occurred while reading the object file. The file may be of wrong type or corrupted, or the object file reader is not up to date.

Error loading object file main.elf"

I suppose I've done something wrong, but of course I don't know what. I've set the makefile for dwarf-2 format and get compiler/linker output that is about what I'd expect.

Any ideas?

TIA,
Scott

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

Quote:

including an error in the eeprom.h library that claims a whole bunch of AVR's are no longer supported because their EEPROM control registers moved, which is nonsense, as the references are symbolic

The problem is, the functions you can call from the eeprom_X_Y() family of functions come pre-compiled when you obtain a binary distribution of avrlib-c. The sybmolic definitions of the EEPROM registers (brought in from ) are irrelavent to using the pre-compiled library functions -- they will still use the hard-coded, fixed addresses that were used at the time the library functions were compiled.

Since the majority of AVR parts use the older I/O locations, it makes sense that the library would be compiled to work with the majority of parts, even though it comes at the expense of making the library incompatible with the newer devices.

As you observed, the symbolic EEPROM register locations are correct in . So, you may re-compile the library from its source code, using the correct symbolic references. Or, you can write your own functions. But, you cannot use the library functions as-is.

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

I have a mega169 design running, using the eeprom functions that were in the 4/24/2003 release of WinAVR. I wonder how those routines managed to work if the register addresses are wrong.

How does one obtain and recompile avrlib?

This also doesn't explain my problem with AVRStudio recognizing the .elf file. Nothing I compile is recognized by AVRStudio.

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

ScottKroeger wrote:

How does one obtain and recompile avrlib?

Technically, it's called avr-libc. The term avrlib can be confused with this:
http://hubbard.engr.scu.edu/avr/...

You can get the full source code for avr-libc at the avr-libc project page on Savannah:
http://savannah.nongnu.org/proje...

Instructions can be found in the avr-libc user manual. The user manual is online at the avr-libc Home Page. You can get to the Home Page from the project page link above.