Memory questions

Hi I have R4 Minima and the spec says:

256 kB Flash Memory
32 kB SRAM
8 kB Data Memory (EEPROM)

The flash is for my Sketch, and the SRAM is for my variables, right? What's the EEPROM for?

My variables consist of about 10 INTs and this:
bool outputArray[3000][4];

When I compile it I get:

Global variables use 15992 bytes (48%) of dynamic memory, leaving 16776 bytes for local variables. Maximum is 32768 bytes.

So, I figure I should be able to increase my array to nearly 6,000 elements, but at 5,000 I get

c:/users/xxxx/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: section .stack_dummy VMA [20007b00,20007eff] overlaps section .heap VMA [20005dd0,20007dcf]
collect2.exe: error: ld returned 1 exit status

4,000 reports 19992 bytes (61%) of dynamic memory - what is going on here?

Thanks!

try to connect to the internet, and use search field of any search engine, even on this site appliable.

1 Like

It's for any data you want to preserve if you power the Arduino off and on again. I like to use it to save High Scores on little Arduino games.

Careful though, it has a limited number of write cycles so be sure your sketch isn't writing to the EEPROM on every pass of the main loop though, or it won't take long to get there.
https://docs.arduino.cc/tutorials/uno-r4-minima/eeprom/

the EEPROM has also a limit of 100,000 write cycles per single location, therefore avoiding rewriting the same value in any location will increase the EEPROM overall life.

source:
https://docs.arduino.cc/learn/programming/eeprom-guide/

1 Like

Thanks for the info. I don't need it for this project but might come in handy some time.

1 Like