arduino usb/com port issue

Ian Lepore ian at freebsd.org
Mon Jun 1 15:28:31 UTC 2020


On Sun, 2020-05-31 at 22:11 +0200, Tomasz CEDRO wrote:
> On Sun, May 31, 2020 at 7:54 PM Hans Petter Selasky wrote:
> > 
> > [...]
> 
> I use MINICOM as the Terminal emulator. Type Ctrl+A then Z for command
> menu. Note that you will have to create a configuration for a given
> port in the first place (as root type `minicom -s /dev/cuaU0` set
> valid port name and parameters then save as the default configuration
> for that port).
> 

You can use cu(1) from the base system for that.  To connect to the
first usb-serial at speed 115,200 use:

   cu -l cuaU0 -s 115200

To disconnect, use the key sequence <CR> ~ ^D

> In general on FreeBSD COM port over USB (aka Virtual-COM-Port) is
> handled by `ucom` kernel module (type `kldstat` to list loaded kernel
> modules), also it may use `umodem` or even `u3g` module. Those modules
> are loaded by `devd` system daemon based on USB descriptors when you
> plug a device. I just found a bug in pyOCD (Python module for ARM CPU
> debug) that prevents running GDB Server when `ucom` module is loaded
> for the VCP port on that board. pyOCD tries to unload the kernel
> module by default to gain access to the VCP using LibUSB

There should be no need to unload ucom to access the low-level usb
device via libusb.  I typically have anywhere from 5-8 usb-serial
adapters connected at once, it would be crazy to unload ucom and lose
access to all of them just to use one of them with libusb.

It is important, however, to avoid accessing /dev/cuaU# or /dev/ttyU#
at the same time that some application is using libusb (or libftdi) to
access that same device.  That would cause ucom and the work being done
via libusb to conflict with each other.

-- Ian



More information about the freebsd-usb mailing list