Hello
I'm very new to Teensy, but quite experienced in Arduino and ESP32.
I switched to Teensy 4.1 for programming and executing an AI application, which uses very large arrays of float (or chars). I have a Teensy 4.1 with 8MB PSRAM and 256 MB Flash.
I read the "Teensy 4.1 Memory Configuration and Use" page and I have some questions on how to optimize the memory usage for execution speed.
I see that the code is copied into RAM1 at runtime. But I may not know the size of the code so I may not know the amount of available memory in RAM1. Then, if I declare a large array, I'm not sure that it will fit in RAM1.
In short, I think it is hard to know the optimum placement of each array I use when I design the code. Then I can't choose to use DMAMEM or EXTMEM.
So here are my questions:
I'm very new to Teensy, but quite experienced in Arduino and ESP32.
I switched to Teensy 4.1 for programming and executing an AI application, which uses very large arrays of float (or chars). I have a Teensy 4.1 with 8MB PSRAM and 256 MB Flash.
I read the "Teensy 4.1 Memory Configuration and Use" page and I have some questions on how to optimize the memory usage for execution speed.
I see that the code is copied into RAM1 at runtime. But I may not know the size of the code so I may not know the amount of available memory in RAM1. Then, if I declare a large array, I'm not sure that it will fit in RAM1.
In short, I think it is hard to know the optimum placement of each array I use when I design the code. Then I can't choose to use DMAMEM or EXTMEM.
So here are my questions:
- Should I check the size of each array and decide to put them in RAM1, RAM2 or PSRAM by myself, or should I let the Teensy decide the optimum memory usage?
- Are there any function calls to check each memory type usage at runtime, such as external_psram_used or RAM1_used?