SLAU131Y October 2004 – June 2021
Here is a full linker command file that uses the crc() operator to generate a memory range CRC:
-c /* Use C linking conventions: auto-init vars at runtime */
-stack 0x1400 /* Stack size */
-heap 0x0c00 /* Heap size */
MEMORY
{
SFR(R) : origin = 0x0000, length = 0x0010
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0
PERIPHERALS_16BIT: origin = 0x0100, length = 0x0100
ROMCRC (R) : origin = 0x0200, length = 0x1000
GROUP(FLASH)
{
MEM(RW) : origin = 0x1200, length = 0x9DE0, VFILL = 0x0
} crc(_ext_memrange_crc, algorithm=CRC32_PRIME)
MEM2 : origin = 0xAFE0, length = 0x5000
VECTORS(R) : origin = 0xFFE0, length = 0x001E
RESET : origin = 0xFFFE, length = 0x0002
}
SECTIONS
{
.intvecs : {} > VECTORS
/* These sections are uninitialized */
.bss : {} > MEM2
.sysmem : {} > MEM2
.stack : {} > MEM2
.cio : {} > MEM2
.data : {} > MEM2
/* These sections will be CRC'd */
.text : {} > MEM
.const : {} > MEM
.args : {} > MEM
.cinit : {} > MEM
.pinit : {} > MEM
.init_array : {} > MEM
.mspabi.exidx : {} > MEM
.mspabi.extab : {} > MEM
input : {} > MEM
.TI.ramfunc : {} load=MEM, run=MEM, table(BINIT)
.reset : > RESET
.TI.memcrc : > ROMCRC
}
WDTCTL = 0x015C;
WDTCTL_L = 0x015C;
WDTCTL_H = 0x015D;