GCC Tools for AVR Studio Software

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

http://www.atmel.com/dyn/general/tech_doc.asp?doc_id=9772
seems to be interesting esp. for debugging/simulation

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

And I'm sure the next WinAVR release will have support for DWARF debugging for AVR Studio's new feature.

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

See also the article on the main page of this site.

Well I just downloaded the latest AVRStudio and this AVR-GCC add-on.
It is basically a avr-gcc 3.4.0 with binutils 2.14 and avr-libc 1.0.3, but without any of these goodies like pn, unixtools for window programmer, except make.

But you can still use the \utils\bin directory from WinAVR.

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

The next WinAVR should have

    - Binutils 2.15 with COFF patch
    - GCC 3.4.0 or 3.4.1: The GCC folks should be making an RC of 3.4.1 within the next few days, so I would expect a release soon.
    - avr-libc 1.0.4
    - GDB/Insight 6.1
    - and whatever the latest releases are of the other tools.

I do know that PN is expecting a release soon as well.

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

pfleury wrote:

Well I just downloaded the latest AVRStudio and this AVR-GCC add-on.
It is basically a avr-gcc 3.4.0 with binutils 2.14 and avr-libc 1.0.3, but without any of these goodies like pn, unixtools for window programmer, except make.

Avr-gcc is only an additional toolset here ( as at least 3.4.0 is required ). The main thing is an elf/dwarf parser. I've just tried :
- works fine with a simple, one file example;
- fails with a multifile project ( which plays OK with elf-coff conversion );
- Atmel's avr-gcc is a Cygwin version ; I've also tried to use minGW 3.4.0,
but parser cannot read paths correctly then ( probably Cygwin's style of
path - cygdrive/c/... is converted into Win c:/... and we have a wrong result
if a Win style is already used on input ).

