How to receive UART data with checksum value in stm32l4r5zi MCU?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-11 11:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-12 6: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.
Up vote any posts that you find helpful, it shows what's working..
