I am trying to have some of my code execute from RAM so I can eek out the little bit of power savings that I've heard it can offer (or, at least, measure for myself how much it actually saves)
I opened up the 'lnk_msp430f5328.cmd' file that was created by CCS when I created the project, and I changed
.text : {}>> FLASH | FLASH2 /* CODE */
.text:_isr : {} > FLASH /* ISR CODE SPACE */
to
.text : {}>> RAM | FLASH | FLASH2 /* CODE */
.text:_isr : {} > RAM /* ISR CODE SPACE */
The code runs right after the chip is programmed, but after power is cut and restored, the module seems not to run anymore. I'm guessing that the code that was stored in RAM was lost because RAM is volatile and looses it's contents when it looses power. If that is what is happening, it surprises me because I would have thought that it would be saved in FLASH, but loaded to RAM during power-up. I'm under the impression that that happens with the .data section.
Is that what is happening? Is there something I can do to the linker to make it load the code to RAM during power-up like I thought it would anyway?