Topic : Constant tables were copied on stack

Forum : ARM

Original Post
Post Information Post
March 10, 2011 - 7:29am
Guest

Hi,
as in the topic: watching code I've noticed that table data, declared in function as:

const uint8_t DataTable[] = {xx, xx, xx...};

in runtime is copied from the flash to the stack. This results in a reduction of available RAM.
I'm sure, that in earlier compiler versions, constant tables were readed directly from flash.
What I'm doing wrong? Is there any compiler option setting, I've omnited?
Compiler version is:
Ride7: 7.30.10.0159
RKit-ARM: 1.30.10.0356
Ride7 Patch: 7.30.10.0169
Thanks in advance for any help.

Cezary

Replies
Post Information Post
+1
0
-1
March 10, 2011 - 9:21am
Raisonance Support Team

Hi,

You can either declare the array as static, or define it as global (outside from any function).

Best Regards,

+1
0
-1
March 10, 2011 - 10:30am
Guest

Great!
It helps!
Thank you, Bruno

Life is full of surprises... ;)