STM32 DMA串口发送 频繁进FIFO错误中断

所属分类:STM32F系列 浏览数:1383 提问者:煜寒.H 提问时间:2017-07-13

问:

STM32F407ZET6的片子,采用DMA进行串口发送,DMA部分相关固定配置如下: DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;// DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;//外设按照字节操作 DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;//DMA字节操作 DMA_InitStructure.DMA_Mode = DMA_Mode_Normal; DMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh;//DMA_Priority_Medium;//优先级 DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable; DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;//FIFO的域值设定 DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;//增量突发传输设置 DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; DMA在发送中断中,置完成标志位,下次发送时检查该标志位,发送完成则再次发送。 发送能正常发送,发送完成中断也能正常进,但每次发送时都会先进FIFO错误中断。


答:在配置完DMA之后,再使能串口触发DMA发送 该问题即可解决 每次DMA发送之侯,下次发送之前 关闭一下 串口触发DMA发送,使能DMA之后再将使能打开
回答者:heluo1985 回答时间:2018-05-28

登录后回答。
图书推荐
STM32 HAL库开发实战指南

STM32 HAL库开发实战指南

基于野火挑战者F7开发板和HAL库,全书共980页,全书由浅入深,步步为营,有广度也有深度。
Beginning STM32: Developing with FreeRTOS, libopencm3 and GCC

Beginning STM32: Developing with FreeRTOS, libopencm3 and GCC

Using FreeRTOS and libopencm3 instead of the Arduino software environment, ...
Programming With STM32 : Getting Started With the Nucleo Board

Programming With STM32 : Getting Started With the Nucleo Board

Get up and running programming the STM32 line using the hands-on information ...
广告