cancel
Showing results for 
Search instead for 
Did you mean: 

How to compute for the same CRC32 that the ST-LINK utility tool is calculating?

raullette
Associate II
Posted on January 19, 2017 at 08:47

Hi,

I'm developing a customized SPI Bootloader code. I plan to use CRC32 in verifying the programmed application code. I used this link as a reference for my CRC32 calculator C-code function in the Bootloader:

https://github.com/joeferner/stm32-spi-bootloader/blob/master/src/spi-bootloader.c

 

http://www.ipgp.fr/~tuchais/earthworm/v6.3/src/data_sources/naqs2ew/crc32.c

 

But, the values that I get when I use that function isn't the same to the ones I get when I load the hex or bin file to ST-Link. ST-Link is showing different CRC32 values.

On the other hand, when I use online tools such as:

http://www.fileformat.info/tool/hash.htm

 

http://esrg.sourceforge.net/utils_win_up/md5sum/

 

I am getting the same CRC32 values with my C-code function.

Is ST-LINK using a different algorithm (but in the user manual, it says that it's using CRC32)?

Any insights is appreciated!

Thanks,

#stlink #crc32 #stm32
1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee
Posted on January 23, 2017 at 12:28

Hello

Solomo.Mary_Raullett

,

Indeed, ST-LINK Utility is using a different algorithm than CRC32 (to use the algo as STVP too)

The algorithm used in ST-LINK Utility is a simple add operation byte by byte.

Moreover, y

ou are right about the CRC32 algorithm is mentioned in the User Manual as it is supported at first, and then we’ve c

hanged it to much with STVP’s algorithm.

Therefore

, t

he User Manual will be updatedin coming version to add the missed information.

Hope this helps you and thank you for your contribution.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

1 REPLY 1
Imen.D
ST Employee
Posted on January 23, 2017 at 12:28

Hello

Solomo.Mary_Raullett

,

Indeed, ST-LINK Utility is using a different algorithm than CRC32 (to use the algo as STVP too)

The algorithm used in ST-LINK Utility is a simple add operation byte by byte.

Moreover, y

ou are right about the CRC32 algorithm is mentioned in the User Manual as it is supported at first, and then we’ve c

hanged it to much with STVP’s algorithm.

Therefore

, t

he User Manual will be updatedin coming version to add the missed information.

Hope this helps you and thank you for your contribution.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen