title: STM32F4 UART HAL Driver
body: <p>I'm trying to figure out how to use this new HAL driver. I want to receive data using the <code>HAL_UART_Receive_IT()</code> which sets up the device to run an interrupt function when data is received. </p>
  
  <p>Problem is that you have to specify the length of data to read before the interrupt triggers. I plan on sending console like commands of varying length so can't have a fixed length. I assume the only way to do this would be to read single characters at a time and build up a separate string.</p>
  
  <p>The HAL driver seems to have a problem where if you set the <code>HAL_UART_Receive_IT()</code> to receive <code>x</code> number of characters, and then try to send more than <code>x</code> characters, there will be an error.</p>
  
  <p>Currently I have no idea if I'm going about it the right way, any ideas?</p>