saving variables in FLASH on M5213EVB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

saving variables in FLASH on M5213EVB

2,704 Views
airswit
Contributor III
Hi all,

I was wondering if you could help me out. I would like to save operating info/settings in FLASH, so that on the next system startup, these values may be read back in. where is it safe to do so, using CodeWarrior and the EVB? Also, is there any special way to write to it, or can you just write like you would a register?

P.S. I am using C/C++ to program

Thanks,
Trevor
Labels (1)
0 Kudos
Reply
1 Reply

1,133 Views
mpeters
Contributor I
Trevor,

You can write your code for flash the same way you would write your code if you were going to run it from SRAM. Your C/C++ code won't be any different in terms of setting registers, routines, etc. The difference between the two is that you need to make sure you build the correct target (in CodeWarrior). In other words, write your code and make sure that when you make/build/compile your code, you are doing so for the "Flash" target.

Once you've compiled your code, and the .s19 file has been created, you will need to program this .s19 file in to the flash. The easiest way to do this is with CF Flasher. You can download CF Flasher from the MCF5213 Product Summary Page. Here is the link:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MCF5213&nodeId=0162468rH3YTLC00M91436

Regard,
mp
0 Kudos
Reply