ELF->COFF problem

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

I know this is not something new, and has been widely discussed in this forum. However, I could not find useful information to help in my problem, hope someone can provide some insight.

I am using WinAVR latest release (winavr20040424), and trying to compile / build the demo program using AVRStudio 3.53, together with the latest winavr-avrcoffbeta-install. Result:

Make all - ok
Make clean - ok

Make coff - error:
process_easy:DuplicateHandle(In) failed (e=6)
make: Interrupt/Exception caught (code=0xc0000005,addr=0x4163a4)

Make extcoff - error:
process_easy:DuplicateHandle(In) failed (e=6)
make: Interrupt/Exception caught (code=0xc0000005,addr=0x4163a4)

There is compilation error, and no coff file is generated.

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

Must be a Windows problem of some sort, or a Cygwin
(MinGW?) problem (supposedly a problem inside the »make«
utility).

Try building the COFF file manually. You can find
the required command-line options to avr-objcopy in
the Makefile. Sorry, there's quite a lot of options
needed for this, perhaps you might want to put them
into a .bat file, and run this one in order to create
the COFF file.

For reference, it's

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 \
infile outfile

(Long lines wrapped with backslashes -- don't do that
in a .bat file thoguh. ;-)

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

@Joseph
Run "make" from a command Window.

Upgrade to AVRStudio 4.07

admin's test signature
 

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

After running from the command line, it works.
I also realised I have made a silly mistake, and that is why it did not work.
I use "make coff", instead of "gcc.bat coff" in AVRStudio target setting, which the first gave the exception error, and the latter is working for me now.

Thanks.

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

Joerg/Peter,

Thanks for your advice, and I managed to get the COF file generated.
However, I have problem opening the COF file with AS3.53 (using make coff, and not make extcoff), it gives error "cannot open file".

I tried using AV4.07, which can open the same file (using make coff), and debug well under simulation mode. When I use ICE200, it cannot work (have seem from forum that AS4.07 will not work with ICE200), that is why I am sticking on AS3.53.

Does anyone know my problem to make COF file generated from winavr20040424 work with AS3.53?

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

Did you try to avr-strip -g all your libgcc.a files
that belong to the AVR subsystem? They can sometimes
cause to include some source file name into the COFF
file that cannot be found by AS3, and AS3 gets very
upset about even the slightest problem (while AS4 is
much more forgiving).

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

Hi Joerg,

It works wonder this time !
After using avr-strip, I am able to debug in AS3 now.
However, still got a small problem. In debug, I am not able to step into
sub routine functions. It always step over the function.

I have use avr-strip -g on all the 3 libgcc.a files in avr3, avr4 and avr5.
Is there something that I have miss out?

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

You've missed the libgcc.a that is not in any of the
avr[345] subdirs (it's for the architecture called avr2,
i. e. the AT90S series with <= 8 KB of flash ROM).

Anyway stepping into functions is supposed to work.
Of course, you cannot step into library functions
since the library has no debugging symbols -- but you'd
need the library source code installed otherwise anyway.