2023-02-16 02:03 AM
Hello to all,
I am using a STM32H743 and create a SPI master (SPI4) and a SPI slave (SPI2). I have connected the pins used (including NSS). For receiving and transmitting I use DMA in both parts, master and slave.
The configuration was done with STM32CubeIDE (1.11.2) and I use the ST HAL drivers.
Additionally the master and slave instance run in their own freeRTOS threads.
When I use the SPI without CRC, everything works fine.
When I enable the CRC, I always get CRC errors. For testing I send only one byte in each direction. When I look into the SPI registers, the RXCRC and TXCRC registers for SPI2 and SPI4 hold different values. It looks like the CRC of SPI2 is truncating the calculated CRC value.
Here is my configuration
Here are the values on the bus, the first byte is the payload for testing (master sends 0x02, slave 0x03):
When I get the error callback, I get these values back:
My expected crc values are 0x2042 for payload 0x02 and 0x3063 for payload 0x03.
SPI4 calculates the correct values, but SPI2 seems to truncate the leading byte.
I also switch to SPI1, and swap the roles of the SPI (master <-> slave), but it's always the same problem.
Does anyone have similar problems? Or am I doing something wrong with the configuration?
Could there be a problem with the 32 bit or 16 bit crc unit?
2023-02-17 07:07 AM
Hi @Thorsten Gütle
The forum moderator had marked your post as needing a little more investigation and direct support. An online support case has been created on your behalf, please stand by for just a moment and you will hear from us.
Regards,
Billy