- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am having a problem reading data from an UART core. The incoming data should look like 0A 00 00 00 D6 00 0D but using getc(fp) or fgetc(fp) I only get the NOT_ZERO bytes 0A D6 0D This is my function:
INT8U prompt = 0;
INT8U i = 0;
FILE* fp;
fp= fopen(UART_BU_NAME, "r");
if (fp == NULL) {
fprintf(stderr, "open failed\n");
return;
}
i = 0;
while(prompt = fgetc(fp)){
i++;
printf("0x:%02X",prompt);
}
printf("\n\rCounted %d characters\n\r", i); //returns value 3 (instead of 7)
Am I using the wrong function? Since it only happens with 0 bytes, I tend to believe it has nothing to do with overflows/task priority, but only with the way how the data is interpreted. ==== LE ===== With SignalTap I was able to see a read request on AvalonMM bus from the RXDATA register with value 0x00...
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page