STM32 (SPI Receive only Slave Mode) HAL_SPI_Receive_IT () only worked once.
Hi, I did enable one time HAL_SPI_Receive_IT one time in int main().. after the first spi transaction completely received i did re-enable the spi receive interrupt in callback function..
But the problem is , the HAL_SPI_Receive_IT succesfully receive the correct data in the first time, after that none of it was correct.
void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi)
{
rxbuf1[0]=rxbuf[0];
rxbuf1[1]=rxbuf[1];
rxbuf1[2]=rxbuf[2];
rxbuf1[3]=rxbuf[3];
rxbuf1[4]=rxbuf[4];
if(HAL_SPI_Receive_IT(&hspi1,(uint8_t*)&rxbuf,5)!= HAL_OK)
{
Error_Handler();
}
}
Is anything i need to do ? for example clear the interrupt flag or what?
It would be much appreciate if you could help.
Thanks.
Regards,
Kelvin
