2021-04-22 07:14 AM
My setup:
SPI(Tx only) + DMA (not circular) and no FIFO
Now HAL_SPI_TxCpltCallback() is executed only if the transfer-complete-flag is also set before HAL_DMA_IRQHandler() is handled for "half transfer complete interrupt"
Problem is:
in HAL_DMA_IRQHandler():
hdma->ErrorCode |= HAL_DMA_ERROR_FE;
triggers because the FIFO is off and should be ignored because FIFO is not used.
But it triggers the error routine at the end of HAL_DMA_IRQHandler() and causes the problems.
Workaround:
Always activate the FIFO.