STM32F2 USART1/6 DMA sends one string only

Comments

2 comments

  • Avatar
    Gordon Scott

    Incidental erratum on a comment.

    0 in DMA_BufSize doesn't cause a hard fault, it causes an assert fail.

    0
    Comment actions Permalink
  • Avatar
    Gordon Scott

    Looks like I have flags wrong. Those FEIFx flags are for DMA streams  not USARTs.

    I think the StdPeripherals example I started from was on USART3, which happens to be on Stream3. Doh!

    The flags clearing clip should have looked like the following, not as I had it.

                switch( (uint32_t)(pDevData->pUSART) )
                {
                case (uint32_t)USART1: flags = DMA_IT_FEIF7|DMA_IT_HTIF7|DMA_IT_TCIF7|DMA_IT_TEIF7; break;
                case (uint32_t)USART2: flags = DMA_IT_FEIF6|DMA_IT_HTIF6|DMA_IT_TCIF6|DMA_IT_TEIF6; break;
                case (uint32_t)USART3: flags = DMA_IT_FEIF3|DMA_IT_HTIF3|DMA_IT_TCIF3|DMA_IT_TEIF3; break;
                case (uint32_t)USART4: flags = DMA_IT_FEIF4|DMA_IT_HTIF4|DMA_IT_TCIF4|DMA_IT_TEIF4; break;
                case (uint32_t)USART5: flags = DMA_IT_FEIF7|DMA_IT_HTIF7|DMA_IT_TCIF7|DMA_IT_TEIF7; break;
                case (uint32_t)USART6: flags = DMA_IT_FEIF6|DMA_IT_HTIF6|DMA_IT_TCIF6|DMA_IT_TEIF6; break;
                }
     

    0
    Comment actions Permalink

Please sign in to leave a comment.