Access to LPC1788 External SRAM with Linker Script

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

Access to LPC1788 External SRAM with Linker Script

717 次查看
Eugene723
Contributor II

I work with a board that has two 1MB SRAM (CY7C1051DV33) chips connected via CS0 (address: 0x8000 0000) and CS1 (address: 0x9000 0000). These memories are declared in settings:

Access to LPC1788 Extended SRAM with Linker Script (post in NXP forum) - illustration 1.png

Is this correct? Can external RAM be used this way:

uint8_t __attribute__ ((section("RW_RAM0"))) myLargeData[500000];

 

As opposite to:

#define LPC_STAT_CS0_BASE 0x80000000UL

volatile uint8_t *myLargeData = (uint8_t *) LPC_STAT_CS0_BASE;

 

The reason I want to avoid the latter way is that I have multiple variables so I would have to assign each one individually:

volatile uint32_t * myFirstInteger = (uint32_t *)( LPC_STAT_CS0_BASE + 500000 );

volatile uint32_t * mySecondInteger = (uint32_t *)( LPC_STAT_CS0_BASE + 500004 );

volatile uint32_t * myThirdInteger = (uint32_t *)( LPC_STAT_CS0_BASE + 500008 );

and so forth.

 

Thank you,

 

Eugene

0 项奖励
回复
1 回复

619 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport
0 项奖励
回复