gccavratmelatmegaavr-studio4

Avrstudio 4.19 toolchain using gcc 4.7.x


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


Solution

  • 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.