2021-03-16 09:06 AM
Hello,
I am on a new project that is sending SPI data every 200kHz (real time very important). I work on a STM32F722.
I want to use HAL_SPI_TxCpltCallback() to know when the transmit is finished, but I don't want to use the HAL drivers.
Indeed, when I use :
HAL_SPI_Transmit_IT(&hspi1, buff, 2);
(or any other SPI_Transmit) instead of :
SPI1->DR = buff[0]
SPI1->DR = buff[1]
It appears that it makes my overall CPU consumption is way more higher, because I think HAL stop the SD card driver, continuously reading data in my while(1).
Do you have a idea on how to send data via SPI without using HAL_transmit, but still using the interrupt HAL_SPI_TxCpltCallback ?
Thanks a lot, have a nice day!
Jean
2021-03-16 09:14 AM
PS: I've tried this method :
SPI1->DR = buff[0]
SPI1->DR = buff[1]
SPI1->CR2 |= SPI_IT_TXE;
But it's hardfaulting ...