Hello Mitja Jež,
Thanks for your feedback. You're right normally STM32CubeMX gives both possibilities to Enable and Disable the Default Polynomial State for STM32L412K8Ux MCU.
I will report your feedback internally to be reviewed and checked. I will keep you posted.
Thanks again for your contribution.
> For STM32G071 it allow me to disable default, but it force on some value (probably default) - it does not allow to enter our own.
In fact, by disabling the Default Polynomial State, CubeMX will automatically gives you the possibility to configure two other parameters:
CRC Length: This parameter the indicates CRC length, it can be one of the following values:
- 7-bit long CRC (generating polynomial of degree 7)
- 8-bit long CRC (generating polynomial of degree 8)
- 16-bit long CRC (generating polynomial of degree 16)
- 32-bit long CRC (generating polynomial of degree 32)
CRC Generating Polynomial:
It should respect this format : Xa+Xb+...+Xc+X0.
where a,b,c are the powers of the polynomial :
- a,b,c must be less than chosen degree .
- The polynomial must contain X0.
No need to indicate the highest polynomial degree as it is deduced from the CRC Length
Set CRC generating polynomial as a 7, 8, 16 or 32-bit long value for a polynomial degree respectively equal to 7, 8, 16 or 32. This field is written in normal representation, e.g., for a polynomial of degree 7, X^7 + X^6 + X^5 + X^2 + 1 is written 0x65.
(As indicated in the screenshot above the generated GeneratingPolynomial will be in decimal 32773 => 0x8005)
Hope that I answer your question.
Khouloud.