Skip to main content
Saredo
Associate III
February 8, 2021
Solved

How to reset SPI interface after HAL_SPI_TransmistReceive_IT?

  • February 8, 2021
  • 1 reply
  • 1499 views

Hello,

I'm working with a STM32F446 and I configured the SPI as slave.

In my process I receive x bytes of data in interruption. But during the process, this size of data changes to y. But the function HAL_SPI_TransmitReceive_IT(x) has already been called with the value x.

I tried resetting the SPI interface to be able to receive those y bytes (HAL_SPI_TransmitReceive_IT(y)). But it is not working, I still receive the data with a shift, due to the previous size.

What is the proper way to fix this?

Thanks in advance

This topic has been closed for replies.
Best answer by Vangelis Fortounas

Hello

HAL_SPI_Abort_IT is the way to abort an IT or DMA SPI operation. Note that HAL_SPI_AbortCpltCallback called on abortion end. (defined by user)

IMO a byte by byte reception and evaluation inside IRQHandler, is far faster than execute all this HAL functions

1 reply

Vangelis Fortounas
Associate II
February 8, 2021

Hello

HAL_SPI_Abort_IT is the way to abort an IT or DMA SPI operation. Note that HAL_SPI_AbortCpltCallback called on abortion end. (defined by user)

IMO a byte by byte reception and evaluation inside IRQHandler, is far faster than execute all this HAL functions