Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5185

Interfacing (DSI, CSI, I2C, etc.) • Re: ttyAMA10 belongs to tty group, can't be used as normal serial

$
0
0
With the 5 on my desk, running with "console=ttyAMA10,115200" (translated from "console=serial0,115200" by the firmware) I get:

Code:

pi@raspberrypi:~$ ls -l /dev/ttyAMA10crw------- 1 pi tty 204, 74 Feb  5 09:50 /dev/ttyAMA10
With the console declaration removed (which leaves /dev/ttyAMA10 for general use (*)), I get:

Code:

pi@raspberrypi:~ $ ls -l /dev/ttyAMA10crw-rw---- 1 root dialout 204, 74 Feb  5 09:54 /dev/ttyAMA10
The same is true on a Pi 4, where you get one of the following, depending on whether Bluetooth has been disabled (or configured to use UART1 instead):

Code:

crw-rw---- 1 root dialout 4, 64 Feb  5 10:03 /dev/ttyS0

Code:

crw-rw---- 1 root dialout 204, 64 Feb  5 10:06 /dev/ttyAMA0
In other words, what you are seeing is standard behaviour.

To change the user to pi, insert this chown command into /etc/udev/rules.d/99-com.rules:

Code:

SUBSYSTEM=="pwm", ACTION!="remove", PROGRAM="/bin/sh -c 'chgrp -R gpio /sys%p && chmod -R g=u /sys%p'"KERNEL=="ttyAMA[0-9]*|ttyS[0-9]*", PROGRAM="/bin/sh -c '\        chown pi /dev/%k; \        ALIASES=/proc/device-tree/aliases; \        TTYNODE=$$(readlink /sys/class/tty/%k/device/of_node | sed 's/base/:/' | cut -d: -f2); \
Be careful not to put any spaces after the backslash at the end of the line. Then you should get:

Code:

pi@raspberrypi:~ $ ls -l /dev/ttyAMA*crw-rw---- 1 pi dialout 204, 74 Feb  5 10:17 /dev/ttyAMA10
(*) Be aware that the bootloader and BL31 ARM stub will both use the debug UART, whatever the kernel command line and device tree says.

Statistics: Posted by PhilE — Mon Feb 05, 2024 10:18 am



Viewing all articles
Browse latest Browse all 5185

Trending Articles