Hi guys

Is anybody knows about crc16 in stm32f4 ? Is this have any crc16 calculator like crc32 ?

thank you

Is anybody knows about crc16 in stm32f4 ? Is this have any crc16 calculator like crc32 ?

thank you

Hi guys

Is anybody knows about crc16 in stm32f4 ? Is this have any crc16 calculator like crc32 ?

thank you

Is anybody knows about crc16 in stm32f4 ? Is this have any crc16 calculator like crc32 ?

thank you

- the results i am getting from the STM32f40
**crc**are not according to the crc calculation from the website http://ghsi.de/CRC/index.php

the data input i used is: 0xF0033431

the checksum STM32F40 gives:0x0A401253

the checksum according to website calculator: 0x**CD44CF28**

the polynomial that is used is fixed according to CRC32 i.e. 0x4C11DB7.....

Can anyone please help me? **the question that is troubling me is :::why is the checksum of stm32 and the checksum calculated from the website (link given above) different. ??**

**looking forward to your reply**

Because neither you nor the web site guy grasp that the STM32 CRC32 is incongruent with byte operation, that the shift direction and endianess alter it's behaviour. The STM32 F1/F2/F4 CRC computation works on 32-bit WORDS ONLY.

Sequence STM32 implements (byte level equivalent operation)

crc = crc32byte(crc, byte[3]);

crc = crc32byte(crc, byte[2]);

crc = crc32byte(crc, byte[1]);

crc = crc32byte(crc, byte[0]);

crc = crc32byte(crc, byte[7]);

crc = crc32byte(crc, byte[6]);

crc = crc32byte(crc, byte[5]);

crc = crc32byte(crc, byte[4]);

..

Linear sequence expected by most online testers

crc = crc32byte(crc, byte[0]);

crc = crc32byte(crc, byte[1]);

crc = crc32byte(crc, byte[2]);

crc = crc32byte(crc, byte[3]);

crc = crc32byte(crc, byte[4]);

crc = crc32byte(crc, byte[5]);

crc = crc32byte(crc, byte[6]);

crc = crc32byte(crc, byte[7]);

..

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/DispForm.aspx?ID=15791&RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FCRC%20computation- thanks a lot for the help and the algorithm stm32 uses.

but i still am having a problem. if i this 32 bit number 0xF0033431... for this 32 bit number the STM32 generates the checksum=0x0A401253....what should be the 32bit number that i should user for the online calculator inorder to get same checksum??

i will be very thankful to you for the help. - thanks a lot for the help and the algorithm stm32 uses.

but i still am having a problem. if i have this 32 bit number 0xF0033431... for this 32 bit number the STM32 generates the checksum=0x0A401253....what should be the 32bit number that i should use for the online calculator inorder to get same checksum??

i will be very thankful to you for the help. **what should be the 32bit number that i should use for the online calculator inorder to get same checksum??**

Can you?

The online calculator assumes a ZERO initial state, the STM32 resets to all ONES`printf("%08X\n\n",Crc32Fast(0xFFFFFFFF, 0xF0033431));`

`0A401253`

`printf("%08X\n\n",Crc32Fast(0x00000000, 0xF0033431));`

`CD44CF28`

You could do a similar thing by feeding 0xFFFFFFFF, then 0xF0033431 into your STM32 test.

Or the online

Poly 100000100110000010001110110110111

Data 46AF6449 F0033431

$ a401253 (hexadecimal)

% 00001010010000000001001001010011 (binary)

! 171971155 (decimal)

QED

Is anybody knows about crc16 in stm32f4 ? Is this have any crc16 calculator like crc32 ?

It does not, the 32-bit one it supports is one of a myriad of polynomial and direction combinations. It has limited usefulness, being 32-bit only, and endian incompatible with the platform it's bolted too.

Your specific 16-bit CRC will need to be implemented in software. These can be done quite efficiently with tables, but it depends on the polynomial and the shift direction of the register and the data bits.

The STM32F303 has a more flexible CRC peripheral.