cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F1 SPI CRC error flag not cleared

sb616
Associate

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.

1 REPLY 1

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..