Ubuntu - /dev/ttyUSB* only present when HiFive1 is connected

Hi all, trying to get the USB console working on Ubuntu 16 LTS.

When I connect the HiFive, two new devices show up:

~$ ls /dev | grep USB
ttyUSB0
ttyUSB1

However, when I disconnect the board, both devices disappear.

I can get the LED Change output to appear if I connect using

sudo screen /dev/ttyUSB1 115200

and then press the RESET button on the board.

Is there any way to open up the serial connection before the device is connected so that I see the ouput of the program the first time the board boots, instead of needing to hit the RESET button?

Thanks for any pointers!

I have the same problem. It’s due to bad design.

The ftdi chip has a 4k hardware FIFO buffer, and the ftdi_sio.ko driver should have some kind of software FIFO buffer, but somebody is throwing data away! It should not matter if you wait 5 seconds after plugging to run screen, everything that’s in the FIFO should still be there and should be displayed when you run screen.

Here’s a workaround that works for me:

Use mknod to create the ttyUSB1 file before plugging in (and give it whatever permissions you need).

mknod ttyUSB1 c 188 1

Then do a little bash script that does this:

while true; do
screen /dev/ttyUSB1 115200
done

It will repeatedly try running screen until you plug it in.

When you plug it in, you should see more from the beginning of the output… however, some bytes will still get skipped if they’re very early in the boot process, due to somebody discarding data!

I use the Arduino IDE terminal window. Works great.

You just need to open the source code for a sketch (any sketch) and then you can hit ctrl-T or the icon to open the terminal.

This works even if you’re not using the Arduino environment to compile or download the code.