EmbDev.net

Forum: ARM programming with GCC/GNU tools region RAM is full - LPC2148 + WinARM


Author: Sobak Ava (Guest)
Posted on:

Rate this post
0 useful
not useful
Hi,

LPC2148 + WinARM

I've a very large array of unsigned shorts in my application. It has 
21900 elements which has the pixels of a photo that I want to show in 
LCD. (S65 - LS020)

To calculate the values of each pixel in 5-6-5 RGB format I made a PC 
application. It loads an image and converts it to C source file. It's 
simple but it works.

I want to use my unsigned short array in WinARM. My array looks like 
this:

unsigned short image[ 21913]={
0xFFB7, 0xFFB6, 0xFFB6, 0xF796, 0xF796, 0xF796, 0xF796, 0xF796, 0xF796, 
0xF796, 0xF775, 0xF775, 0xF775, 0xF775, 0xF775, 0xF775, 0xF775, 0xF775, 
0xF775, ....


};


but after adding this into source code I can't compile it anymore.

"region RAM is full"....

apperently compiler tries to allocate RAM for this array. Recently I 
used many other non-ARM7 CPUs and compilers and it is possible to place 
an array in program memory ( FLASH ROM) instead of RAM.

How can I let it run from Flash?

Regards

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Try with const unsigned short image... const should let the compiler 
mark the array as read only and place it in the ro-data input section. 
The usual linker-scripts let the linker place ro-data input-sections in 
a output-section located in flash-memory.

Author: Sobak Ava (Guest)
Posted on:

Rate this post
0 useful
not useful
yes, I tried const unsigned char  just after I post the topic. It worked 
fine. Now I can display any image I want after I convert it with my 
program.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.