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 data frame is as below
SOF 0x32
Length 0x05
Command 0x14
Data 0x00/0x01/0x02
CRC CRC EOF 0x05
how do I check the CRC is correct or not in the coding? Do I need to calculate crc for all 3 possible data and compare the possible crc with received crc?is this correct way. Can anyone suggest how to check the CRC.
Thanks