Skip to main content
Visitor II
September 25, 2024
Question

STM32F1 SPI CRC error flag not cleared

  • September 25, 2024
  • 1 reply
  • 1421 views

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.

    This topic has been closed for replies.

    1 reply

    Graduate II
    September 25, 2024

    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.