DE2 のマニュアル(177 ページ)を調べたところ、たとえばパテと USB-to-シリアル ケーブルを介してボードにシリアル通信を行うことができるはずなので、マニュアルからプログラムを取得しました。 :
/* A simple program that recognizes the characters 't' and 'v' */
#include <stdio.h>
#include <string.h>
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;
}
Nios2 ハードウェアとして実行しようとしましたが、uart を使用するように std i/o を構成すると、このメッセージが表示されます。
nios2-terminal: can't open uart: No such file or directory
そして、端末プログラム(パテシリアル接続)に接続すると、接続しません。私は何を間違っていますか?プロジェクトのプロパティで std i/o を uart に変更しようとしましたが、それは役に立ちませんでした。手伝って頂けますか?