2021-06-09 07:45 PM
SPI slave receives data of unknow size.
When SPI master gives a rising edge, SPI slave detects the rising edge and starts HAL_SPI_Receive_DMA(define a large size amount of data to be received). When SPI master gives a falling edge, SPI slave detects the falling edge and uses HAL_SPI_DMAStop to end the spi transfer.
But sometimes, the received data of SPI slave shifts 3 bytes. Does anybody know why?
2021-06-10 07:38 AM
So you're using a CS line that is active high?
Put a delay between the first edge and the first data being sent. The slave needs to be ready for the data prior to the first clock.