AnsweredAssumed Answered

HAL SPI DMA Problem by fail Transfer

Question asked by tntbc on Sep 30, 2016
Latest reply on Oct 4, 2016 by ForumSTM32.ForumSTM3
Hello, i hope you can help me.

I am using a stm32f303rct6 and activated the spi interface with dma. The Frame is 8 byte long. The tx an rx works pretty good. But now i am testing some error conditions. In this case, i send at the beginning a rising edge and after 10 ms the 8 byte frame. The spi detected the first rising edge a read the first bit (wrong) into the dr register and all the rest was wrote from the frame without the last bit. (this makes sense) But now is coming the mistake after this wrong frame. To receive an new frame i call the function again:
HAL_SPI_TransmitReceive_DMA(&hspi2,&usrCSpiWriteBuffer[0],&usrCSpiReadBuffer[0],USRCOM_PACKAGE_SIZE) != HAL_OK){ ...

But the HAL is not resetting the DMA or reset the spi bitcounter. The next received frame looks crazy. The frame has the last bit from the last frame and the rest of the new frame. How can i reset the dma or the spi to resolve this problem?

Please help me!
Thanks

Outcomes