FreedomStudio Serial Terminal Problem

(Mike Adams) #1

We have the FreedomStudio tool working great in multiple Centos 7.4 Virtual Machines–(VM)s running in different flavors of the Microsoft Windows OS. These VMs talk to a HiFive board through the USB interface as expected, and we can debug just as if we are running under Windows. Interestingly, however, when we use minicom outside the FreedomStudio tool, all serial communications looks normal. When we use the default Serial Terminal inside FreedomStudio proper, however, the output looks horrible. It does not seem to be adding in the carriage return along with the line feed so printouts simply start on the next line and then wrap around. This seems like a normal Windows / Unix end of line problem, but we have no idea how to fix it.

Our communications use the /dev/ttyUSB1 driver for the Serial Port; 115200 for the Baud Rate; 8 for the Data size; None for parity; and 1 for the Stop bits. Additionally it doesn’t matter whether we choose the Default (ISO-8859-1) Encoding, or the UTF-8 encoding as neither fix this.

Any thoughts would be appreciated.

Thanks in advance.

(Meadhbh Hamrick) #2

Hmm. No responses yet?

FWIW, I’ve seen this before on native Linux, but only after the system was in a “weird” state, like when it seems that GDB and OpenOCD are out of sync with each other.

I’m guessing your app is written in C/C++ and emits a LF (written as “\n” in C programs.) The reason this usually works in Linux is the line discipline sitting on top of the serial port is looking for LF’s and inserts CR’s after (or maybe before) them. Windows doesn’t have the concept of a line discipline, I believe, but you would think it would just be passing USB device level data from the USB hardware to VirtualBox.

Just to verify the terminal can actually do a CR, it might be interesting to see how “\r\n” or “\r” line endings in your program change the behaviour. That might help track down what bit is failing.

And… did you install the FTDI driver on the windows side as described in the FreedomStudio manual? If so, it might be interposing itself in the communications chain. If you installed it, you might try uninstalling it and seeing what happens. If you haven’t installed it, it might be interesting to see if anything changes after you do install it.