Posts: 1
Registered: ‎06-02-2009
Accepted Solution

NXP LPC2478 General Purpose SRAM allocation

I ran into a problem with my design and I hope you can help me. I used all of the 64K internal SRAM and wanted to know how I can use the Ethernet SRAM as general purpose SRAM. How might I initialize it for general purpose?

Avnet Employee
Posts: 7
Registered: ‎06-02-2009

Re: NXP LPC2478 General Purpose SRAM allocation

There’s nothing you really have to do, just use it


To specify buffers in that RAM area you can do something like this:

#define UART_BUFFER_BASE        0x7FE00000


/* RX and TX buffers. */

#define RX_BUFFER1        ((unsigned char *)(UART_BUFFER_BASE))

#define TX_BUFFER1         ((unsigned char *)(UART_BUFFER_BASE + 16))

#define RX_BUFFER2        ((unsigned char *)(UART_BUFFER_BASE + 32))

#define TX_BUFFER2         ((unsigned char *)(UART_BUFFER_BASE + 48))


This gives you 16 byte buffers.


Then to use it:

unsigned char RX_buffer1 = RX_BUFFER1; or just use RX_BUFFER1 as a passing parameter to any function requiring an pointer for an argument.


now you can use RX_buffer1[i] to access location I in RX buffer 1;