I have a Teensy 4.1 and added an 8 MB PSRAM chip and it passed the memory test.
In my sketch, I am using the PSRAM memory to save a String array:
This compiles fine with the following memory usage:
-----------------------------------------------------------------------------------------------
Memory Usage on Teensy 4.1:
FLASH: code:180352, data:23500, headers:9136 free for files:7913476
RAM1: variables:30976, code:177076, padding:19532 free for local variables:296704
RAM2: variables:79488 free for malloc/new:444800
EXTRAM: variables:3200
-----------------------------------------------------------------------------------------------
The code above will run fine with or without PSRAM.
But when I make the following change in the code by increasing the buffer size to 250:
This compiles fine with the following memory usage:
-----------------------------------------------------------------------------------------------
Memory Usage on Teensy 4.1:
FLASH: code:180352, data:23500, headers:9136 free for files:7913476
RAM1: variables:30976, code:177076, padding:19532 free for local variables:296704
RAM2: variables:79488 free for malloc/new:444800
EXTRAM: variables:4000
-----------------------------------------------------------------------------------------------
However, after a few seconds, the code crashes.
What could be causing that given that the hardware passed the memory test.
Thanks in advance to the community.
In my sketch, I am using the PSRAM memory to save a String array:
Code:
const int BUFFER_SIZE = 200;
EXTMEM String circularBuffer[BUFFER_SIZE];
This compiles fine with the following memory usage:
-----------------------------------------------------------------------------------------------
Memory Usage on Teensy 4.1:
FLASH: code:180352, data:23500, headers:9136 free for files:7913476
RAM1: variables:30976, code:177076, padding:19532 free for local variables:296704
RAM2: variables:79488 free for malloc/new:444800
EXTRAM: variables:3200
-----------------------------------------------------------------------------------------------
The code above will run fine with or without PSRAM.
But when I make the following change in the code by increasing the buffer size to 250:
Code:
const int BUFFER_SIZE = 250;
EXTMEM String circularBuffer[BUFFER_SIZE];
This compiles fine with the following memory usage:
-----------------------------------------------------------------------------------------------
Memory Usage on Teensy 4.1:
FLASH: code:180352, data:23500, headers:9136 free for files:7913476
RAM1: variables:30976, code:177076, padding:19532 free for local variables:296704
RAM2: variables:79488 free for malloc/new:444800
EXTRAM: variables:4000
-----------------------------------------------------------------------------------------------
However, after a few seconds, the code crashes.
What could be causing that given that the hardware passed the memory test.
Thanks in advance to the community.