Explain the linkscripts used in flexspi_nor_polling_tranfer example please?

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

Explain the linkscripts used in flexspi_nor_polling_tranfer example please?

跳至解决方案
2,968 次查看
ping1
Contributor V

Hello, Support

I understand it uses additional linkerscript files under this folder, but the file name is bss.ldt, data.ldt and main_text.ldt . while the automatic generated linker file is *.ld. What is the difference between them, how can they not in conflict with the managed ones please?

I am intended to create a small section of my own linker script which I can put some variables there in fixed  RAM address with NoInit attribute, but I am not sure how to do it, a simple example could help please.

Regards!

Ping

 

标记 (1)
0 项奖励
回复
1 解答
2,902 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Ping, 

Yes, that's correct. If you want to place something at a specific address then you can split the RAM as you mentioned before. Regarding the smallest unit that you can split the RAM, please see the image below. 

victorjimenez_0-1616795069288.png

Regards,
Victor 

在原帖中查看解决方案

0 项奖励
回复
7 回复数
2,953 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Ping, 

The following community document explains how to achieve this. 

Relocating Code and Data Using the MCUXpresso IDE

Also, in chapter 17 of MCUXpresso IDE User Guide, you'll find information on how to achieve this as well.

Regards,
Victor 

0 项奖励
回复
2,942 次查看
ping1
Contributor V

Thank you, Victor

If I need to add some variables at a fixed RAM address, will I need to add a .ldt file in Linkscript folder? Can i add all sections and memory information i need into 1 file?

Many posts suggests using link script is the only way to do this, and gives some scripts, but I don't really know where to put them and how to let it work with auto generated .ld files. 

Regards!

Ping

0 项奖励
回复
2,934 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Ping, 

If you want to place variables in a fixed RAM address, the best approach is to use the Macros. To see how this works, please refer to section 17.13.2 of the MCUXpresso User Guide. 

Regards,
Victor 

0 项奖励
回复
2,930 次查看
ping1
Contributor V

Hi, Victor

Thanks you for your support, I use Macro to put some variables in a specific RAM region, if more variables are used, probably need to divide up the RAM region into many small areas? what is the smallest unit a RAM can be divided to ?

Regards!

Ping

0 项奖励
回复
2,913 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Ping, 

There's no need to divide the RAM region into many small areas. You can put different variables into the same region of RAM without problems. 

Regards,
Victor

0 项奖励
回复
2,909 次查看
ping1
Contributor V

Hi, Victor

Thanks for reply!

If I put many variables into same RAM, the absolute address of these variables will be randomly arranged then I have no control over their addresses, is that right?

Regards!

Ping 

0 项奖励
回复
2,903 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Ping, 

Yes, that's correct. If you want to place something at a specific address then you can split the RAM as you mentioned before. Regarding the smallest unit that you can split the RAM, please see the image below. 

victorjimenez_0-1616795069288.png

Regards,
Victor 

0 项奖励
回复