2022-02-11 11:33 PM
2022-02-11 11:38 PM
A byte at a time?
Does the data have form and structure? Can you process it a stateful fashion into an array, performing the checksum or CRC as it goes?
2022-02-11 11:51 PM
Yes, a byte at a time.. it should consist of frame format like this [SOF|DATA_LEN|DATA_WITH _CRC|EOF],
I'm sending data from Terminal to MCU using UART , and receive the transmitted data and write it in to flash memory...
So am not using any CRC for this transmission, now I've to include CRC for both sending & receiving part, how should I configure it?
2022-02-12 06:28 AM
The UART peripheral doesn't manage the structure or CRC, it is simply going to pull bytes off the wire, you'd need to collect and assemble/accumulate those bytes.
If the connection is interrupted or otherwise gets out-of-sync you'll need to recognize the SOF/EOF and resynchronize the stream.
The CRC is recomputed in the same manner it was generated, and compared for validity. Like two people doing a math problem separately and then comparing answers at the end. If you have the same solution to the complex problem, the probability is high that the data is the same.