Library 47- CRC module on STM32F4

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

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



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


    • STM32F4xx
    • STM32F4xx RCC
    • STM32F4xx CRC
  • TM
    • defines.h

Functions and enumerations


Project available on Github, download library below.

TM STM32F4 CRC Library


Owner of this site. Also electronic enthusiasts, web developer, 3D printer fan, handball player and more. Big fan of STM32F4 devices. In anticipation of the new Discovery board for STM32F7 lines.

You may also like...

Read before commenting!

Before you make a new comment, make sure you agree with things listed below:

  • - Read post to make sure if it is already posted what you are asking for,
  • - Make sure you have the latest version of libraries used in your project,
  • - Make a clean and grammatically correct written message,
  • - Report as many details as possible, including what have you done so far,
  • - Do NOT post any code here. Use Pastebin,
  • - Do NOT post any error codes here. Use Pastebin,
  • - Specify STM32Fxxx family and used Discovery/EVAL/Nucleo or custom made board,
  • - Make sure your clock is set correct for PLL,
  • - If you are using my HAL drivers, please check this post how to start.
Comment will be deleted on breaking these rules without notification!
  • JoHak

    Where is page 47-RS-485 implementation for STM32F4?
    Code from this page is wrong?

    • It is not anymore available,

      • JoHak

        And Your Code is wrong? I downloaded (30.12.2014) the previous site including code. I use the code as a basis for my project?

  • Pingback: All STM32F4 libraries - STM32F4 Discovery()