2016-03-21 10:19 AM
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 losthere 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(); }2016-03-21 11:47 AM
Yes, I think you'll need to dig into the implementation, and understand how robust it is, and how it recovers from erase failures, or as it transitions from page to page.
More practically you could use the Flash directly, and understand its function and limitations.