Question
UART FIFO error using DMA with FIFO disabled?
Posted on May 04, 2015 at 21:45
Hi folks,
I'm trying to figure out how to resolve this w/out having to abandon DMA. Any suggestions are most appreciated. The problem seems to be provoked by a slightly larger write to the UART (which is using DMA.) My slightly larger I mean about 250 bytes vs. about 60 bytes. The spot I trap this in the code is at line 7 below (in procedure void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma) instm32f4xx_hal_dma.c.)
/* FIFO Error Interrupt management ******************************************/
if(__HAL_DMA_GET_FLAG(hdma, __HAL_DMA_GET_FE_FLAG_INDEX(hdma)) != RESET)
{
if(__HAL_DMA_GET_IT_SOURCE(hdma, DMA_IT_FE) != RESET)
{
/* Disable the FIFO Error interrupt */
__HAL_DMA_DISABLE_IT(hdma, DMA_IT_FE);
/* Clear the FIFO error flag */
__HAL_DMA_CLEAR_FLAG(hdma, __HAL_DMA_GET_FE_FLAG_INDEX(hdma));
UART TX is configured (using STM32CubeMX) to use DMA2_Stream6 andDMA_CHANNEL_5. (I have manually changedMemInc toDMA_MINC_ENABLE until the next time I use MX to generate code.) When I break on the line listed above, the DMDIS field in S6FCR for DMA2 is 0 so (if I'm looking at the correct bit) this has not been accidentally enabled somewhere between initialization and getting to this point.
One thing that has me wondering is that I have RTS/CTS handshaking enabled. If the device I'm sending to drops CTS could it cause the problem? I would have expected this to be handled more gracefully but the problem may result from some misconfiguration in my code.
Thanks!
#uart-fifo-error-dma