AnsweredAssumed Answered

STM32 EEPROM emulation data lost

Question asked by qasim.qasim on Mar 21, 2016
Latest reply on Mar 21, 2016 by Clive One
hi
i am using stm32F030 and using eeprom emulation to store the data the problem i am facing is this, when i perform the power reset , the data is lost and its random, some time it keeps the data and some times after power reset data is lost
here is the settings i am doing and the flow

* Define the size of the sectors to be used */
#define PAGE_SIZE             ((uint32_t)0x0400)  /* Page size = 1KByte */


/* EEPROM start address in Flash */
#define EEPROM_START_ADDRESS  ((uint32_t)0x08006000) /* EEPROM emulation start address:
                                                        from sector2, after 8KByte of used 
                                                        Flash memory */


     
     FLASH_Unlock();
     EE_Init();          
     EE_ReadVariable(92,&VALUE1); // read the some value
     FLASH_Lock();     

     while(1)


{
     FLASH_Unlock();
     EE_WriteVariable(92,NULL); // write data based on some even like button press or timer
     FLASH_Lock();     

}

















Outcomes