-1
\$\begingroup\$

I used stm32cubemx for template generation. When I configure SPI in cube, it set CRC polynominal X1+X3 (1010 in decimal its 10 =) ). SPI use 16 bit length word and I think it polynominal not be suitable for this solutions.

I was told that the polynomial should be odd. Or rather, should be 7. In the HAL guide, I have not found information about this. I only know that the checksum will be calculated through CRC 16. Data buffer will be array of four word + crc16 word. Totally 5 words(80 bits).

What is the correct value? Is the default polynomial set right to the default?

\$\endgroup\$
  • \$\begingroup\$ The Wikipedia page has a list of commonly used CRC polynomials. You should use one of these unless you have a really good reason to use another. It seems that they are all odd. en.wikipedia.org/wiki/Cyclic_redundancy_check \$\endgroup\$ – Mattman944 May 17 at 16:47
  • \$\begingroup\$ But why is this value used by default? \$\endgroup\$ – Alexey May 17 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.