Tool/software: Code Composer Studio
In the small program below the variable FramVar is not created in section .TI.persistent but in section .bss See extract from the map file at the bottom. I use CodeComposerStudio Version: 9.3.0.00012
Any suggestions?
Best regards, Robert
#include <msp430.h> #pragma PERSISTENT (FramVar) unsigned int FramVar; void main(void) { WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer SYSCFG0 = FRWPPW | DFWP; // Set FRAM write enable ++FramVar; SYSCFG0 = FRWPPW | PFWP | DFWP; // Set FRAM write protected (not writable) while(1) {} }
Extract from map-file:
SECTION ALLOCATION MAP
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.TI.persistent
* 0 0000e300 00000000 UNINITIALIZED
.cinit 0 0000e300 00000012
0000e300 00000006 (.cinit..bss.load) [load image, compression = zero_init]
0000e306 00000004 (__TI_handler_table)
0000e30a 00000008 (__TI_cinit_table)
.pinit 0 0000e312 00000000 UNINITIALIZED
.binit 0 0000e312 00000000
.init_array
* 0 0000e312 00000000 UNINITIALIZED
.mspabi.exidx
* 0 0000e312 00000000 UNINITIALIZED
.mspabi.extab
* 0 0000e312 00000000 UNINITIALIZED
.const 0 0000e312 00000000 UNINITIALIZED
.text 0 0000e312 000000ce
0000e312 0000006a rts430x_lc_sd_eabi.lib : autoinit.c.obj (.text:__TI_auto_init_nobinit_nopinit_hold_wdt:__TI_auto_init_nobinit_nopinit_hold_wdt)
0000e37c 0000003e : copy_zero_init.c.obj (.text:decompress:ZI:__TI_zero_init_nomemset:__TI_zero_init_nomemset)
0000e3ba 0000001a main.obj (.text:main)
0000e3d4 00000006 rts430x_lc_sd_eabi.lib : exit.c.obj (.text:abort)
0000e3da 00000004 : pre_init.c.obj (.text:_system_pre_init)
0000e3de 00000002 : startup.c.obj (.text:_system_post_cinit)
.text:_isr
* 0 0000e3e0 00000024
0000e3e0 0000001c rts430x_lc_sd_eabi.lib : boot.c.obj (.text:_isr:_c_int00_noargs)
0000e3fc 00000008 : isr_trap.asm.obj (.text:_isr:__TI_ISR_TRAP)
.bss 0 00002000 00000002 UNINITIALIZED
00002000 00000002 (.common:FramVar)
.stack 0 00002760 000000a0 UNINITIALIZED
00002760 00000002 rts430x_lc_sd_eabi.lib : boot.c.obj (.stack)
00002762 0000009e --HOLE--