Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 STM32 系列上启用 UART DMA 接收有什么要求?根据我的观察,如果 uart 接收数据寄存器中有任何陈旧数据,它将阻止 dma 在启用时启动(我相信因为没有新数据会触发 dma 中断以清除该字节并正常继续)。
如果在中断上下文中并在设置 dmar 位后接收到数据(即启用 uart dma 接收),退出中断后 dma 会清除该位还是会锁定 dma?如果是这样,如何在启用 dma 和退出中断上下文之间防止这种竞争条件(注意所有中断的优先级相同,因此在当前中断中有效地禁用了中断)。
尝试这个
RXNE
UARTx->SR
或者
CR1
RE
SR
DR