cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU crc calculation- STM32F407

mh2
Associate III

Hi everybody,

First, I'm sorry for my poor English.

I'm using STM32F407VET6 and I want to calculate 16bit CRC of Modbus RTU. Can anybody help me how I can use hardware CRC of the STM32F407? Is it possible to use hardware crc for modbus rtu? Or should I use software calculation?

Thanks

4 REPLIES 4

> Is it possible to use hardware crc for modbus rtu?

No, the hardware CRC in 'F407 has a fixed 32-bit data width and a fixed polynome. In newer STM32 there is a more flexible CRC unit, but not in the 'F4.

JW

Needs to be software on the F4, here are some examples of software/hardware implementations I built for the F3 years back.

The software methods can be compact and fast.

https://community.st.com/s/contentdocument/0690X0000060JWXQA2

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks so much

Thank you, I investigated your code and I have a few questions:

what is the difference between for example CRC_MODBUS16SlowBlock() and CRC_CRC16SlowBlock?

and the difference between CRC_MODBUS16SlowBlock() and CRC_MODBUS16QuickBlock() for example? Are they have different results? and if the results are different, which one should i use?

Thanks again Tesla DeLorean.