Go Down

Topic: Help me Understand Memory Allocation (Analogous to PROGMEM) (Read 697 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