Go Down

Topic: Help me Understand Memory Allocation (Analogous to PROGMEM) (Read 726 times) previous topic - next topic

tms8c8

Can I read/write data to flash in the Arduino DUE? Since the Due is a Von Neumann architecture, I find it hard to believe that this isn't supported in the IDE. I've seen some conflicting answers regarding this question, though. A couple of people said that it is not possible and a couple others have said that using "const" will automatically put the variable in the program memory.

I tried declaring a large array as a constant and the sketch size didn't increase. I would have expected that that the sketch size would increase.
e.g.
Code: [Select]
const byte Array[500] = {stuff}
should increase the "sketch size" by 500 bytes - but it doesn't. So does the compiler actually put these in ROM and the IDE just doesn't figure their size into the "sketch size" or ... ?

Thanks!

stimmer

Be sure to reference your array somewhere in your code - otherwise the linker will remove it.
Due VGA library - http://arduino.cc/forum/index.php/topic,150517.0.html

tms8c8


Be sure to reference your array somewhere in your code - otherwise the linker will remove it.


Ah! Ok - that's probably why my simple "test" didn't change the sketch size. I just included it as a declaration and never used it.

Thanks!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy