Skip to main content
This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
February 12, 2022

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?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Shilpashree Madhu
Associate III
February 12, 2022

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?

Tesla DeLorean
Guru
February 12, 2022

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.

https://community.st.com/s/question/0D53W00001MZtkvSAD/what-does-the-expected-crc-value-mean-in-crc-how-to-calculate-it

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