How to modify linker script

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to modify linker script

跳至解决方案
2,041 次查看
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 解答
2,036 次查看
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 回复数
2,001 次查看
marco_palestro
Contributor II

Thanx everybody, problem solved!

2,024 次查看
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

 

2,037 次查看
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