SPI Rx DMA with variable length data
I am using an STM32G474. I am setup as an SPI slave and have the DMA setup with the SPI to receive data. The SPI master will be sending a variable length of data. I would like the DMA to finish and call the callback function when the CS pin goes high. However, the callback function is only called when I receive the amount of data I asked for or a timeout occurs. I don’t know how much data will be coming, so I can’t rely on that, and a finding an appropriate timeout value doesn’t seem possible. (Data is coming every 5ms. If I set the timeout to short, I will cut off data in middle of the packet, and if I make the timeout too long, I will start to get the next packet before the timeout ends.)
Is there a way to setup the SPI Rx to generate a callback when the CS pin goes high?
thanks in advance,
Brent