Xmega 16E5 - compilation problem.

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

Hello colleagues.

 

I came across following compilation error (linker error) during compilation of simple Xmega16E5 project:

 

make all 
'Building target: SpectrumDFT.elf'
'Invoking: AVR C Linker'
avr-gcc -Wl,-Map,SpectrumDFT.map -mmcu=atxmega32e5 -o "SpectrumDFT.elf"  ./SSD1309/ssd1309.o  ./FONTS/fonts.o  ./main.o   
c:/program files/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fp_powsodd.o):/data2/home/toolsbuild/jenkins-knuth/workspace/avr8-gnu-toolchain/src/avr-libc/libm/fplib/fp_powsodd.S:59:(.text.avr-libc.fplib+0x10): relocation truncated to fit: R_AVR_13_PCREL against symbol `__mulsf3' defined in .text section in c:/program files/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mul_sf.o)
c:/program files/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fp_powsodd.o):/data2/home/toolsbuild/jenkins-knuth/workspace/avr8-gnu-toolchain/src/avr-libc/libm/fplib/fp_powsodd.S:69:(.text.avr-libc.fplib+0x20): relocation truncated to fit: R_AVR_13_PCREL against symbol `__mulsf3' defined in .text section in c:/program files/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mul_sf.o)
collect2.exe: error: ld returned 1 exit status
make: *** [SpectrumDFT.elf] Błąd 1

 

It seems to be correlated with cos (cosinus) function used as follows:

 

for(uint8_t i=0; i<100; ++i) Twiddle[i] = (int16_t) ((1 << 6)*cos(i*PI2/100));

 

Could anybody help? robiw

This topic has a solution.
Last Edited: Sun. Dec 22, 2019 - 10:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your avr-libc is old, bug #33698 has been fixed in 2015.
.
Apart from that your compiler is misconfigured: it should be configured with --with-avrlibc=yes which is obviously not the case. That option is the default in v4.8 and newer, but it must be set for 4.7.2 in conjunction with avr-libc. See GCC PR54461 and GCC 4.7 Release Notes.
.
You can remove that function from libgcc.a with the help of Binutils, same for any other float function.

avrfreaks does not support Opera. Profile inactive.

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

Hi,

Thank you for your fast and accurate answer. I use Eclipse with AVR plugin so I should install newer toolchain. Where should I search for this toolchain? robiw

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

Just get toolchain for Windows from microchip.com

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

Funny. But there is no installer file...robiw

Last Edited: Sat. Dec 21, 2019 - 01:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used the toolchain from the new Atmel Studio 7 and the problems disappeared. It is a pity that it is not available as stand-alone software... robiw

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

...but what is strange and uncomfortable the compilation lasts very long. Why? robiw

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

A low quality Windows 10 update?

Slow compiling - win10 update issue maybe? | AVR Freaks

 

"Dare to be naïve." - Buckminster Fuller

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I updated Windows (1909) and add Atmel folder to exclusions. Now, compilation is very fast. Thank you for the support...robiw