avrlib on ubuntu -- invalid bfd target error

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

hi all...

i have problem of using avrlib on my ubuntu (gutsy) machine..
before i use avrlib on windows machine and it works fine (i use default avrlib).

now i'm using ubuntu gutsy by using avr-gcc and lib and i migrate my avrlib library...

the problem is.. with my default makefile rule (avrproj_make) i can't compile my program and got error : invalid bfd target

how do i fix this problem???

this is the error..

Quote:
avr-gcc -c -g -Os -Wall -Wstrict-prototypes -I/usr/avr/lib/AVRlib -Wa,-ahlms=contohm8.lst -mmcu=atmega8 -I. contohm8.c -o contohm8.o
In file included from contohm8.c:3:
/usr/lib/gcc/avr/4.2.1/../../../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use ."
contohm8.c:7: warning: function declaration isn’t a prototype
avr-gcc contohm8.o -Wl,-Map=contohm8.map,--cref -mmcu=atmega8 -o contohm8.elf
avr-objcopy --debugging -O coff-ext-avr \
--change-section-address .data-0x800000 \
--change-section-address .bss-0x800000 \
--change-section-address .noinit-0x800000 \
--change-section-address .eeprom-0x810000 \
contohm8.elf contohm8.cof
avr-objcopy: contohm8.cof: Invalid bfd target
avr-objcopy: --change-section-vma .eeprom+0xff7f0000 never used
avr-objcopy: --change-section-lma .eeprom+0xff7f0000 never used
avr-objcopy: --change-section-vma .noinit+0xff800000 never used
avr-objcopy: --change-section-lma .noinit+0xff800000 never used
avr-objcopy: --change-section-vma .bss+0xff800000 never used
avr-objcopy: --change-section-lma .bss+0xff800000 never used
avr-objcopy: --change-section-vma .data+0xff800000 never used
avr-objcopy: --change-section-lma .data+0xff800000 never used
make: *** [contohm8.cof] Error 1

my tools are:

Quote:
$avr-objcopy -V

GNU objcopy 2.17
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.

$ avr-gcc -v

Using built-in specs.
Target: avr
Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --disable-libssp --build=i486-linux-gnu --host=i486-linux-gnu --target=avr
Thread model: single
gcc version 4.2.1

i hope anyone can help me..

thankyou..

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

Quote:
how do i fix this problem???
By pressing the '?' key only once. It is known very well that using multiple punctuation marks in a row doesn't fix a problem faster, but is a sure sigh of not providing enough input information.

Why are you trying to build a coff object?
And where did you get your AVR toolchain installation from?
Where did you get the makefile from? And how does it look like?
What target are you actually trying to build?

So let's do the Windows approach of problem-fixing without knowing what the real problem is: (re)install. Go to the sticky at the top of this forum and rebuild your toolchain http://www.avrfreaks.net/index.p...

Then go to http://www.sax.de/~joerg/mfile/ download mfile, and generate and configure a new Makefile.

And then start fixing the warnings in your code.

Stealing Proteus doesn't make you an engineer.

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

Two issues here:

Pascal Stang's AVRlib hasn't been updated for years, it seems,
so it prefers to build file formats that have long since been
considered obsolete (namely, AVR-COFF here).

Second is, the Ubuntu AVR toolchain maintainers aren't doing a
very exciting job (to put it mildly), they appear to just compile
the GNU standard toolchain without any patches. That leaves a
number of gimmicks out the users of WinAVR, the FreeBSD ports, or
Bingo600's Linux build script can enjoy -- among them, the patch
for AVR-COFF (which is still around there and will remain, as long
as there are any users of VMlab around).

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

ArnoldB wrote:

Why are you trying to build a coff object?
And where did you get your AVR toolchain installation from?
Where did you get the makefile from? And how does it look like?
What target are you actually trying to build?

i want to produce the hex file.. actually i'm not sure why i need the coff object.. since i just use the default make file that a got along with AVRlib (i got it from this site).

i got my toolchain installation from ubuntu repository, i use the binary package..

as i said before.. i want to produce the hex file, so i can burn it to may uC..

i have tried your solution but it didn't work for me..

i hope u could give me a clearer solution..

thanx..

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

> i have tried your solution but it didn't work for me..

I have read your sentence but it didn't work for me.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Here's a quickfix.

Edit /make/avrproj_make and do the following:

1. Remove $(TRG).cof from the 'all:' line

2. Remove the following line out of Block 9

%.cof: %.elf
        $(BIN) --debugging -O coff-ext-avr \
                --change-section-address   .data-0x800000 \
                --change-section-address    .bss-0x800000 \
                --change-section-address .noinit-0x800000 \
                --change-section-address .eeprom-0x810000 \
                $< $@

3. Remove $(TRG).cof out of the clean section.

- plasma

My Blog: http://nathanmanzi.com

Proverb: "He who strikes the first blow admits he's lost the argument."