HAL library 10- CRC for STM32Fxxx

STM32Fxxx devices have CRC (Cyclic Redundancy Check) module inside. This is small and useful unit when working with communications. It might become very useful to verify if your packet of data is correct.

STM32Fxxx devices uses “Ethernet” CRC with polynomial below:

X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10 +X8 + X7 + X5 + X4 + X2 + X +1

It is quite ugly 😀 Well, using this module is very easy. I’ve made some functions to calculate CRC from block of data.


Read more about new HAL libraries


  • Calculate CRC data from 8-bit data block
  • Calculate CRC data from 16-bit data block
  • Calculate CRC data from 32-bit data block


  • HAL
  • TM
    • STM32Fxxx HAL
    • defines.h

Functions and enumerations


Project is available on my Github, download all libraries below.


Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

You may also like...