2022-02-10 09:40 PM
Hello,
I am developing a project based on B-L072Z-LWAN with STM32CubeIDE 1.6.1, I need to write data to DATA EEPROM. I use herring functions:
//Byte write
void EEPROM_WRITE(uint16_t BiasAddress, uint8_t *Data, uint16_t len)
{
uint16_t i;
HAL_StatusTypeDef status = HAL_OK;
HAL_FLASHEx_DATAEEPROM_Unlock();
for(i=0;i<len;i++)
{
status +=HAL_FLASHEx_DATAEEPROM_Program(FLASH_TYPEPROGRAMDATA_BYTE, EEPROM_BASE_ADDR+BiasAddress+i, *Data);
Data++;
}
HAL_FLASHEx_DATAEEPROM_Lock();
}
but when compiling the project it gives me an error for an undefined function:
HAL_FLASHEx_DATAEEPROM_Unlock ();
when changing the function of:
//Byte write
void EEPROM_WRITE(uint16_t BiasAddress, uint8_t Data)
{
HAL_StatusTypeDef status = HAL_OK;
HAL_FLASHEx_DATAEEPROM_Unlock();
status =HAL_FLASHEx_DATAEEPROM_Program(FLASH_TYPEPROGRAMDATA_BYTE, EEPROM_BASE_ADDR+BiasAddress, Data);
HAL_FLASHEx_DATAEEPROM_Lock();
}