Problems reading SSI encoder devices using SPI Master RX only on STM32F405RGTx
I got an angle encoder with SSI interface, which is Synchronized Serial Interface. The output data is 21-bit. No CS signal is needed.
I have implemented using SPI1 master mode RX only reading this encoder, with SPI_CLK as the serial clock and SPI_MISO for data input. The data size to read is set to 3 bytes, but the clock is transmitted one more byte as intended. HOW DID THIS HAPPEN? Does the SPI send a dummy address on receiving?
The clock is generated immediately upon calling
__attribute__((aligned(4))) uint8_t raw_angle[16] = {0};
HAL_SPI_Receive_IT(&hspi1, raw_angle, 3);The data captured by logic analyzer:

The CubeMX setting is as below:

I found that SPI_SR_RXNE is left triggered after 3 bytes read by the HAL API, so I have to clear the flag before calling HAL_SPI_Receive_IT.
while((SPI1->SR & SPI_SR_RXNE)){
SPI1->DR;
}
HAL_SPI_Receive_IT(&hspi1, raw_angle, 3);
I have also tried DMA mode using HAL_SPI_Receive_DMA(&hspi1, raw_angle, 4) , but no luck of success. The DMA hits HAL_SPI_ERROR_FLAG error. The CubeMX setting is as below:

It is said that it's bad practice using DMA for small amount of data, but I still want to know how to get it work. Anyone could help? Thanks a lot.
