2012-10-04 08:42 AM
Hi guys
Is anybody knows about crc16 in stm32f4 ? Is this have any crc16 calculator like crc32 ?thank you #reverse-polynomial #fire-codes2012-10-04 09:08 AM
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.
2012-10-09 08:07 AM
thank you clive1
2013-02-11 07:17 PM
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: 0xF0033431the checksum STM32F40 gives:0x0A401253the checksum according to website calculator: 0xCD44CF28
the polynomial that is used is fixed according to CRC32 i.e. 0x4C11DB7.....Can anyone please help me?2013-02-12 05:17 AM
Can anyone please help me?
Help you how? The STM32 processes 32-bit words, NOT bytes, and NOT little endian I've posted a number of software examples in the past.2013-02-12 05:34 AM
thank you for the reply.
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 reply2013-02-12 06:51 AM
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]); ..2013-02-12 09:59 AM
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.2013-02-12 10:24 AM
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.
2013-02-12 11:05 AM
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(''%08
X'',Crc32Fast(0xFFFFFFFF, 0xF0033431));
0A401253
printf(''%08
X'',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