Hello there,
Here is an incredibly dumb question by a total noob.
static const byte newByteArray[800000] = {
0,0,0,0,0,0,0,0,0,0,
etc...
etc...
0,0,0,0,0,0,0,0,0,0
};
void setup() {}
void loop() {}
I have a very large array I need to statically define (hardcode about 800kbytes).
No, the array cannot be dynamically generated by code (it's a mapping table with unique values).
The table must be loaded in user SRAM.
This array must occupy almost the entire RAM of the GIGA R1 (1 Mbyte of RAM: 192 Kbytes of TCM RAM (inc. 64 Kbytes of ITCM RAM + 128 Kbytes of DTCM RAM for time critical routines), 864 Kbytes of user SRAM, and 4 Kbytes of SRAM in Backup domain)
When I build the above masterpiece example, this is what I get:
Sketch uses 110680 bytes (5%) of program storage space. Maximum is 1966080 bytes.
Global variables use 47520 bytes (9%) of dynamic memory, leaving 476104 bytes for local variables. Maximum is 523624 bytes.
I would expect that the sketch use about 800k flash as well as about 800k dynamic memory.
And then, also, what truly throws me off, is this:
Maximum is 523624 bytes
I'm surely doing two mistakes, first, why is the storage/dynamic memory so low, and secondly, why is Arduino IDE reporting only 523624 bytes max, when it should be at least about 850k.
Thank you for reading my wonders. Any insight is highly appreciated.
Cheers!
Valentine