2009-08-18 09:01 PM
SPI DMA with CRC Question
2011-05-17 04:20 AM
Hi,
I developing a high speed SPI connection between 2 STM32 chips. I would like to use the CRC feature. I got the SPI master connection working with DMA (Tx channel). When the DMA is completed it automatically sends the CRC byte per spec. On the other chip I got the SPI slave connection working with DMA (Rx channel) too, but I can't seem to get it to automatically send the CRC when the master is sending its CRC. I checked the control register and everything is what it is supposed to be (CRCEN=1), and the DMA interrupt fires when the DMA is finished receiving the last data byte, but it does NOT send the CRC byte, like the master does. I have two questions: 1 - Do I have to setup a Tx DMA channel on the slave side to get the SPI to automatically send the CRC byte ? I am not using it right now because the slave has nothing to send while it is receiving bytes from the master. 2 - There is a warning in the spec sheet about mixing SPI DMA and IRQs. I start out each transmission with an RX interrupt. Once the SPI IRQ determines everything is OK, it masks the RX IRQ, setups up DMA, and enables the DMA. The DMA proceeds, and when it is done it's IRQ fires and I disable DMA and ummask the RX IRQ to complete the protocol. Is this the way to do it ? Does anyone know anything about the internals of the peripheral ? I just can't seem to get enough information out of the reference manual to figure this out myself. Thanks, Phil2019-03-08 08:48 AM
no answer to be seen here.
2019-03-08 08:56 AM
Yeah, to a post from nearly a decade ago, congrats on poking a zombie, hope you don't catch anything...
ST's SPI + CRC implementation was implemented by someone with about zero comprehension of an actual use case, ditto the NSS functionality.