STM32CubeL4
STM32CubeL4 copied to clipboard
HAL_I2C_Master_Abort_IT mode HAL_I2C_MODE_MEM not supported
Set-up
- STM32L496 MCU with I2C device which required I2C-memory transfer (
HAL_I2C_Mem_Write_IT/HAL_I2C_Mem_Read_IT) - STM32CubeIDE Version: 1.16.0
- STM32CubeL4 MCU Firmware Package 1.18.0
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);
...
ST Internal Reference: 187144
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,