Other Parts Discussed in Thread: TMS320F280049C
Hi,
I am trying to define some data in memory using the #pragma PERSISTENT.
e.g.
#pragma PERSISTENT(bootloaderVersion)
const version_t bootloaderVersion = {
.major = MAJOR_VERSION,
.minor = MINOR_VERSION,
.patch = PATCH_VERSION,
.build = BUILD_NO,
.sha = SHA_NO
};
If i don't use this variable anywhere in the code, the values are not stored in flash.
However, if I add something like
if (bootloaderVersion.major == MAJOR_VERSION) {
/// dummy code
}
Then the memory gets initialised correctly.
Is there any clean way of telling the compiler not to optimise that away?
Thank you