https://youtu.be/hyIEUCIVhQQ?si=tczopU-CYL0JYOTp&t=492

#include <msp430.h>
int a[5] = { 0xAAAA, 0xBBBB, 0xCCCC, 0xDDDD, 0xEEEE }; // Global variable initialized (.data + .const) RAM + FLASH
const int b[5] = { 0xBBBB, 0xCCCC, 0xDDDD, 0xEEEE, 0xAAAA }; // Constant variable (.const) FLASH
int c[5]; // Global variable not initialized (.bss) RAM
/**
* blink.c
*/
void main(void)
{
int d[5] = { 0xDDDD, 0xDDDD, 0xDDDD, 0xDDDD, 0xDDDD }; // Local variable initialized (.stack + .const) RAM + FLASH
static int e[5] = { 0xBCAA, 0xBCDA, 0xEFAA, 0xEFEA, 0xEFEA }; // Static variable initialized (.data + .const) RAM + FLASH
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P1DIR |= 0x01; // configure P1.0 as output
volatile unsigned int i; // volatile to prevent optimization
int sum = 0; // Local variable initialized (.stack) RAM
for (i = 0; i < 5; i++) { // Program code (.text) FLASH
sum += a[i] + b[i] + c[i] + d[i] + e[i]; // Program code (.text) FLASH
}
while(1)
{
P1OUT ^= 0x01; // toggle P1.0
for(i=sum; i>0; i--); // delay


Internal Flash memory (512KB):
This is the main non-volatile storage for code and data. It’s called embedded or on-chip flash and retains data even when power is off.
Internal SRAM:
This is one of the two on-chip RAM blocks used for fast, temporary data storage during program execution.
System Memory (ROM) :
Read-only memory containing system bootloader and other essential routines. It cannot be modified by the user. (doen’t execute automaticaly)
OTP memory (528 bytes):
One-Time Programmable memory, used for storing data that should never change (e.g., device calibration, serial number, ..).
Option bytes memory (16 bytes):
Special memory for configuration settings like read protection, boot options, etc.
Backup RAM (4KB):
Small RAM area powered by a battery, used to retain critical data during power loss.