cancel
Showing results for 
Search instead for 
Did you mean: 

using flash as eeprom

ezrab
Associate II
Posted on October 19, 2010 at 15:14

hi.

i found out that it is possiable to use the flash as eeprom but the example i found was very long and complicated is there asimple way to do that?

thanks.
16 REPLIES 16
ezrab
Associate II
Posted on October 20, 2010 at 08:38

this line fills the cstack for some reason:

FLASH->CR|= CR_STRT_Set;

why?

need i earse the flash before i write on it?

ezrab
Associate II
Posted on October 20, 2010 at 10:40

i even taken the example from here:

http://www.st.com/stonline/products/support/micro/files/an2594.zip

changed the option of the project according to

http://www.st.com/stonline/products/literature/um/17875.pdf

and it does not work it goes to void HardFault_Handler(void).

what am i doing wrong?

ezrab
Associate II
Posted on October 20, 2010 at 10:42

where can i find all the explanation to the FLASH registors?

Posted on October 20, 2010 at 22:20

where can i find all the explanation to the FLASH registors?

They would be in the Reference Manual (RM0008)

http://www.st.com/stonline/products/literature/rm/13902.pdf

Consider a different tool chain, and programming style. The code posted should be working.

Look at the disassembly, and registers, for the code you have now which is faulting. You will get hard faults if you do unaligned 2 or 4 byte accesses, or if you touch memory outside of RAM, ROM, FLASH and Peripherals.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ezrab
Associate II
Posted on October 21, 2010 at 09:39

no its not there like where can i find the description of FLASH_CR?

ezrab
Associate II
Posted on October 21, 2010 at 12:48

no matter what i do i am still getting full stack after the line:

FLASH->CR|= CR_STRT_Set;

why?

what can i do?

 is there away to write asmall program that use the Flash as EEPROM?

thanks.

Posted on October 21, 2010 at 18:27

May be the STM32F10xxx Flash programming manual (PM0042) mentioned in PM0008 might be helpful

http://www.icbase.com/hotic/html/docs/13259.pdf

Short of building an entire project for you, I'm not sure why the core functionality demonstrated in the previous example doesn't work in your environment.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..