2021-05-05 05:01 AM
I am using HAL_UART_ErrorCallback() function to capture any error.
When I reset the the board by cutting the power off everything works fine. But if I reset it with reset button or software reset one of the uart freezes and I don't see any error. I have checked the error flags nothing in that too.
I tried interrupt based reception without DMA and it doesn't freeze. So its the issue with the DMA but I am not getting any error.
2021-05-05 05:20 AM
With 9-byte packets you might need to resync the data stream
You'll want to look at how you're restarting each DMA transaction.
Dump the related DMA and UART status registers to see if you can determine a failure mode.
2021-05-09 10:58 PM
I am using DMA in circular mode and I just check the headers if the data is in correct order and then I process it. IS there something wrong in this approach?
2021-05-10 01:43 PM
2021-05-10 02:15 PM
Sounds fine as long as you don't lose or gain a byte, or otherwise lose sync if the sensor resets or has some issue.
Robustness of any given approach is judged by how it manages failure, not optimum conditions.
2021-05-11 11:10 PM
Yes. UART error flags.
2021-05-11 11:11 PM
@Community member Thanks. That makes sense. I am trying now with idle line detection to start and stop DMA.