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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
675 Views
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 Kudos
Reply
1 Solution
617 Views
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

 

View solution in original post

0 Kudos
Reply
4 Replies
654 Views
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 Kudos
Reply
639 Views
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 Kudos
Reply
618 Views
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 Kudos
Reply
611 Views
vwsncr
Contributor II
Thanks,
have worked
0 Kudos
Reply