Two USB ports


(Ekkehard Blanz) #1

I just got my brand new HiFive 1 and fired it up first time today. I found that it creates two logical USB ports (/dev/ttyUSB0 and /dev/ttyUSB1 under Linux and two successive COM ports under Windows). The documentation says to use the one with the higher number to connect to a terminal, which works just fine on both platforms. But what is the other one for? Couldn’t find it in the Getting Started manual, and the only other manual I found was on the FE310-G000 RISC V chip.

Three questions:

  1. Obviously, what is the other port for?
  2. Is it guaranteed to be the higher port number on Windows too that I should use for communication?
  3. Where can I find information like that (other than bothering you)?

Any help will be highly appreciated.


(Jim Wilson) #2

The other port is for jtag debugging. You can use openocd to talk to the jtag port, and then gdb talks to openocd. The HiFive1 Getting Started Guide does have one paragraph that mentions debugging running programs, and says to use the run_debug freedom-e-sdk command. Except I don’t see a run_debug command in freedom-e-sdk anymore. You need to use run_openocd to start openocd first, and then run_gdb to start gdb. Hopefully that works. I don’t have a hifive1 so I can’t check. If you do a web search for “hifive1 openocd” you can probably find more info.

I think port numbering depends on the OS. I tell people if one port doesn’t work as the serial console, try the other one.


(Ekkehard Blanz) #3

Thanks for the speedy reply @jimw!! I’ll try the debugging once I get the rest up and running; it definitely is a great and highly welcome addition to any embedded work to have a “real” debugger. Using your suggestion, I already found some promising links on the interwebs…

As for the “experimental computer science approach” :slight_smile: for figuring out which port is which, that works great and is real quick for interactive work, but I am trying to write and embed the tools for the HiFive 1 into a suite of multi-platform multi-MCU tools, and for that I’d need to do it programmatically. On Linux, there are some good hints in the USB info that probably will help (in addition to the number appended at the end of the device), under Windows, I’m afraid I need to dig a little deeper. So far the “COM number” sequence has not failed though, but I don’t think I trust it just yet.

Thanks again for your quick and very helpful response!!!