AnsweredAssumed Answered

EEPROM for Cube MX STM32F301C8

Question asked by Panupong Boonya on Aug 7, 2017
Latest reply on Aug 8, 2017 by Brian TIDAL

Hi,

I would like to used EEPROM for STM32F301C8. I am used code below

uint32_t READ_FLASH(uint32_t DataAdr)
{
return *(int32u *)DataAdr;
}

void WRITE_FLASH(uint32_t DataAdr, uint32_t Data)
{
erase_pages.PageAddress=DataAdr;
erase_pages.NbPages=4;
erase_pages.TypeErase=TYPEERASE_PAGES;

HAL_FLASH_Unlock();
HAL_FLASHEx_Erase(&erase_pages, Error);
HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, DataAdr, Data);
HAL_FLASH_Lock();
}

 

It's not working. Please tell me about EEPROM or How I can learning if I am used to HAL library.

Outcomes