- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I've read through the posts in this section and I can't find something that addresses this apparently simple issue. If this has already been discussed elsewhere I apologize for my poor search skills. I am running a bare metal application run off an SD card on the CycloneV SoCKit board. I am using a Qsys built system with many custom video modules and filters. The FPGA portion works correctly, there is communication to the hardware modules though the MM interfaces and the debug messages sent through the UART show fine in a terminal. However, I am unable to receive anything sent from the PC to the board through the UART. I would expect a character to be read at the very least if the port is polled continuously, but no data ever arrives on the UART. Is a driver required for the correct use of getc()? Here is a simple test showing the problem:# include <fcntl.h># include <stdio.h># include <string.h># include <inttypes.h>
int main(void)
{
// Vars
int length = 0;
char c;
int length;
char packet_in_b64;
// Welcome
printf("== SOC Kit UART Test === \r\n"); // This shows correctly on the terminal
// Loop
while(1){
c = getchar();
if( c != 255 ){
packet_in_b64 = c;
printf( "char: %2x, length:%d r\n", c, length ); // Never shown
}
}
}
The possibilities I have thought about are: - Damaged FTDI module. Seems unlikely since board->PC communication works
- Missing driver? I would have thought that even without an interrupt handler, or advanced register configurations, the default settings would allow getchar to receive data.
- The value that is always received is eof (http://www.cplusplus.com/eof). Which indicates a failure of some sort.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start ---
- Missing driver? I would have thought that even without an interrupt handler, or advanced register configurations, the default settings would allow getchar to receive data.
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