Part Number: LAUNCHXL-CC1352P
Other Parts Discussed in Thread: CC1310
Tool/software: TI C/C++ Compiler
Hi, I am using CCS Version: 9.3.0.00012 and have issues with NOINIT
I need to have a variable in RAM that preserves its value after a pin reset. I tried a few approaches:
1. use NOINIT pragma
#pragma NOINIT(myVar)
int myVar;
The linker would complain with "warning #10247-D: creating output section ".TI.noinit" without a SECTIONS specification" and it can be hashed with
.TI.noinit : > SRAM, type = NOINIT
in the linker command file, but myVar would always be zeroed after the reset.
2. use DATA_SECTION
#pragma DATA_SECTION(myVar, ".myNoInitSect:myVar")
int myVar;
and in the linker cmd file adding this:
myNoInitSect:myVar : > SRAM, type = NOINIT
The same result - the variable is always zeroed on reset
3. Use a free location in RAM like here
int *myValPtr = (int *)0x20012000;
and later when I need, I would set it to whatever I need like
*myValPtr = 0x12345;
This worked well in our cc1310 based product in CCS version 6, but doesn't work now - the location is zeroed on reset
The same happens if I use #pragma location =0x20012000
In all the cases the map file says that the section in which I have my variable is UNINITIALIZED, but it still is zeroed on reset.
What am I doing wrong?
Thanks
Sergey