title: Why is my serial communication not working?
body: <p>I looked in the <a href="https://www.kth.se/social/upload/5033e824f2765444c1000008/ug_embedded_ip.pdf#page=177" rel="nofollow">manual</a> (page 177) for the DE2 and as far as I understand it should be possible to do serial communication for instance via putty and a usb-to-serial cable to the board, so I take the program from the manual:</p>
  
  <pre><code>/* A simple program that recognizes the characters 't' and 'v' */
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  int main ()
  {
  char* msg = "Detected the character 't'.\n";
  FILE* fp;
  char prompt = 0;
  fp = fopen ("/dev/uart1", "r+"); //Open file for reading and writing
  if (fp)
  {
  while (prompt != 'v')
  { // Loop until we receive a 'v'.
  prompt = getc(fp); // Get a character from the JTAG UART.
  if (prompt == 't')
  { // Print a message if character is 't'.
  fwrite (msg, strlen (msg), 1, fp);
  }
  if (ferror(fp))// Check if an error occurred with the file pointer 
  clearerr(fp); // If so, clear it.
  }
  fprintf(fp, "Closing the JTAG UART file handle.\n");
  fclose (fp);
  }
  return 0;
  }
  </code></pre>
  
  <p>And I try to run it as Nios2 hardware but then I get this message when I have configured std i/o to use uart</p>
  
  <p><code>nios2-terminal: can't open uart: No such file or directory</code></p>
  
  <p>And then when I connect with a terminal program (putty serial connection) it doesn't connect. What am I doing wrong? I tried in the propeties of the projet to change the std i/o to uart but that didn't help. Can you help me?</p>