Avrstudio 4.19工具链使用gcc 4.7.x。

时间:2021-09-09 20:15:37

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 ?

我正在使用makefile风格编译我的ATMEGA项目。作为Arduino IDE的遗产,develepment工具链主要针对gcc 4.3.2。Avrstudio 4.19 + Jtagice MKII CN + gcc 4.3.2 +做一些工作。但我的问题是,gcc 4.3.2是相当错误的。我发现,与优化非易失性变量相关的随机bug,注册缓存值并不总是被写入内存,而且错误的警告也很烦人。因此,使用gcc 4.7.0解决了问题,但是我不能将任何这样的程序加载到Avrstudio 4.19中,Avrstudio在加载hex时总是崩溃。有人尝试过使用这个工具链吗?

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

注意:我不想因为尺寸的增加而增加Avrstudio的版本,可能会带来新的问题。

Thanks

谢谢

2 个解决方案

#1


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.

Erasmus的答案可能适用于avr-gcc 4.7.x;但是我在AVR -gcc 4.8.1中发现AvrStudio4没有加载任何调试符号的Atmel AVR工具链的最新版本。

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.

我注意到,avr-gcc 4.8.1生成的ELF文件中缺少了.debug-pubnames部分,使用-gdwarf-2 -gstrict -gpubnames调试选项恢复了丢失的部分,然后允许AvrStudio4显示调试符号。

#2


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.

如果使用Atmel提供的最新的AVR -gcc工具链,那么AVR Studio 4在加载.elf文件时崩溃。为了解决这个问题,从avr-gcc到-gdwarf-2 -gstrict-dwarf的调试标志。然后你可以在AVR Studio 4下正常的加载和调试程序。

#1


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.

Erasmus的答案可能适用于avr-gcc 4.7.x;但是我在AVR -gcc 4.8.1中发现AvrStudio4没有加载任何调试符号的Atmel AVR工具链的最新版本。

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.

我注意到,avr-gcc 4.8.1生成的ELF文件中缺少了.debug-pubnames部分,使用-gdwarf-2 -gstrict -gpubnames调试选项恢复了丢失的部分,然后允许AvrStudio4显示调试符号。

#2


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.

如果使用Atmel提供的最新的AVR -gcc工具链,那么AVR Studio 4在加载.elf文件时崩溃。为了解决这个问题,从avr-gcc到-gdwarf-2 -gstrict-dwarf的调试标志。然后你可以在AVR Studio 4下正常的加载和调试程序。