I'm trying to create an array in Arduino Due and when the array exceeds the size of 32768 integer elements the compiler (Atmel Studio) complains.
I read that Arduino Due SRAM size is 96K in 2 banks. 64Kb and 32Kb.
Anyone knows any details?
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It only takes a minute to sign up.
Sign up to join this communitySize of int in arduino due is 4Bytes. If you're trying to create array of 32768 integers, it means you need 128kB of free space.
I've read in several places that e.g. PROGMEM const int foo[] = { 1, 2, 3, ... } would work, but was unable to do it in my environment ( debian, arduino-mk package ). I had a number of arrays I needed to commit to flash to conserve sram. This worked fine for all variables, but not for arrays. Try that... What say the wizards?
Note to moderators and others: I know I am not answering the question definitively, but it is relevant to OP's question.
PROGMEM
- just make them const
.