SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By tmloos
#77562
Hello,
Does anyone know how to initialize the SEGA, SEGB, SEGC ... info memory of flash in C using the IAR compiler? I was hand editing the downloadable image file but that did not pass my code review... I am using a 2012.

Thanks!
By OldCow
#77576
Info-flash is non-volatile. That is, its contents will not change even after you turn power off and on. There is no need to initialize it when you run your program.
By tmloos
#77577
OldCow wrote:Info-flash is non-volatile. That is, its contents will not change even after you turn power off and on. There is no need to initialize it when you run your program.
I understand what info and non-volatile memory is. I need to initialize it with serial numbers, configuration values, etc. And I can't hand edit the downloadable file that iar generates. I need to define the memory in c.
By OldCow
#77630
The IAR tool chain is capable of taking user commands to write any data pattern in Info-Flash (or Main-Flash).

One can also go through other roundabout ways to do it. One of which is to write a program in c, compile it into executable, write executable to Main-Flash, run that to write data patten in Info-Flash, and disable/erase that executable from the Main-Flash after the Info-Flash is written.

TI has code examples to erase and write Flash.
By steveduck
#78156
IAR will allow you to import a binary file at link time and add it to your cone image. You just need to add a segnment in the linker file that maps to the info memory address that you with to initialise. Then provide the binary file and add using the linker tab and provide the segment name and alighnment data. Check out the linker documentation. Any problems then please let me know.

Steve