STMicroelectronics / stm32l4xx_hal_driver

Provides the STM32Cube MCU Component "hal_driver" of the STM32L4 series.
BSD 3-Clause "New" or "Revised" License
30 stars 14 forks source link

HAL_SPI_TransmitReceive() always returns HAL_BUSY after the first transaction #8

Closed by-gnome closed 1 year ago

by-gnome commented 1 year ago

In HAL_SPI_TransmitReceive() the hspi->State variable remains in HAL_SPI_STATE_BUSY_RX after the first transaction, no further transactions are executed, HAL_BUSY is returned.

It can be solved like this:

1545-
1546-    errorcode = HAL_ERROR;

1553-    errorcode = HAL_ERROR;

1557+    if (hspi->ErrorCode != HAL_SPI_ERROR_NONE)
1558+    {
1559+      errorcode = HAL_ERROR;
1560+    }
1561+      else
1562+    {
1563+      hspi->State = HAL_SPI_STATE_READY;
1564+    }
1565+
TOUNSTM commented 1 year ago

Hello @by-gnome,

Thank you for reporting this point. Actually, this point has been discussed and fixed internally, before we receive your request. The fix will be available soon hopefully.

With Regards, Tasnim

TOUNSTM commented 1 year ago

ST Internal Reference: 135724

TOUNSTM commented 1 year ago

Hi @by-gnome ,

The fix is available on stm32l4xx_hal_driver repository within this commit.

As fixed, please allow me to close this thread and thank you for your contribution.

With regards,