Topic: STM32 DFU - Using DFU startup and script file, but it can't link!

Hi.
I've made a couple of projects using DFU, and they compiled without problems.
But with this new project I keep getting this error when I compile, and I can't find the problem.

Running: LD
"C:\Program Files (x86)\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe" -mcpu=cortex-m3 -mthumb -Wl,-T -Xlinker "out\QuickStart_STM32F103.elf.ld" -u _start -Wl,-static -Wl,--gc-sections -nostartfiles -Wl,-Map -Xlinker "lst\QuickStart_STM32F103.map"   
c:/program files (x86)/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/bin/ld.exe: DISCARD has both ordered [`.ARM.exidx' in c:/program files (x86)/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/thumb2\libgcc.a(_divdi3.o)] and unordered [`.v4_bx' in c:/program files (x86)/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/thumb2\libgcc.a(_clz.o)] sections 
c:/program files (x86)/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm-none-eabi/bin/ld.exe: final link failed: Bad value 
collect2: ld returned 1 exit status

Does any of you know what causes the linker to give me this error?

Best Regards
Thomas Jespersen

Last edited by tkj (2010-03-28 11:22:29)

Re: STM32 DFU - Using DFU startup and script file, but it can't link!

Hi

It is hard to say why you have this error message.
You might also try codesourcery side for more information on this ld.exe linker error
message.

At least it would be intersting how the error message appeared.
From the name of the project it seems you have started from an example.
Which modifications lead to this error message.
Also:
- Do you use default linker script?
- Do you use default start up file?
- Which libraries (from Ride7 options) do you use in your project?

Regards
Matloub

Re: STM32 DFU - Using DFU startup and script file, but it can't link!

Hi.
I always use the example to start with, as I find it easier to start with that than creating the project from scratch!
As said, I'm using the DFU linker file (where the adress of different things are moved).
I'm also using the DFU startup file, provided in ST's DFU example!

Thomas