Tool/software: TI C/C++ Compiler
Hi
I have two application images stored on internal flash, and can successfully switch between them (by updating vector table address, resetting SP and jumping to secondary ResetISR). For that to work though, it needs to happen immediately after reset, first thing in main(). Reset is done using SysCtrlSystemReset().
As a means for "communicating" between these images, I would like to set a value in RAM before reset, and then be able to read that value from RAM after reset. I have tried several things to prevent standard initialization, but none work:
- #pragma PERSISTENT(myvar)
- #pragma NOINIT(myvar)
- #pragma DATA_SECTION(myvar, ".resetvar") where .resetvar is a section marked as type=NOINIT or type=NOLOAD
- Reducing the RAM size in the MEMORY region setup and directly writing/reading a value outside the declared MEMORY region, but that too seems to be zeroed.
- Setting --zero_init=off in the linker script.
The first three all seem to affect the placement in memory as expected (and the section is marked as UNINITIALIZED in the map file), but the memory location is always zeroed anyway.
I tried breaking on ResetISR (which I understand calls c_int00 or equivalent) and it seems like memory is already zeroed at that point.
So at this point I am wondering if CC1352P always zeroes its entire memory before every boot? Indeed, the datasheet seems to suggest this (although it could just be referring to default behaviour): "6.5 Memory: System SRAM is always initialized to zeroes upon code execution from boot".
Is it possible to configure CC1352P to retain selected variable in RAM memory through a reset?