Access all 512k in RAM2

spectasaurus

Active member
When Teensy 4.0 and 4.1 first came out, it was possible to access the entire 512k of RAM2 space using the DMAMEM call. Sometime between then and now, an upgrade to Teensyduino reduced the amount of space allocatable to about 510k or so. I'm wondering there is a way get full access to the 512k in RAM2? I'm working on a data acquisition system that allocates a 1024x256 memory address uint16's. It was nice having full access to the 1024x256 array.
 
Try the easiest thing first, in Arduino IDE Boards Manager, click the drop-down list to go back to the oldest version. If that meets your needs, you can avoid diving into the code and linker script.

But RAM2 usually gets used for a number of things. The USB code puts its buffers in DMAMEM, so they don't take away from the precious RAM1 memory. If you're using USB or anything else coded with "DMAMEM", you'll need to edit that code to instead use RAM1.

The default fault handler stores the CrashReport data at the very end of RAM2. Maybe you'll also want to delete that stuff, but perhaps it's not a huge problem because overwriting those last bytes in RAM2 only happens if your program crashes (in a way the MPU or other fault stuff can detect) or if you explicitly use CrashReport breadcrumbs.
 
Back
Top