CRC check for received data through UART
I am sending/receiving data using UART between STM32G4 board and other board. While I am sending the data I am adding the CRC and transmitting it through UART to other board. While receiving how do I check the CRC correct or not.
For Eg: From other board to my STM32G4 board I recivedata frame is as below
header | Length | Command | Data | CRC | EOF |
0x32 | 0x05 | 0x17 | 0x00/0x01/0x02 |
| 0x89 |
how do I check the CRC is correct or not in the coding?
Do I need to calculate crc for all 3 possible data values and compare the possible crc with received crc?
is this correct way. Can anyone suggest how to check the CRC.
Thanks
