cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX CRC polynomial can't be entered

frackers
Senior
Posted on August 20, 2016 at 12:21

Running 4.15 and as a programmer I really don't need this Xa+Xb rubbish.  Can we just have a decimal (or preferably) an hex field?

If it is going to have something clever like this then at least make sure it works. There are just so many things wrong with the implementation.

The CRC16 CCITT poly is x16+x15+x5+1 but according to the help, for a 16 bit poly the highest value must be LESS than 16. 

So I tried entering x15+x14+x4+1 (and without the +1) thinking that the bits were numbered differently but still no go. In fact it doesn't accept any values :(

#crc #stm32cubemx #polynomial
3 REPLIES 3
Walid FTITI_O
Senior II
Posted on August 22, 2016 at 12:26

Hi frackers,

I have submitted your request to our CubeMx team. Meanwhile, you can follow the example ''CRC_UserDefinedPolynomial'' in the

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef3.html

at this path: STM32Cube_FW_F3_V1.6.0\Projects\STM32303C_EVAL\Examples\CRC\CRC_UserDefinedPolynomial

This example example exaplain how to change the� GeneratingPolynomial� parameter by a defined macro.

 -Hannibal-
6740493
Associate
Posted on August 30, 2016 at 13:47

Hello. You can use X12+X5+X0 for CRC-16-CCITT (x^16+x^12+x^5+1) because:

''The polynominals present as a binary representation, with the high order bit inferred as it's always one and just beyond the scope of the register.

So 0x07 -> 0x107 -> x^8 + x^2 + x^1 + 1''

Please see: STe2eCommunities > Microcontrollers > STM32 Software Tools and Firmware > ARM SPI CRC Definition Polynomial Structure.

0690X00000602ckQAA.jpg

Jeanne Joly
Senior III
Posted on November 07, 2016 at 14:03

Hello 

frackers and 

mychko.maksim,

Thank you for your feedbacks.

We do agree that the comments on CRC generating polynomial are not clear enough.

We decided to modify some comments and renamed the polynomial size parameter, I hope it will be clearer.

This modification will be added in CubeMX4.18.

BR

Eric Dampierre