Restart SPI DMA Transmission
Hello,
I am working on a sensor device acting as a SPI slave with transmit only and without chip select signal. I am using a STM32G070 microcontroller.
I configured 4 bytes transmissions using DMA. The problem I have is that the external master can perform incomplete reads of any number of bits under the maximum of 32, so the next transmissions will be shifted.
I am using a timer to restart the SPI transmission so that the transmitted buffer is restarted after some time since the beginning of the first clock, but the SPI data is still shifted after incomplete reads.
What is the way to restart the transmission from the beggining of the buffer?
My current flow is:
1. Start 4 bytes transmission by DMA SPI
2. When the first clock is detected by EXTI, start the timer.
3. An incomplete read is performed by the external serial master (21 bits, for example).
4. The timer timeout is triggered.
5. The SPI transmission is aborted and started again. (HAL_SPI_Abort(), HAL_SPI_Transmit_DMA())
Thank you.
