Hi, I'm new about Quartus II & NIOS II.
I made hardware part using sopc builder (nios II cpu, sdram, on-chip mem,
jtag, sysid, and so on)
and composed c source code for software part.
I want to get right output data from 'printf' function
and test1.txt file from 'fopen, fprintf, fclose' function
,but i didn't get any right result.
How can I solve this problems?
================================================== =====
#include <stdio.h>
#include <unistd.h>
#include "system.h"
#define DEBOUNCE 10000
int main()
{
int input_data = 0x0001;
int output_data;
FILE *fp;
IOWR(SDRAM_0_BASE, 0, input_data);
output_data = IORD(SDRAM_0_BASE, input_data);
printf("output data = %d\n", output_data);
fp = fopen("C:\test1.txt", "w");
fprintf(fp, "%d", output_data);
fclose(fp);
return 0;
}
================================================== =====
Thanks in advance.


Reply With Quote


Bookmarks