STMicroelectronics / STM32CubeL4

STM32Cube MCU Full Package for the STM32L4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
269 stars 155 forks source link

HAL_I2C_Master_Abort_IT mode HAL_I2C_MODE_MEM not supported #91

Closed pocpos closed 1 month ago

pocpos commented 2 months ago

Set-up

Describe the bug In case of a error condition, the firmware should call HAL_I2C_Master_Abort_IT(), but this doesn't abort the transfer, because the the internal mode HAL_I2C_MODE_MEM is not support by this function.

Hint For "STM32CubeL5 MCU Firmware Package" this bug is already fixed. Please use the "L5" fix for "L4" too!

Function -> STM32L4 - incomplete

HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress)
{
  if (hi2c->Mode == HAL_I2C_MODE_MASTER)
  {
    /* Process Locked */
    __HAL_LOCK(hi2c);

...

Function -> STM32L5 - working version

HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress)
{
  HAL_I2C_ModeTypeDef tmp_mode = hi2c->Mode;

  if ((tmp_mode == HAL_I2C_MODE_MASTER) || (tmp_mode == HAL_I2C_MODE_MEM) )
  {
    /* Process Locked */
    __HAL_LOCK(hi2c);

...

KRASTM commented 2 months ago

ST Internal Reference: 187144

KRASTM commented 1 month ago

Hello @pocpos,

The issue you reported has been fixed in the frame of version v1.13.5 of the STM32L4 HAL driver published on GitHub. Thank you again for having reported.

With regards,