Forum Discussion
Altera_Forum
Honored Contributor
15 years agoNois CPU halt at fprintf
hi,everyone: I have to output information by UART in my project, When program loaded from FLASH(EPCS),then CPU halt at fprintf(),so do with getc(),fscanf(),but not fwrite(). but it is ok in de...
Altera_Forum
Honored Contributor
15 years agocode as following:
int main() { FILE *fp; char echo; fp = fopen(UART_0_NAME, "r+"); if (fp) { while (1) { echo = getc(fp); fwrite(&echo, 1, 1, fp); fprintf(fp, ">>\r\n"); // always stop here } } return 0; }