News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Feeding linker script to LD, Sourcery G++ toolchain, Cortex-M3 target

Started by pkrcel, November 11, 2008, 10:56:20 AM

Previous topic - Next topic

pkrcel

Hi there,
I am migrating a simple project for my cortex-M3 target to C::B from Raisonance's RIDE.

So far I have been successful, but for one thign, I do not know how to feed the linker with a custom linker script.
By all means it is no custom but the standard linker script for ST Microelectronics STM32F10x ARM-Cortex-M3 devices.

I think I could do it with the "other options" tab under compiler/linker settings, and feed the linker with -T<scriptfile> (or better -WL,.T<scriptfile>, but I am somewhat confident there are other methods, since I may use two different scripts, and I would like not to use several build targets, and I am not all *that* keen on using C::B yet.

(To those who may wonder, my app is a very simple demo so basically all the code can reside in the taregt SRAM, since it's way less that 0x5000 in size).

Cheers
-Andy

EDIT: to many typos

thomas

If you don't want separate build targets, all that's left is using a global compiler variable for the script file's name. Look at the Wiki for a description of them.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

pkrcel

Thanks a lot Thomas, I actually tried both ways and I defined LDSCRIPT gloabl variable, feeding -T$(LDSCRIPT) to the linker, this works clean&fast.

Althou, I have to reconsider using build targets...cause I have the ffeling It will be a bit more straightforward when I'll have to handle different board configurations.

Thanks again for your help

Cheers
-Andy

thomas

"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

pkrcel

 :D

Hehe, at least I've figured it out..I guess chances I get a bit more used to C::B are fairly high.  :wink: