cancel
Showing results for 
Search instead for 
Did you mean: 

[BUG] in STM32CubeF7 EEPROM_Emulation Project: Function EE_VerifyPageFullyErased() can't verify if PAGE1 is erased.

jwoerle
Associate III

Hey All,

I'm using the STM32CubeF7 v1.15.0 Lib.

If I look in any EEPROM_Emulation Project in the file eeprom.c, there is all the time the same issue with the function EE_VerifyPageFullyErased() starting at line 328:

/**
  * @brief  Verify if specified page is fully erased.
  * @param  Address: page address
  *   This parameter can be one of the following values:
  *     @arg PAGE0_BASE_ADDRESS: Page0 base address
  *     @arg PAGE1_BASE_ADDRESS: Page1 base address
  * @retval page fully erased status:
  *           - 0: if Page not erased
  *           - 1: if Page erased
  */
uint16_t EE_VerifyPageFullyErased(uint32_t Address)
{
  uint32_t ReadStatus = 1;
  uint16_t AddressValue = 0x5555;
    
  /* Check each active page address starting from end */
  while (Address <= PAGE0_END_ADDRESS)
  {
    /* Get the current location content to be compared with virtual address */
    AddressValue = (*(__IO uint16_t*)Address);
 
    /* Compare the read address with the virtual address */
    if (AddressValue != ERASED)
    {
      
      /* In case variable value is read, reset ReadStatus flag */
      ReadStatus = 0;
 
      break;
    }
    /* Next address location */
    Address = Address + 4;
  }
  
  /* Return ReadStatus value: (0: Page not erased, 1: Sector erased) */
  return ReadStatus;
}

Only the PAGE0 is checked, because the condition in the while loop only checks, if end of PAGE0 is reached.

If the function parameter is PAGE1_BASE_ADDRESS, the function will all the time return "Page erased" even if PAGE1 is not erased.

So for example the function EE_Format() won't work correctly which is critical in case of illegal states in the Init phase.

I have handled this issue by setting a variable PageEndAddress, depending on the function parameter Address.

Maybe a ST Employee can forward this issue to the MCD Application Team.

Best regards

Julian

7 REPLIES 7
Imen.D
ST Employee

Hello @Julian Wörle​ ,

This issue is raised internally for check and we will come back to you soon with update.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
marco239955_stm1_st
Associate II

Hi,

I've found out the same bug: are there any updates?

Hi @Imen DAHMEN​ 

Do you have any updates to this bug?

Regards

Dejan

Imen.D
ST Employee

Hello @Dejan Nedeljkovic​ ,

I checked the status of this issue with developer team. It seems that it impacts other STM32 series and our team are working for fix this.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
PÖste.1
Associate II

I got into strage problems too and spoted this bug. A fix is needed.

However I notice this implementation is also very very slow as it scans sectors over and over again, especially transfer page for all my 2000 addresses.

Vyacheslav
Senior II

STM32Cube_FW_F4_V1.27.0 same error!

Hello @Vyacheslav​ ,

This issue is forwarded to our development team for fix (belong Internal ticket 68245)

Sorry, for the inconvenience it may cause, and thank you for your patience while we work on this.

PS: Internal ticket 68245, this is an internal tracking number and is not accessible or usable by customers).

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen