New answers tagged serial-port
Someone on SO hinted in the right direction; the problem was with the baudrate, it was set to a different value than what I need. To check the baudrate: stty -F /dev/ttyUSB1 To set the baudrate: stty -F /dev/ttyUSB1 57600 (57600 in my case is the baudrate my device needs) It's working like a charm now.
Serial ports are especially weird beasts. You'll want to use an Old School terminal emulation program. I used to think tip was the best, but nobody seems to have the source for it any more. cu comes with UUCP, and it's a complete hassle to install and configure, don't even bother. A quick google around tells me that people tend to use minicom these days. ...
Since the problem is about the correct emulation of an ANSI terminal, I think the best option you have is to connect to the serial-to-USB converter with minicom. Just remember to open the serial device without initialising the modem, i.e., without sending hayes commands on startup.
You need to replace the form feed character (\f) with proper ANSI Escape codes. You can do this with GNU sed: sed 's/\f/\o33[2J\o33[0;0H/g' /dev/ttyACM0 In detail: \033[2J Clear screen, \033[0;0H: Go to pos 0,0 (If this does not work, try tail -f /dev/ttyACM0 | sed 's/\f/\o33[2J\o33[0;0H/g')
When your FPGA execute the print("\n\f") it is really sending two bytes on its stdout, the first one is a linefeed and the second one is a formfeed. These bytes are 0x0A and 0x0C. Then, the stdout is trasferred over the USB cable, and read via an emulated serial device. This serial device will just trasfer both bytes to the controlling terminal (because you ...
I found a lot of references online that say bash should interpret \f as a clear screen. And just as many saying it doesn't work. You may be able to mess with your stty settings to get it to interpret \f properly (which in this context would be written as ^L for Ctrl+L). But I couldn't find anything obvious. A workaround would be to change your code. But ...
Top 50 recent answers are included