How to modify linker script

cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify linker script

Jump to solution
113 Views
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 Kudos
1 Solution
108 Views
ErichS
Senior Contributor III

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

View solution in original post

0 Kudos
3 Replies
73 Views
marco_palestro
Contributor II

Thanx everybody, problem solved!

96 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @marco_palestro 

Complementing the @ErichS 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

 

109 Views
ErichS
Senior Contributor III

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

View solution in original post

0 Kudos