message: fix UART error handling
diff: @@ -66,6 +66,7 @@ static void uart_server_thread(void * ctx) {
  if (huart4.ErrorCode != HAL_UART_ERROR_NONE) {
  HAL_UART_AbortReceive(&huart4);
  HAL_UART_Receive_DMA(&huart4, dma_rx_buffer, sizeof(dma_rx_buffer));
  + dma_last_rcv_idx = 0;
  }
  // Fetch the circular buffer "write pointer", where it would write next
  uint32_t new_rcv_idx = UART_RX_BUFFER_SIZE - huart4.hdmarx->Instance->NDTR;
  @@ -96,7 +97,7 @@ void start_uart_server() {
  // We dont use interrupts to fetch the data, instead we periodically read
  // data out of the circular buffer into a parse buffer, controlled by a state machine
  HAL_UART_Receive_DMA(&huart4, dma_rx_buffer, sizeof(dma_rx_buffer));
  - dma_last_rcv_idx = UART_RX_BUFFER_SIZE - huart4.hdmarx->Instance->NDTR;
  + dma_last_rcv_idx = 0;
  // Start UART communication thread
  osThreadDef(uart_server_thread_def, uart_server_thread, osPriorityNormal, 0, stack_size_uart_thread / sizeof(StackType_t) /* the ascii protocol needs considerable stack space */);
  