arduino usb/com port issue
Tomasz CEDRO
tomek at cedro.info
Sun May 31 20:12:17 UTC 2020
On Sun, May 31, 2020 at 7:54 PM Hans Petter Selasky wrote:
>
> On 2020-05-31 18:55, Gary Aitken wrote:
> > It's not clear to me if this is the right place for this or not; please
> > let me know if not. I originally posted on questions and got no response.
> >
> > I installed the arduino package on an 11.3-RELEASE system. When
> > it comes up, the Tools/Serial Port menu item is greyed out,
> > apparently because it doesn't know USB ports serve as com ports,
> > or for some reason it can't find them. Is this something I need to
> > configure somehow? Is this something that should be filed as a
> > bug?
> >
> > Thanks for any clues,
> >
>
> Did you check the permissions on /dev/usb/XXX ?
>
> And output from usbconfig
>
> --HPS
Hey Gary, Hey HPS :-)
I am using /dev/cuaU0 USB VCOM Port with success for years on FreeBSD,
even today it works fine with ARM DAPLink debug probe :-)
As HPS noted in the first place check if you have valid permissions
that allow you to read/write from/to usb device. I did a hint at the
OpenOCD port:
/usr/ports/devel/openocd/pkg-message
To allow an ordinary user to acces any of the the hotplug USB interface
add him/her to the operator group (pw groupmod operator -m username), then
setup the devfs subsystem by adding these lines to the following files:
***/etc/devfs.rules:
[localrules=10]
add path 'ugen*' mode 0660 group operator
add path 'usb/*' mode 0660 group operator
add path 'usb' mode 0770 group operator
***/etc/rc.conf:
devfs_system_ruleset="localrules"
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).
I did not use that particular Arduino utility, but there may be a
chance that it was written for Linux and it may suggest port name like
/dev/ttyUSB0 instead /dev/cuaU0 as it is used in FreeBSD.
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 but it lacks
permissions to do so and the whole program stops with an exception. In
that case simply unload selected modules and `service devd stop` for
the time of testing. This may be also the case for you:
1. You lack permissions to access a resource so temporary try run as
root and see if that works.
2. You may require some component that is already taken by other
service/application.
Note: It is not wise to run as root networked enabled applications
even though are "only meant" for electronics development, so try to
configure your system so it runs such applications without root :-)
Have fun! :-)
Tomek
--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
More information about the freebsd-usb
mailing list