You can try and edit the platform.txt file and set a different version for C and C++.
However, this may rise conflicts with the default libraries, as they target an older version of C and C++.
For more advanced use of the Energia SDK, I would recommend using Code Composer Studio.
Can this be figured out @Rei Vilo @energia? I use TI MCUs in a lot of projects and it would be fantastic to have access to modern C++ functions. As it is currently, you have to rewrite any example code that manufacturers provide. Often times, this isn't practical so some sort of update would be nice. Can you at least confirm that anything is in the works or that it's unsupported at this point?
Yes, you shouldn't need to change any settings to be able to read and write from the main FRAM block.
I'm able to observe a persistent variable being incremented with the following code on the FR5994
unsigned long __attribute__((section(".persistent"))) persist = 5;
int main (void)
WDTCTL = WDTPW | WDTHOLD;
printf ("persist %ld\n", persist);
for (int i = 0; i < 1000; i++);
I don't know what setup Energia does by default, but you should check that at least the watchdog is disabled, if it fires before you get to the modification of the persistent variable, then it will just stay at 5.
There's plenty of posts about writing to FRAM on the TI E2E forums, you could check there if you continue to have problems. Particularly check out the code examples included in this thread https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/911028?tisearch=e2e-sitesearch&keymatch=msp430%20fram%20write
Thanks for that info, however I tried your recommendation and found that the variable, once set at 5, could not then be changed by other lines in the code (i.e. FRAM_count++) and instead would remain at five. This is similar to the behaviour I observed from the energia-defined PLACE_IN_FRAM, despite the fact that the data memory region the .persistent section is in is rwx. Is this the intended behaviour and am I simply misunderstanding the persistent attribute, or are there other factors at play here? I wondered if it could be an MPU issue, but my understanding is that the MPU is disabled by default?
Thanks again for your suggestion!