15.4 minicom can't connect to ttyACM0 as user -- only root (after connection setup as root)
All, Something has changed in 15.4 related to access serial devices over USB in 15.4 and I can't figure out what? Here is the setup. I have several microcontrollers I connect to my laptop over USB. (TI MSP432 and RM46). In 15.0 after saving the connection parameters as root, I could connect to the devices on ttyACM0 as my normal user. However in 15.4, minicom refuses to connect saying can't get a lock on ttyACM0. (if I run minicom as root, then it works just fine) This has other implications as well. I use TI Code Composer Studio as the IDE for the microcontroller code. It provides arm versions of gcc, clang and the TI compiler. It also needs to connect over ttyACM0 to update the XDS110 debug probe firmware and to flash new programs to the microcontroller's flash memory. This worked seamlessly as user in 15.0. It now cannot update the firmware or flash new programs to the microcontrollers (see error at end) I suspect this may be a group issue. In 15.0 there was the adm group GID 485, that I made myself a member of. (I'm not positive this is the group at issue, but...) The adm group is not present in 15.4. Is this the culprit? All other groups seem to be common between 15.0 and 15.4. If not the adm group -- what else could it be? I had no issues using ttyACM0 as my user in 15.0 and now in 15.4 it seems I lack some type of permission to use it. The error thrown by CCS is: CS_DAP_0: Error initializing emulator: (Error -260 @ 0x0) An attempt to connect to the XDS110 failed. The cause may be one or more of: no XDS110 is connected, invalid firmware update, invalid XDS110 serial number, or faulty USB cable. The firmware and serial number may be updated using the xdsdfu utility found in the .../ccs_base/common/uscif/xds110 directory of your installation. View the XDS110SupportReadMe.pdf file there for instructions. (Emulation package 9.7.0.00213) I'm connected to it in an xterm watching the output of a MPU9850 update at 100 HZ right now -- it's connected and working (this rules out a faulty USB cable as well). The firmware update is also fine. So it looks like the same permission issue with can't get a lock on ttyACM0 that minicom complains of. -- David C. Rankin, J.D.,P.E.
On 2022-06-18 10:57, David C. Rankin wrote:
All,
Something has changed in 15.4 related to access serial devices over USB in 15.4 and I can't figure out what?
...
I suspect this may be a group issue. In 15.0 there was the adm group GID 485, that I made myself a member of. (I'm not positive this is the group at issue, but...) The adm group is not present in 15.4.
What group does the device file belong to? Your user should belong to that group.
Is this the culprit? All other groups seem to be common between 15.0 and 15.4.
If not the adm group -- what else could it be? I had no issues using ttyACM0 as my user in 15.0 and now in 15.4 it seems I lack some type of permission to use it.
-- Cheers / Saludos, Carlos E. R. (from Elesar, using openSUSE Leap 15.3)
On 6/18/22 06:11, Carlos E. R. wrote:
On 2022-06-18 10:57, David C. Rankin wrote:
All,
Something has changed in 15.4 related to access serial devices over USB in 15.4 and I can't figure out what?
...
I suspect this may be a group issue. In 15.0 there was the adm group GID 485, that I made myself a member of. (I'm not positive this is the group at issue, but...) The adm group is not present in 15.4.
What group does the device file belong to? Your user should belong to that group.
$ l /dev/ttyACM0 crw-rw---- 1 root dialout 166, 0 Jun 18 09:25 /dev/ttyACM0 $ sudo gpasswd -a david dialout Adding user david to group dialout $ 09:26 wizard:~> minicom timsp432 Cannot create lockfile for /dev/ttyACM0: Permission denied BUMMER....
If not the adm group -- what else could it be? I had no issues using ttyACM0 as my user in 15.0 and now in 15.4 it seems I lack some type of permission to use it.
What if I add the "adm" group with GID 485 back to the system? Worth a try? Or, grasping at straws?? -- David C. Rankin, J.D.,P.E.
On 6/18/22 09:29, David C. Rankin wrote:
On 6/18/22 06:11, Carlos E. R. wrote:
On 2022-06-18 10:57, David C. Rankin wrote:
All,
Something has changed in 15.4 related to access serial devices over USB in 15.4 and I can't figure out what?
...
I suspect this may be a group issue. In 15.0 there was the adm group GID 485, that I made myself a member of. (I'm not positive this is the group at issue, but...) The adm group is not present in 15.4.
What group does the device file belong to? Your user should belong to that group.
$ l /dev/ttyACM0 crw-rw---- 1 root dialout 166, 0 Jun 18 09:25 /dev/ttyACM0
$ sudo gpasswd -a david dialout Adding user david to group dialout
$ 09:26 wizard:~> minicom timsp432 Cannot create lockfile for /dev/ttyACM0: Permission denied
BUMMER....
If not the adm group -- what else could it be? I had no issues using ttyACM0 as my user in 15.0 and now in 15.4 it seems I lack some type of permission to use it.
What if I add the "adm" group with GID 485 back to the system? Worth a try? Or, grasping at straws??
But start minicom as root and all is well: Usage: switch1 (P1.1) - starts display update switch2 (P1.4) - stops display update Frequencies: msp432 SMCLK : 24 MHz MPU sample rate : 100 Hz display update : 1 Hz DLPF setting : 2 Acceleration Trim Register Values: XA_OFFS : 3614 YA_OFFS : 234 ZA_OFFS : 41472 Linear Acceleration, Angular Rate, Magnetic Field, and Temperature accel: { 0.08, -0.00, 1.00 } 1.00 (g) gyro : { -0.12, -0.25, -0.08 } 0.29 (deg/sec) mag : { 20.81, 35.51, 26.09 } 99 (samples/sec) temp : { 23.40 C / 74.12 F } XYang: { 0.15, 0.17 } -- David C. Rankin, J.D.,P.E.
On 2022-06-18 16:29, David C. Rankin wrote:
On 6/18/22 06:11, Carlos E. R. wrote:
On 2022-06-18 10:57, David C. Rankin wrote:
All,
Something has changed in 15.4 related to access serial devices over USB in 15.4 and I can't figure out what?
...
I suspect this may be a group issue. In 15.0 there was the adm group GID 485, that I made myself a member of. (I'm not positive this is the group at issue, but...) The adm group is not present in 15.4.
What group does the device file belong to? Your user should belong to that group.
$ l /dev/ttyACM0 crw-rw---- 1 root dialout 166, 0 Jun 18 09:25 /dev/ttyACM0
$ sudo gpasswd -a david dialout Adding user david to group dialout
$ 09:26 wizard:~> minicom timsp432 Cannot create lockfile for /dev/ttyACM0: Permission denied
BUMMER....
You have to restart the session. At least, the terminal where you run those two commands. Wait. In what directory is it attempting to create the lockfile? If after the above it keeps locking, attempt a trace to find out that directory.
If not the adm group -- what else could it be? I had no issues using ttyACM0 as my user in 15.0 and now in 15.4 it seems I lack some type of permission to use it.
What if I add the "adm" group with GID 485 back to the system? Worth a try? Or, grasping at straws??
No, what matters is what group owns the device. -- Cheers / Saludos, Carlos E. R. (from Elesar, using openSUSE Leap 15.3)
On 6/18/22 10:13, Carlos E. R. wrote:
You have to restart the session. At least, the terminal where you run those two commands.
Wait. In what directory is it attempting to create the lockfile? If after the above it keeps locking, attempt a trace to find out that directory.
If not the adm group -- what else could it be? I had no issues using ttyACM0 as my user in 15.0 and now in 15.4 it seems I lack some type of permission to use it. What if I add the "adm" group with GID 485 back to the system? Worth a try? Or, grasping at straws?? No, what matters is what group owns the device.
Well, dialout fixed the user being able to connect through minicom, but not the firmware update from Code Composer Studio remains unchanged. Will follow up with TI E2E forum there. -- David C. Rankin, J.D.,P.E.
On 18.06.2022 17:29, David C. Rankin wrote:
$ l /dev/ttyACM0 crw-rw---- 1 root dialout 166, 0 Jun 18 09:25 /dev/ttyACM0
$ sudo gpasswd -a david dialout Adding user david to group dialout
$ 09:26 wizard:~> minicom timsp432 Cannot create lockfile for /dev/ttyACM0: Permission denied
BUMMER....
That's ridiculous. You had exactly the same question about adding user to an additional group three days ago.
On 2022-06-18 11:40:14 Andrei Borzenkov wrote:
|On 18.06.2022 17:29, David C. Rankin wrote: |> $ l /dev/ttyACM0 |> crw-rw---- 1 root dialout 166, 0 Jun 18 09:25 /dev/ttyACM0 |> |> $ sudo gpasswd -a david dialout |> Adding user david to group dialout |> |> $ 09:26 wizard:~> minicom timsp432 |> Cannot create lockfile for /dev/ttyACM0: Permission denied |> |> BUMMER.... | |That's ridiculous. You had exactly the same question about adding user |to an additional group three days ago.
Some of us don't really understand how group privileges work; and I for one haven't gotten many insights from the various man files, nor from the web. Leslie --
Op zaterdag 18 juni 2022 13:11:15 CEST schreef Carlos E. R.:
On 2022-06-18 10:57, David C. Rankin wrote:
All,
Something has changed in 15.4 related to access serial devices over USB in 15.4 and I can't figure out what?
...
I suspect this may be a group issue. In 15.0 there was the adm group GID 485, that I made myself a member of. (I'm not positive this is the group at issue, but...) The adm group is not present in 15.4.
What group does the device file belong to? Your user should belong to that group.
Is this the culprit? All other groups seem to be common between 15.0 and 15.4.
If not the adm group -- what else could it be? I had no issues using ttyACM0 as my user in 15.0 and now in 15.4 it seems I lack some type of permission to use it.
-- Cheers / Saludos,
Carlos E. R.
(from Elesar, using openSUSE Leap 15.3)
Please read https://www.mail-archive.com/linux-users@lists.canterbury.ac.nz/msg03020.htm... It may provide the solution. -- fr.gr. member openSUSE Freek de Kruijf
On 6/19/22 10:28, Freek de Kruijf wrote:
Please readhttps://www.mail-archive.com/linux-users@lists.canterbury.ac.nz/msg03020.htm...
It may provide the solution.
Thank you for the link, The minicom problem was solved by adding the user to the 'dialout' group which is the group (GID == 490) the udev rule that creates the device assigns as GID. The Code Composer Studio issue was caused by a failure to install ti specific udev rules in /etc/udev/rules.d when the installer is run as non-root user. Re-running the driver install as root: <ccs_install_root>/ccs/install_scripts/install_drivers.sh add two new udev rules that updated the mode on the ttyACM[01] devices to 0666 allowing firmware update and program flash to the TI microcontrollers as a regular user. -- David C. Rankin, J.D.,P.E.
participants (5)
-
Andrei Borzenkov
-
Carlos E. R.
-
David C. Rankin
-
Freek de Kruijf
-
J Leslie Turriff