SPRU514Z July 2001 – October 2023 SM320F28335-EP
Global and static variables are zero-initialized by default. However, in applications that use non-volatile memory, it may be desirable to have variables that are not initialized. Noinit variables are global or static variables that are not zero-initialized at startup or reset.
These pragmas are supported only when used with EABI. They are not supported with the COFF ABI.
Variables can be declared as noinit or persistent using either pragmas or variable attributes. See Section 6.15.4 for information about using variable attributes in declarations.
Noinit and persistent variables behave identically with the exception of whether or not they are initialized at load time.
By default, noinit or persistent
variables are placed in sections named .TI.noinit
and
.TI.persistent
, respectively. The location of these sections is
controlled by the linker command file. Typically .TI.persistent sections are placed
in FRAM for devices that support FRAM and .TI.noinit sections are placed in
RAM.
When using these pragmas in non-volatile FRAM memory, the memory region could be protected against unintended writes through the device's Memory Protection Unit. Some devices have memory protection enabled by default. Please see the information about memory protection in the datasheet for your device. If the Memory Protection Unit is enabled, it first needs to be disabled before modifying the variables.
If you are using non-volat