2024-09-25 09:12 AM
Hi,
(Sorry, I'm not sure where best to post this)
After digging into issues with SPI hardware CRC on an STM32F103, it seems like the SPI HAL functions are not clearing the CRC flag before starting a new SPI transaction. I think they should be calling __HAL_SPI_CLEAR_CRCERRFLAG(hspi); at the start of any of the HAL SPI calls (e.g. HAL_SPI_Transmit, HAL_SPI_Receive, etc).
If not the flag will remain set forever and all of these calls will always return an error code, even if they were actually successful.
Thanks.
2024-09-25 10:13 AM
I can't say I've looked, but doesn't the CRC error come from a check-for-zero from the holding register, and not latch, and not use a comparator? Clear the CRC register.