How to modify linker script

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to modify linker script

ソリューションへジャンプ
3,892件の閲覧回数
marco_palestro
Contributor II

Hi,
I need to allocate some code and data on specific flash addresses in my MCUXpresso project (using Kinetis K32), but I couldn't find the documentation about the linker script definition and the toolchain;

Can anybody explain which is the linker script syntax and #pragma required to customize code and data segments, or point to the relevant documentation?

Thanx in advance!

Marco

0 件の賞賛
返信
1 解決策
3,887件の閲覧回数
ErichStyger
Specialist I

Hi @marco_palestro ,

The linker is the GNU linker, and you can find documentation for example here: https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html 

To place objects at specific locations you can use something like this:

unsigned char __attribute__((section (".myBufSection"))) buf[128];

See https://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/  for some examples.

I hope this helps,

Erich

元の投稿で解決策を見る

3 返答(返信)
3,852件の閲覧回数
marco_palestro
Contributor II

Thanx everybody, problem solved!

3,875件の閲覧回数
diego_charles
NXP TechSupport
NXP TechSupport

Hi @marco_palestro 

Complementing the @ErichStyger help! you can additionally check this post from the community  that recommends MCUxpresso documentation and examples .

Relocating Code and Data Using the MCUXpresso IDE

If you have any issues, please let us know.

Diego

 

3,888件の閲覧回数
ErichStyger
Specialist I

Hi @marco_palestro ,

The linker is the GNU linker, and you can find documentation for example here: https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html 

To place objects at specific locations you can use something like this:

unsigned char __attribute__((section (".myBufSection"))) buf[128];

See https://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/  for some examples.

I hope this helps,

Erich