如何在STM32Cubemx中为DMA设置NVIC?

发布于 2025-02-12 00:17:19 字数 367 浏览 2 评论 0原文

我正在尝试通过DMA模式将STM32G070微控制器与Quectel BC660K-GL连接。我正在使用STM32Cubemx进行编程。我了解DMA如何工作的基本原理,因此 dma设置内的设置标签对我来说很清楚,但是我不明白 nvic设置标签,即检查或取消选中 USART1全局中断 / USART1通过Exti Line 25 < / em>唤醒中断(如图1所示): 图1:nvic设置 在线有很多教程,但我找不到有关此主题的更多信息。

I am trying to connect STM32G070 microcontroller with Quectel BC660K-GL via UART in DMA mode. I am using STM32CubeMX for programming. I understand basic principles how DMA works, therefore settings inside the DMA Settings tag are quite clear to me, but I don't understand the NVIC Settings tag, namely, should I check or uncheck USART1 global interrupt / USART1 wake-up interrupt through EXTI line 25 (shown in figure 1):
Fig.1: NVIC Settings
There is a bunch of tutorials online but I can't find more information about this topic.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝戈者 2025-02-19 00:17:19

如果您将DMA用于UART通信,那么DMA和UART互相交谈并决定何时加载/存储下一个数据字节。如果您想在某些USART事件发生时,例如接收到字节或框架错误或变速箱完成或其他情况,则需要中断USART中断。但是,如果您希望DMA处理沟通,则USART和DMA可以在不干预的情况下自行完成。实际上,中断根本不需要DMA起作用。它将知道何时加载/存储新数据,而不会中断。因此,USART中断是不必要的。

通常,这只是您感兴趣的DMA中断。由于DMA接管了发送/接收数据的控制权,因此DMA标志需要您的注意力 - 例如,转移完整或传输错误,例如。除非有一些特定的理由对某些USART事件做出反应,否则您不需要USART中断,而DMA也不需要。

If you use DMA for UART communication, then it is DMA and UART, who talk to each other and decide when to load/store next byte of data. USART interrupts are needed if you want to have an interrupt handler for UART for when some USART event occurs, such as byte received or frame error or transmission complete or other. But if you want DMA to handle the communication, USART and DMA can do it between themselves without your intervention. Interrupts are, in fact, not required at all for DMA to function. It will know when to load/store new piece of data without any interrupts. Therefore, USART interrupts would be unnecessary.

Normally, it is only DMA interrupts you would be interested in. Since DMA took over control over sending/receiving data, it is DMA flags that will require your attention - transfer complete or transfer error, for example. Unless you have some specific reason to react to some USART event, you don't need USART interrupts, and neither does DMA.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文