Hi
I try open serial port /dev/ttyS1 and /dev/ttyS2
When I read and write have errno: Input/output error
proc/tty/driver
serinfo:1.0 driver revision:
0: uart:U6_16550A mmio:0x01C28000 irq:40 tx:11791 rx:0 RTS|DTR
1: uart:unknown port:00000000 irq:0
2: uart:unknown port:00000000 irq:0
3: uart:unknown port:00000000 irq:0
4: uart:unknown port:00000000 irq:0
5: uart:unknown port:00000000 irq:0
6: uart:unknown port:00000000 irq:0
7: uart:unknown port:00000000 irq:0
/dev/ttyS2 and /dev/ttyS2 is 0666
this serials are disable in kernel?
Smashing
The Armbian-based images with Linux 5.x kernel have device tree overlays available to enable additional serial/UART devices:
sed -Ei 's/^(overlays=.*)/\1 uart1/' /boot/armbianEnv.txt
reboot
Respectively manually add uart1, uart2 or uart3 to the overlay= line in /boot/armbianEnv.txt.
A full list of available overlays can be found in /boot/dtb/overlay/, the ones with the sun8i-h3- prefix (as defined in /boot/armbianEnv.txt). Those can be added by skipping sun8i-h3- and .dtbo from the file name, hence without prefix and file extension.
hi, i came to this post since i´m trying to enable uart on a nano pi neo 3…
in /boot/armbianEnv.txt i haven’t “overlays”
simply ovarlay_prefix = rockchip
and in the /boot folder a link to: rockchip and inside there is a folder called overlay… how i can enable a uart port?
please help me!
On NanoPi NEO3 the serial device ttyS2 should be enabled by default. Not sure what about ttyS0 and ttyS1, can you try to change the line
extraargs="net.ifnames=0"
to
extraargs=net.ifnames=0 console=ttyS0,115200
or
extraargs=net.ifnames=0 console=ttyS1,115200
(the quotation is not required)
There is an overlay to enable UART4, which is likely ttyS3. To enable it, add the overlays line yourself:
overlays=uart4
Boot output can then be enabled the same way as above. To enable a login console on a UART, e.g. for ttyS0:
systemctl enable serial-getty@ttyS0
while this may not be required when it is enabled for boot output (extraargs) and a serial console connected. systemd has an auto-generator to enable a login prompt then.