cancel
Showing results for 
Search instead for 
Did you mean: 

EEPROM emulation - EE_Init() fail - Step 4

Dams
Associate III

Hi, 

I'm using en.x-cube-eeprom-v7-0-0 on a STM32L476 and I got a problem during my validation phase.
I do lot of write on the EEPROM to be sure my code works well (so lot of CleanUp).
Actually, on the step 4 of the EE_Init(), I have a EE_WRITE_ERROR on the last step:

if (SetPageState(ubCurrentActivePage, STATE_PAGE_ACTIVE) != EE_OK)

When FLASH_Program_DoubleWord is called, the register FLASH->SR:
 - is set to 0x8 after the Program first word
 - then set to 0xA8 after Program second word

 

I take a look to the content of the flash at the write address (0x8066008):

Dams_0-1728637523339.png

There is already a Data 0xAAAAAAAAAAAAAAAA so it's normal the error is set.
What can be done to have the init working (without loose of data if possible) ?

 

Thanks a lot for advise.

 

1 REPLY 1
Florian LR
ST Employee

Hi @Dams

When this is happening ? 
You're talking about a lot of cleanups, does that occurs on the first init ? After resets ? Are there special conditions that could make reproducible ? Does this happens always on that address ? On any other ones ? (or at least other header pages since it's what we have here). 
What error do you get ? 
An other thing, it seems that the write is performed correctly since the set page to active page is supposed to write these AAA you see, or the page is already set to active before that set page call, in which case are we ?

 

Regards, 
Florian LR