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
已解决! 转到解答。
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
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
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