Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12453 Discussions

Problem using UART port with serial device

Altera_Forum
Honored Contributor II
826 Views

Hi, 

 

My configuration: 

-Altera cycloneV socDevKit 

-Linux kernel : 3.9.0 and debian filesystem from this rocketboards project : http://www.rocketboards.org/foswiki/projects/debian 

 

I'm trying to communicate with a serial GPS module (4800 8N1) plugged on the UART mini USB port. But I can't read data from the device. 

It works fine when I use a PC with a terminal. I even disabled the login prompt in /etc/inittab to directly read data send from the device but nothing happend. 

 

Anyone have solution ? 

Maybe a driver problem or tty settings ? 

Use HPS USB port could be better ? 

 

 

Thanks.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
133 Views

Hi, 

 

since you're using Linux, is it possible that cooked mode makes problems? If you just open a /dev/ttyWhatver port, it is configured in cooked mode by default. That would explain why you cannot read: your OS buffers all input and holds it back until a termination character arrives, but probably your device does not send such a character. The "PC with a terminal" you mentioned probably uses raw mode by default. 

 

Info about raw/cooked modes: http://stackoverflow.com/questions/13104460/c-confusion-about-raw-vs-cooked-terminal-modes (http://stackoverflow.com/questions/13104460/c-confusion-about-raw-vs-cooked-terminal-modes

What helped me to solve that in C/C++ (I assume you want to solve the problem in a C/C++ program since you posted it here): http://stackoverflow.com/questions/6947413/how-to-open-read-and-write-from-serial-port-in-c (http://stackoverflow.com/questions/6947413/how-to-open-read-and-write-from-serial-port-in-c

 

 

Best regards, 

GooGooCluster
Reply