feat[serial][v2]: add RX DMA event mode control#11487
Conversation
📌 Code Review Assignment🏷️ Tag: bsp_stm32Reviewers: Liang1795 hamburger-os wdfk-prog Changed Files (Click to expand)
🏷️ Tag: componentsReviewers: Maihuanyi Changed Files (Click to expand)
🏷️ Tag: components_driver_serial_v2Reviewers: Ryan-CW-Code Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-06-15 14:32 CST)
📝 Review Instructions
|
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
add serial v2 RX DMA event mode configuration for DMA-enabled builds support STM32 UART RX DMA half/full transfer interrupt policy selection validate RX DMA event mode before applying serial configuration restore serial configuration when backend configure fails
520b29c to
d2d4e13
Compare
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
Serial v2 在 RX DMA 模式下目前缺少统一的 DMA half/full transfer 事件策略配置。STM32 UART RX DMA 场景中,部分应用需要保留 UART IDLE 接收上报,同时减少 DMA half-transfer 中断,或显式选择 half/full transfer 上报策略。
该 PR 为 serial v2 配置增加 RX DMA event mode,并在 STM32 USART v2 驱动中按配置控制 RX DMA HT/TC 中断处理,使默认行为保持兼容,同时允许应用侧选择更低中断频率的 RX DMA 事件模式。
你的解决方案是什么 (what is your solution)
struct serial_configure中为 DMA 构建增加rx_dma_event_mode配置项,并在默认配置中使用RT_SERIAL_RX_DMA_EVENT_AUTO。rx_dma_event_mode,并在 backend configure 失败时恢复旧配置。请提供验证的bsp和config (provide the config and bsp)
bsp/stm32/<target-board>。RT_USING_SERIAL_V2,RT_SERIAL_USING_DMA,BSP_USING_UARTx,BSP_UARTx_RX_USING_DMA,以及对应 BSP 的 UART RX DMA 配置。manual_dist.yml或目标 BSP 编译 action 链接。]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up