In no scope does
static mean data is read only.
Const is made for that.
When you tell the ARM compiler data is
const, it won't be put in ram by _main*.
On an AVR (arduino), with
harvard architecture, there are two distinct memory spaces: instruction and data.
By default, any object will be made and initialized in data. Which is sram. You have to explicetely tell the compiler to put an object in the instruction memory by using
progmem.
The compiler needs to know this since other instructions are needed to access instruction memory, compared to normal data memory.
With ARM, and it's single 32 bit byte addressable address space, this is no longer needed.
*the function called prior to main().
In C:
Static in global scope limits the scope of the variable to only the C file.
Static in local scope (code block) makes the variable "global", yet keeping the identifier local.
3) If the declaration of a file scope identifier for an object or a function contains the storageclass
specifier static, the identifier has internal linkage.
eg: toss an error on extern.3) An object whose identifier is declared with external or internal linkage, or with the
storage-class specifier static has static storage duration. Its lifetime is the entire
execution of the program and its stored value is initialized only once, prior to program
startup.
eg: only one instance of the variable exists. No matter how many times the function is being recursed/threaded.You've still not mentioned the toolchain. uVision? Atmel Studio? Bare GNU?