Error: Object too large to fit in SRAM

Question: When project is built, error similar to following is generated whenever I have array declaration which needs more than 256 bytes. Why?

 

Answer:

You must be getting an error similar to this:

!E D:\data\CYPRESS\work\SAMPLE~1\SAD355~1\SAMPLE~1\SAMPLE~1\main.c(10): Object too large to fit in SRAM: 'TEST' requested size: 1000 bytes

In PSoC, RAM page size is 256 bytes. The compiler tries to put the array in a single page. So, you cannot have an array which needs bytes more than 256. For example int type array can have maximum length of 128. A char type array can have maximum length of 256. If larger array is needed, please break array in multiples ensuring that each needs memory locations less than 256.