Skip to main content
embedsol
Associate
March 21, 2016
Question

STM32 EEPROM emulation data lost

  • March 21, 2016
  • 1 reply
  • 654 views
Posted on March 21, 2016 at 18:19

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();

}

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    March 21, 2016
    Posted on March 21, 2016 at 19:47

    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.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..