How to define variables to SRAM or SDRAM with certain modifications?

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

How to define variables to SRAM or SDRAM with certain modifications?

跳至解决方案
1,018 次查看
vwsncr
Contributor II

Hello,

    Now , i'm using the imxrt1052 with SDRAM. All variables are in the SDRAM. But i want some variables in SRAM, and others in SDRAM. How to do ? 

    Thanks.

0 项奖励
回复
1 解答
960 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @vwsncr ,

First of all, please read RT1052 reference manual, chapter 3 is about it. RT1052 has internal RAM include ITCM, DTCM and OCRAM. Most of the examples in SDK use internal RAM. To define variables to internal SRAM or SDRAM, you must define like this 

#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var

Please see fsl_common_arm.h for detail.

Sometimes you also have to modify the link file. To change memory map, it's in MCUXpresso IDE ->right click project name ->properites->MCU settings. To change link file, it's in MCUXpresso IDE ->right click project name ->properites->Settings->Managed linker script.

 

Regards,

Jing

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
997 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @vwsncr ,

RT1052 SEMC support SRAM and SDRAM simultaneously. Their /CS is standalone. And their control registers are different.

 

Regards,

Jing

0 项奖励
回复
982 次查看
vwsncr
Contributor II

Thanks for reply ,

    Sorry for my poor english. The SRAM that i want to say is the MCU's SRAM not external SRAM , and the SDRAM is external SRAM. Now both are on my board ,  but i only can used the external SRAM. I don't know how to used the MCU's SRAM.  In "MCU settings" page and datasheet, i can see the RAM named "SRAM_DTC","SRAM_ITC","SRAM_OC".

0 项奖励
回复
961 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @vwsncr ,

First of all, please read RT1052 reference manual, chapter 3 is about it. RT1052 has internal RAM include ITCM, DTCM and OCRAM. Most of the examples in SDK use internal RAM. To define variables to internal SRAM or SDRAM, you must define like this 

#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var

Please see fsl_common_arm.h for detail.

Sometimes you also have to modify the link file. To change memory map, it's in MCUXpresso IDE ->right click project name ->properites->MCU settings. To change link file, it's in MCUXpresso IDE ->right click project name ->properites->Settings->Managed linker script.

 

Regards,

Jing

 

0 项奖励
回复
954 次查看
vwsncr
Contributor II
Thanks,
have worked
0 项奖励
回复