Skip to main content
Visitor II
January 30, 2020
Question

Error during EEPROM write operation

  • January 30, 2020
  • 1 reply
  • 709 views

Hello,

I am working with STM32F4 discovery.

I want to use EEPROM to write and read data. I have taken example code from https://github.com/PaxInstruments/STM32CubeF4/tree/master/Projects/STM32F4-Discovery/Applications/EEPROM/EEPROM_Emulation and it works fine.

Then i tried to use it in my program. But i am getting HAL_ERROR.

I used the EE_WriteVariable and EE_ReadVariable functions to perform write and read.

But EE_WriteVariable always return HAL_ERROR.

I tried to debug and came to know that in function

FLASH_WaitForLastOperation() following code

if (__HAL_FLASH_GET_FLAG((FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | \ FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR | FLASH_FLAG_RDERR)))
{
 /*Save the error code*/
 FLASH_SetErrorCode();
 return HAL_ERROR;
}

return 0x0c.

I have checked the value of FLASH->SR it is 0x0c.

Can you please help me what is meaning of the 0x0c?

why it is not performing write operation?

Waiting for your kind reply.

    This topic has been closed for replies.

    1 reply

    MAbba.2Author
    Visitor II
    February 3, 2020

    Any help regarding the issue?