BTW - I probably make a mistake somewhere :
my minGW avr-gcc 3.4.0 called with -gdwarf-2 option reports an error.
However - configured with --with-dwarf2 seems to work OK - but
then I have dwarf-2 format as default, and elf-coff converter fails.
Is there any switch to enable/disable dwarf-2 ? - I cannot find :-(

Best regards
Jurek Szczesiul

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

JerzySzczesiul wrote:

- works fine with a simple, one file example;
- fails with a multifile project ( which plays OK with elf-coff conversion );

I had no problems debugging multi file projects

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

pfleury wrote:

I had no problems debugging multi file projects

With my test example AvrStudio set a start point not on
main() but somewhere in a signal handler (??).
I've taken an unfortunate example :-).
However - this is a beta version and will be quickly
improved.

Best regards
Jurek Szczesiul

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

WinAVR is the way to go. It becomes a good tool over the years, and simple to use too. Atmel seems to try a gcc compiler aproach but it is at a very beggining, the compiler has NO INTEGRATION with the IDE!

The only thing I miss in WinAVR is a way to debug (with gdb/Insight) through the standard SPI ISP port (with parallel port PC dongle).

Any help on this?

EW wrote:
The next WinAVR should have
    - Binutils 2.15 with COFF patch
    - GCC 3.4.0 or 3.4.1: The GCC folks should be making an RC of 3.4.1 within the next few days, so I would expect a release soon.
    - avr-libc 1.0.4
    - GDB/Insight 6.1
    - and whatever the latest releases are of the other tools.

I do know that PN is expecting a release soon as well.

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

Thank you for your comments on the gcc tools package.

I would like to make clear that the package is just a temporary solution until the WinAVR distribution includes a gcc capable of outputting dwarf debug information.
Once that happens we will cease distributing this package.

The issue with minGW will probably be resolved quite soon.

Regards,

Torleif Sandnes
Atmel AVR Software Team.

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

JerzySzczesiul wrote:

BTW - I probably make a mistake somewhere :
my minGW avr-gcc 3.4.0 called with -gdwarf-2 option reports an error.
However - configured with --with-dwarf2 seems to work OK - but
then I have dwarf-2 format as default, and elf-coff converter fails.
Is there any switch to enable/disable dwarf-2 ? - I cannot find :-(

Hi Jerzy!

From what I understand from Joerg is when the toolset is configured with --with-dwarf2 it defaults to outputting DWARF. The ELF->COFF converter in avr-objcopy requires the stabs format to convert to COFF. There should be a GCC compiler switch to have it emit stabs instead of DWARF. I haven't had a chance yet to look it up (you guys are ahead of me! :) ), but I remember that there is a switch to do this. Let me know how you get on.

Eric

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

raimond712002 wrote:
The only thing I miss in WinAVR is a way to debug (with gdb/Insight) through the standard SPI ISP port (with parallel port PC dongle).

Any help on this?

Well, only if it's already in one of the tools (and I don't think that it is). Or if there's a volunteer willing and able to put a feature in. Note that I'm no expert in any of the debugging tools. I do know that there's avarice which comes with WinAVR that allows you to use Atmel's JTAG ICE to debug with GDB / Insight.

Eric

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

torleifs wrote:
I would like to make clear that the package is just a temporary solution until the WinAVR distribution includes a gcc capable of outputting dwarf debug information.
Once that happens we will cease distributing this package.

The issue with minGW will probably be resolved quite soon.

So far it looks like early July is targetted for the next WinAVR. But this can change.....

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

JerzySzczesiul wrote:

BTW - I probably make a mistake somewhere :
my minGW avr-gcc 3.4.0 called with -gdwarf-2 option reports an error.

However - configured with --with-dwarf2 seems to work OK

What error did it report?

Could other people try this method as well? It will help in determining how the next WinAVR will be built.

Take your 20040404 release, and use the compiler flag -gdwarf-2 in both compiling and linking. If you are using the WinAVR sample makefile then replace the line (at about line 85):

CFLAGS = -g

with

CFLAGS = -gdwarf-2

and let me know if this works with the new AVR Studio component.

Thanks!
Eric

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

EW wrote:

From what I understand from Joerg is when the toolset is configured with --with-dwarf2 it defaults to outputting DWARF. The ELF->COFF converter in avr-objcopy requires the stabs format to convert to COFF. There should be a GCC compiler switch to have it emit stabs instead of DWARF. I haven't had a chance yet to look it up (you guys are ahead of me! :) ), but I remember that there is a switch to do this. Let me know how you get on.
Eric

Eric, thanks a lot !
If avr-gcc is configured to dwarf-2 as default ( --with-dwarf2 ),
a -gstabs compiler option can be used to restore stabs format, required
for elfcoff conversion.

Here's a little summary of my tests :

1. I've built two versions of minGW32 avr-gcc-3.4.0 :
A - stabs debug format as default
B - dwarf-2 debug format as default
( --with-dwarf2 configure option ).

2. Version A with -g option is used as usual :
patched avr-objcopy creates a cof file, which
is loaded into AvrStudio 4.09 - OK.

3. Version B with -gstabs option is used in the same way :
patched avr-objcopy creates a cof file, which
is loaded into AvrStudio 4.09 - seems to be OK.

4. Version A with -gdwarf-2 option :
_should_ work but doesn't want to - returns
an error message : 'target system does not
support the "dwarf-2" debug format '
( ?? - Atmel's Cygwin avr-gcc-3.4.0 has no such
a problem of course ).

5. Version B with -g option :
elf file is readable for AvrStudio 4.09 new parser,
but that's all for today - according to paths issue
( mentioned earlier ).

Best regards
Jurek Szczesiul

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

Hi Torleif,

Is it possible to debug C++ code now using DWARF files?

If not, will it be in the future?

Regards

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

C++ support is limited in this beta release.
It should be possible to debug basic c++ constructs and view classes in the watch-view,
but this has not been tested thoroughly.

C++ support will probably be more complete and stable in later versions.

Torleif Sandnes
Atmel AVR Software Team