title: STM32F4 HAL DMA UART TX
body: <p>I'm trying to get UART transmit working over DMA on an stm32f405. This part of my application is designed to send out text strings as a command line interface. I have the RX part of the UART working with DMA fine (using 1 byte circular DMA to handle anything that comes in) but the TX side is proving a little more tricky.</p>
  
  <p>I'm able to send out strings of data using: <code>HAL_UART_Transmit_DMA(&amp;handle, pData[], strlen(pData))</code> provided there is a delay between consecutive calls of the function. As soon as my program decides to send two strings one after another, the new data pointer is ignored.</p>
  
  <p>By using <code>while(HAL_UART_Transmit_DMA(...) != HAL_OK){}</code> I'm able to have the program wait the required time and send out consecutive strings.</p>
  
  <p>This works for a while (few tens of transfers), then gets stuck due to HAL_NOT_OK.</p>
  
  <p>For reference, my DMA settings are: <code>DMA2 stream 7</code>, <code>channel 4</code>, <code>mem to periph</code>, <code>periph inc disabled</code>, <code>mem inc enabled</code>, <code>mem and periph align byte</code>, <code>normal mode (not circular)</code>, <code>low priority</code>, <code>fifo disabled</code>.</p>
  
  <p>UART set to <code>9600 baud</code>, <code>8 bit word</code>, <code>1 stop bit</code>, <code>no parity</code>, <code>no hw control</code>, <code>16 oversampling</code>.</p>
  
  <p>I'm trying to figure out if using FIFO will help me out here, though I'm not totally sure if i understand it yet. If i wanted to send out a single byte of data, could i do it with FIFO? is there a 1 word min limit here?</p>
  
  <p>I have set up a <code>tx complete callback</code> that im not currently using. I did wonder if there are any flags I'd need to clear during this interrupt but not sure..</p>
  
  <p>Any help appreciated! </p>