cancel
Showing results for 
Search instead for 
Did you mean: 

How to reset SPI interface after HAL_SPI_TransmistReceive_IT?

Saredo
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

1 REPLY 1

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