AnsweredAssumed Answered

STM32Cube Bug: L1, HAL Flash, Data EEPROM, Cat.1 Devices

Question asked by ashlock.tad on Oct 1, 2015
Latest reply on Jan 25, 2016 by 68516
Installed file: STM32Cube_FW_L1_V1.3.0

STM32L1 Cat.1 devices can't successfully write a zero byte, or half-word, to data EEPROM using the HAL function HAL_FLASHEx_DATAEEPROM_Program().

The problem is that HAL_FLASHEx_DATAEEPROM_Program() indirectly calls itself, causing __HAL_LOCK(&pFlash) to be called twiced without an intervening call to __HAL_UNLOCK(&pFlash).

An example path:

HAL_FLASHEx_DATAEEPROM_Program(FLASH_TYPEPROGRAMDATA_BYTE, EEPROM_START_ADDR, 0);

FLASH_DATAEEPROM_ProgramByte(Address, (uint8_t) Data); [in stm32l1xx_hal_flash_ex.c]

HAL_FLASHEx_DATAEEPROM_Program(FLASH_TYPEPROGRAMDATA_FASTWORD, (Address & 0xFFFFFFFC), tmp); [in stm32l1xx_hal_flash_ex.c]

Outcomes