AnsweredAssumed Answered

STM32F103 UART DMA(RX AND TX) can execute only once ,

Question asked by name_is_honglingjin on Jul 2, 2015
Latest reply on Jul 2, 2015 by Clive One
Hi:
  i use the DMA interrupt to send 8 byte data and receive 9 byte,it can only executes once,but when i debug it step by step,it works well。i'm so confused.Sorry for my poor english.
Here is my code,is there something important i miss?Thank you for your patience

 
void DMA1_Channel4_IRQHandler(void)   /* DMA TX ,interrupt after all the datas send over*/
    DMA_ClearFlag(DMA1_FLAG_TC4);       
    DMA_ClearITPendingBit(DMA1_IT_TC4);
    DMA_Cmd(DMA1_Channel4,DISABLE);   
}
 
 
 
 
void DMA1_Channel5_IRQHandler(void) 
    DMA_ClearITPendingBit(DMA1_IT_TC5);
      
    DMA_Cmd(DMA1_Channel5, DISABLE);                                /*Enable DMA RX*/
    DMA_SetCurrDataCounter(DMA1_Channel5,9); 
    DMA_Cmd(DMA1_Channel5, ENABLE);
     
      /*
 
         here is data process, 9 byte datas
     */
     
    if(TempHumidity.AddressSelectFlag == 0)     /*  Uart_Send_Buffer is the buffer connected to USART1->DR*/
    {
        TempHumidity.AddressSelectFlag = 1;
        MemCopy(Uart_Send_Buffer,TempHumidity.UartSendBufferA,8);      
    }
    else
    {
        TempHumidity.AddressSelectFlag = 0;
        MemCopy(Uart_Send_Buffer,TempHumidity.UartSendBufferB,8);      
    }
     
    DMA_Cmd(DMA1_Channel4, DISABLE);        
    DMA_SetCurrDataCounter(DMA1_Channel4,8);   
    DMA_Cmd(DMA1_Channel4, ENABLE);                          /*Enable DMA TX*/
}






Outcomes