2022-05-09 01:17 AM
I'm struggling to get the SPI CRCERR flag and IRQ to work the way I expect.
I am using an STM32WB55.
The SPI communication in full duplex is working. The master is adding the CRC to the end of the Tx data. On the slave side, the CRC is read in. I can see the RXCRC updating, and I can see it go to 0x00 when the final CRC byte is read, which tells me that the CRC calculation is working. However, I cannot get the CRCERR flag to turn on when I purposefully have a CRC mismatch (using different polynomials on master and slave to trigger a mismatch).
I suspect the issue is related to the DMA transfer sizes. I have read the advice about what length of transfer to use (Tx side = data length without CRC; Rx side = data length with CRC), and I have tried various combinations. I suspect that slave SPI does not know the transfer is done, so it does not do the final comparison and set the error bit.
So, some actual questions:
Thanks for any input.
Solved! Go to Solution.
2022-05-10 11:50 PM
Answering my own questions after reading the Ref Manual a few times...
2022-05-10 11:50 PM
Answering my own questions after reading the Ref Manual a few times...