Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Large Arduino programs on Teensy 3.6

  1. #1
    Junior Member
    Join Date
    Oct 2016
    Posts
    12

    Large Arduino programs on Teensy 3.6

    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 ?

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,584
    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).

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,830
    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.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,478
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •