SPRU513Y August 2001 – June 2022 SM320F28335-EP
Cause symbol address to be preserved during warm start
.preserve symbol
The .preserve directive causes a symbol's address and value to be preserved during a warm start. This directive must be used in the asm header block.
The executable must be in ELF format and compiled for Live Firmware Update (LFU), which provides a "warm start" capability. For information about using LFU, see the TMS320C28x Optimizing C/C++ Compiler User's Guide (SPRU514) and the Live Firmware Update Reference Design with C2000 MCUs (TIDUEY4) design guide.
Global and static variables may be preserved, updated, or allowed to move handled in the following ways during a warm start:
Follow these conventions to specify the "preserve" behavior:
The following example preserves the
address of var0
when a warm start occurs:
.preserve var0 ; In asm header block
…
.global ||var0||
.sect ".TI.bound:var0", RW
.elfsym ||var0||, SYM_PRESERVE(1)
…
.sblock ".TI.bound:var0"
No special directive is required to specify the "update" behavior for a symbol. The following conventions are required to specify a symbol should be updated,
The following example causes the
var1
symbol to be re-initialized (updated) when a warm start
occurs:
.global ||var1||
.sect “.TI.update:var1”, RW
.elfsym ||var0||, SYM_UPDATE(1)
This behavior occurs only if the
--lfu_default=none
compiler option is used and a global or
static variable is not placed in a special output section. Create such symbols using
the .global directive. For example:
.global ||var2||