1

I'm using makefile style compiling of my ATMEGA projects. As legacy of Arduino IDE, develepment toolchain is mostly aimed to gcc 4.3.2. Avrstudio 4.19 + Jtagice MKII CN + gcc 4.3.2 + make works somehow. But my problem is that gcc 4.3.2 is rather buggy. I see e.g. random bugs related to optimization of non-volatile variables, register cached values are not always written back to memory and also wrong warning are annoying. Hence using gcc 4.7.0 solves problem but I cannot load any such a program into Avrstudio 4.19, Avrstudio always crashes when loading hex. Does anybody tried and suceeded with this toolchain ?

Note: I don't want go to higher Avrstudio version because size grows and probably brings new problems.

Thanks

TMa
  • 723
  • 1
  • 5
  • 14

2 Answers2

1

If one uses the latest avr-gcc toolchain available from Atmel, then AVR Studio 4 crashes when trying to load the .elf file. To fix this change the debug flags from avr-gcc to -gdwarf-2 -gstrict-dwarf. Then one can load and debug programs under AVR Studio 4 as normal.

Narkha
  • 1,197
  • 2
  • 12
  • 30
A Erasmus
  • 11
  • 1
  • Hmm, but gdwarf flags do not help at all. The AvrStudio keep crashing when Start debugging is executed. Might be related to JTAG programmer (I'm using chineese clone JTAGICE mkII-CN)? I can't prove it because when disconnected dialog box appears, i.e. I cannot tell at which particular phase it crashes. I don't know also what data are passed to JTAGICE. – TMa Mar 23 '14 at 18:43
1

The A Erasmus answer may have worked for avr-gcc 4.7.x; but I found in avr-gcc 4.8.1 provided by recent versions of the Atmel AVR Toolchain that AvrStudio4 didn't load any debugging symbols.

I noticed that the .debug-pubnames section was missing from the ELF file generated by avr-gcc 4.8.1 and that using the -gdwarf-2 -gstrict-dwarf -gpubnames debug options reinstated the missing section which then allowed AvrStudio4 to show debugging symbols.

Community
  • 1
  • 1