There are four pools of memory in the microcontrollers used on current LaunchPad boards :
Your LaunchPad will only have a specific combination of the above options, refer to your specific datasheet to find out exact memory information. Flash memory, FRAM, and EEPROM memory are non-volatile (the information persists after the power is turned off). SRAM is volatile and will be lost when the power is cycled.
Memory is super important when writing software for microcontrollers. You can write code to do amazing things but if it doesn't fit on your device, it won't run. Make sure you get a LaunchPad with the specs that will fit your intended applications.
It's easy to use all your memory up by having lots of strings in your program. For example, a declaration like:
char message[] = "I support the Energia Community.";
puts 32 bytes into SRAM (each character takes a byte). This might not seem like a lot, but it doesn't take long to get to 2048, especially if you have a large amount of text to send to a display, or a large lookup table, for example.
If you run out of SRAM, your program may fail in unexpected ways; it will appear to upload successfully, but not run, or run strangely. To check if this is happening, you can try commenting out or shortening the strings or other data structures in your sketch (without changing the code). If it then runs successfully, you're probably running out of SRAM. There are a few things you can do to address this problem:
Corrections, suggestions, and new documentation should be posted to the Forum.
The text of the Energia reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Energia reference is based on the Arduino reference. Code samples in the reference are released into the public domain.