I have two STM32F103 connected together with SPI in full duplex mode. They changing 700 halword with DMA and CRC enabled. The communication is fine (no crc or other error) but there is this line of code in the SPI_DMATransmitReceiveCplt() in the stm32F1xx_hal_spi.c which blocks the code till the SPI_TIMEOUT_VALUE. It is 10 ms. What is the meaning of this blocking? If I change this value to 1 on booth controller it even works fine, but it allways wait till the timeout. I don't want to waste here so many time.
May I lower this timeout or set it 0? Or despite the proper CRC there is some kind of error during the communication which cause this hanging?
/* CRC Calculation handling */
if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
/* Check if CRC is done on going (RXNE flag set) */
if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, SET, SPI_TIMEOUT_VALUE) == HAL_OK)
/* Wait until RXNE flag is set to send data */
if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK)
/* Read CRC */
tmpreg = hspi->Instance->DR;
/* Check if CRC error occurred */
if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET)