Demo using extra 16K SRAM banks on LPC1768 for C object storage
On-chip LPC1768 SRAM includes:
32 kB of SRAM on the CPU with local code/data bus for high-performance CPU access. Used by compiler for all variables and objects by default.
Two 16 kB SRAM blocks with separate access paths for higher throughput. These SRAM blocks may be used for Ethernet, USB, and DMA memory, as well as for general purpose CPU instruction and data storage. Using any of the SRAM in these banks requires a compiler directive in the object's declaration in the C++ source code.
int buffer_SRAM; //regular SRAM use by compiler int buffer_SRAM_Bank0 __attribute__((section("AHBSRAM0"))); //put in extra 16K bank int buffer_SRAM_Bank1 __attribute__((section("AHBSRAM1"))); //put in other extra 16K bank
Some Ethernet code uses one of the banks to buffer network packets.