This feels like a very basic issue, but I've not been able to find the solution through random experimentation nor searches of this forum. I'm developing an application for the MSP430F6733 using the Code Composer 5.5, and I'm trying to place certain constants in Info Flash using the following trivial code:
#include <stdint.h> #pragma DATA_SECTION(".infoD") const uint16_t test = 0x1234; int main() { while (1) ; }
When I start the debugger and break at the beginning of main(), infoD does not contain 0x1234. I also tried using #pragma location=0x1800 instead of DATA_SECTION, but that didn't work either. I believe that the constant is getting placed correctly, because I was able to manually change the value of that memory in the debugger and saw the new value reflected in a local variable. However, it's clearly not getting programmed correctly initially.
The Debugger in Code Composer is set to "Erase main, information and protected information memory", so I don't believe this issue is due to a restriction on the debugger. Could somebody point me in the right direction on getting the constant to be initialized correctly in memory?