STM32-如何处理UART中的框架和噪声错误?

发布于 2025-02-10 05:06:16 字数 252 浏览 3 评论 0原文

我正在使用DMA在UART RX中接收数据,因此我需要将其置于断开连接。现在,有时我可以在断开连接后恢复通信,但是我需要始终恢复。

使用调试器,我意识到Huart1.ErrorCode将其值从0更改为0到2,4或6。我想它们是噪声,帧和噪声+帧(?)错误,并且在此错误之后,UART停止了。

如何通过我的HAL_UART_ERRORCALLBACK和RESUME UART通信处理此错误?

谢谢你!

PD:STM32F407VET6

I'm receiving data in UART Rx with DMA and I need to make it inmunne to disconnections. Now, sometimes I can recover the communication after a disconnection, but I need to recover it always.

Using the debugger I realized that huart1.ErrorCode change its value from 0 to 2,4 or 6. I guess they are noise, frame and noise+frame(?) errors, and after this error the UART stops.

How can I handle this error with my HAL_UART_ErrorCallback and resume UART communication?

Thank you!

PD: STM32F407VET6

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文