Avrstudio 4.19 toolchain using gcc 4.7.x

纵饮孤独 提交于 2019-12-11 10:27:16

问题


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


回答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.




回答2:


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.



来源:https://stackoverflow.com/questions/21791440/avrstudio-4-19-toolchain-using-gcc-4-7-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!