I am having a bit of trouble with the SPI communication between two STM32L053R8 boards.
I have a master who is sending 15 bytes every second to the slave. The slave must also return 15 Bytes.
Tha master works properly and I confirmed it with a logic analyzer.
In the slave I enabled the SPI global interrupt (via Cube) and I have the following code:
HAL_SPI_TransmitReceive_IT(&hspi1, (uint8_t*) dataTxSlave, (uint8_t*) dataRxSlave, 15);
while(HAL_SPI_GetState(&hspi1) != HAL_SPI_STATE_READY);
I can confirm that the callback:
void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi)
Is never called. Neverthelees the HAL_SPI_TransmitReceive_IT is working since the Master is receiving the data from the slave.
Does anyone knows what I missing here?
Your help is very much appreciated.