Large Arduino programs on Teensy 3.6

Status
Not open for further replies.

digysol

Member
I am testing some large programs in Arduino on a Teensy 3.6. The software is itself large (over 4k lines of source) and uses 55K of Flash. Global variables take 6K of RAM and I seem to be running into memory capacity issues.

How much total actual RAM is available on the Teensy 3.6 for user code ?
 
Basically 1 Mbyte flash for code and 256k RAM for variables. Thus your code should easily fit in. What makes you think that you are running into memory capacity issues? What can theoretically blow up your memory consumption is memory which is allocated only at runtime, like for example multiple instances of objects or nested interrupts. But these are blind guesses as long as you do not make your code public (see Forum Rule).
 
Though note, the size of flash for the program is not an easy 1-to-1 comparison, since each processor has different instructions, etc. In addition, because the default int, double, and pointer variables are bigger on Arm platforms than AVR platforms, you may find the static SRAM size to be a little bigger.

But since the Teensy 3.6 has much, much more flash (1 megabyte vs. 32 kilobytes) and more SRAM (256 kilobytes vs. 2 kilobytes), the little bit of growth should not affect things. Even the Teensy LC has 62 kilobytes of flash and 8 kilobytes of SRAM.
 
Every time you click Verify or Upload, you get a message like this in Arduino:

Code:
Sketch uses 20612 bytes (1%) of program storage space. Maximum is 1048576 bytes.
Global variables use 11764 bytes (4%) of dynamic memory, leaving 250380 bytes for local variables. Maximum is 262144 bytes.
 
Status
Not open for further replies.
Back
Top