Access to LPC1788 External SRAM with Linker Script

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

Access to LPC1788 External SRAM with Linker Script

573 Views
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 Kudos
Reply
1 Reply

475 Views
Alice_Yang
NXP TechSupport
NXP TechSupport
0 Kudos
Reply