1 Reply Latest reply on May 22, 2019 4:30 AM by LePo_1062026

    UART DMA only transmitting a single byte

    huelc_264296

      Hi,

      I am trying to use DMA to transmit 10 bytes from the UART, but I am only seeing one byte.

       

      Image4.png

       

      As far as I can see, I am setting the transferCount to 10, so I should see 10 bytes.

      What am I doing wrong?

       

      Please find attached my project. Any help appreciated.

       

      const unsigned char packet_num_bytes = 10;
      unsigned char packet_out_buffer[256];
      unsigned char packet_in_buffer[256];

      void Configure_DMA()
      {
           CyDmaTdSetConfiguration( tx_td,                                          // Set up the Transaction Descriptor for 32-bit reads                            
                                    packet_num_bytes,                                // Length of transfer                            
                                    CY_DMA_DISABLE_TD,                                              // Works                            
                                    TD_INC_SRC_ADR);                                    

           CyDmaTdSetAddress(       tx_td,                            
                                    LO16((uint32) packet_out_buffer),                                         
                                    LO16((uint32) UART_TXDATA_PTR));

           CyDmaTdSetConfiguration( rx_td,
                                    packet_num_bytes,                  // DMA both the address and the data packet                            
                                    CY_DMA_DISABLE_TD,                            
                                    TD_INC_DST_ADR | DMA_RX__TD_TERMOUT_EN);         

            CyDmaTdSetAddress(      rx_td,                            
                                    LO16((uint32) UART_RXDATA_PTR),                            
                                    LO16((uint32) packet_in_buffer));
      }