SPI DMA variable data length
Hi,
I'm working with stm32H743zi (Nucleo-144) ,
I have a device that transmitting data via SPI to my stm32H7, the problem is that the device sending data with a variable length that I have no idea about it and there is no way to receive the length before .. the only thing that I know is the maximum data length that could be received
so I decided to work with the CS porting it to an EXTI (interrupt), and according to that I will turn on/off the dma receiving
I will define a static buffer with the maximum data size , then for every interrupt I will use the two commands:
HAL_SPI_DMAStop(&hspi1)
//TODO: need to memcpy the buffer to another one
//start a new recieving
HAL_SPI_Receive_DMA(&hspi1, mybuff, maximum_size)
the question is, how I could pull the data from the DMA buffer after DMA stop and I need to know the total count of bytes that have been used in the given buffer
I appreciate your suggestions ...
