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.

Library

Read more about new HAL libraries

Features

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

Dependencies

  • HAL
  • TM
    • STM32Fxxx HAL
    • defines.h

Functions and enumerations

Example

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

tilz0R

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...