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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
1,016件の閲覧回数
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 解決策
958件の閲覧回数
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 返答(返信)
995件の閲覧回数
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 件の賞賛
返信
980件の閲覧回数
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 件の賞賛
返信
959件の閲覧回数
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 件の賞賛
返信
952件の閲覧回数
vwsncr
Contributor II
Thanks,
have worked
0 件の賞賛
返信