Need HowTo: Using COFF with AVR Studio 4.12

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

Yeah, I'm back. :?

I am using an ATmega1280 and my code size (with -Os) is now > 66 KBytes. Yes, the compile and link work fine, and I can download the code. What I can't do is debug.

The recommendation has been to use the COFF format instead of ELF/DWARF-2. I'm okay with that, but what I can't figure out is how to DO it. I'm generating the COFF data using a makefile generated by MFile (thank you, WinAVR!). Unfortunately, I have not found a way for AVR Studio 4.12 to USE that information to allow me to debug.

Second problem: According to Avarice (the OTHER possible solution: use gdb/Insight), the 1280 is not supported.

According to earlier posts, a solution to the 65 KByte debug limits with ELF/DWARF-2 might be available Real Soon Now (tm) -- Is there a beta version someone would be willing to let me try? (Yes, yes, I know: "It's a GNU problem, not an AVRStudio problem." *sigh*)

SOOOoo, where do I go from here? Am I at the bleeding edge, and I'm stuck paying for CodeVision or IAR? Is there SOME way to use the COFF data to debug my code?

And what about Naomi? (Ooops, sorry, got carried away. :wink: )

Thanks for any tips. In the meantime, I'm converting my code over to IAR. Yuck.

Stu Bell

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

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

You should be able to do the following:
1) Use MFile to open your previously-MFile-generated Makefile
2) Click Makefile->Debug format->AVR-ext-COFF (Don't use AVR-COFF; that format only works with AVR Studio 3.x)
3) Save changes.
4) make clean, then make all
5) Start AVR Studio
6) Click Open
7) Select the COF file that was generated by "make all".
8) Select a target platform
9) Start debugging.

That sequence of steps Works For Me(TM).

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

Yow! THAT was easy! Why isn't this in the manual somewhere?

Converting my code to IAR was beginning to look REAL ugly! :shock:

At any rate, many thanks!

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

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

> Is there a beta version someone would be willing to let me try?
> (Yes, yes, I know: "It's a GNU problem, not an AVRStudio problem."
> *sigh*)

It's actually both, as both sides have to agree on the debugging
format. The previous attempt of Eric Weddington to "just fix" the GCC
side failed miserably as AVR Studio simply wasn't prepared yet to
handle it...

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

> Converting my code to IAR was beginning to look REAL ugly!

You could abstract all compiler differences in a header file if you
want. If you need tips, ask me about specific things.

Ah well, not quite. IAR's _Pragma() implementation is quite inferior
(and buggy) to their #pragma, so you could not use it to encapsulate
turning off some individual warning in a header file. But everything
else (interrupt vector handling, flash ROM handling, EEPROM handling,
different intrinsic names) can be handled there. However, you have to
restrict yourself to the subset of functions and features implemented
in both libraries, obviously. I had to learn that certain things that
look quite natural to me (like vfprintf_P()) are missing in IAR's
library.

Jörg Wunsch

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