serial port on UEXT connector

Started by mciocco, May 14, 2020, 05:37:46 am

Previous topic - Next topic

mciocco

I need to use this serial port with the latest Olinuxino image, which is the tty? I have to set or declare  something in the OS?
Thank You in advance

Faruk

Debug serial port is setting to ttyS0 be default. All image should working on this way(If you didn't any different settings). This port is uart0.

UEXT connector has uart3. If you want take output on UEXT connector, you should enable uart3. You will can check how to enable uart3 on that you have OS image and you should use ttyS3 for uart3.

If you have armbian image, you can enable uart3 with use armbian-config settings. 

LubOlimex

In Olimage images try:

olinuxino-overlay

This script allows enabling different ports and buses - use arrow keys to move up, down, left or right, "space" to enable or disable different interface, once done - press "tab" to move selector down to "ok" and "cancel" options, press "enter" over "ok" or "cancel", if you've made changes restart the board with "reboot now" so that the changes get applied. There is another script:

olinuxino-display

It is used to set different video output options.
Technical support and documentation manager at Olimex

mciocco

I've tried to look at olinuxino-overlay but, whixh is the switch to enable uart3, i can't recognize it
there are LCD, spidev, SPI1, TWI0,1, but nothing that sound as uart or serial or tty.

tHANK You in advance

Marcello

Faruk

If you use this image: https://www.armbian.com/olimex-lime-a64/, use "sudo armbian-config" command in terminal and go on "system settings". You will see uart settings in here. You should enable uart3 in here and rebot your system.

mciocco

awful I am using the last Olimage, but now I will set a n amrbian image too.

Faruk

Actually, I don't think so difficult for Olimage too. Just the process different

oli_sbr

Hello I have tried to enable UART3 with armbian-config (Armbian 20.05.2 Buster, kernel 5.4.43-sunxi64), without success.

echo "test" > /dev/ttyS2 gives nothing (tried with all /dev/ttyS*)

I also tried enabling UART2 on PB0/PB1, it works properly.

(I amr testing with FTDI dongles + checked signals with oscilloscope)

Any idea ?

oli_sbr

Hello again,

Also tried A64-OLinuXino-bionic-base-20200701-182325.img with olinuxino-overlay, but there are no overlay for UART3.

So I took sun50i-a64-uart*.dts overlays from here:
https://github.com/armbian/sunxi-DT-overlays/tree/master/sun50i-a64

I compiled them using scripts from here:
https://github.com/OLIMEX/olinuxino-overlays/tree/upstream

(I used dtc tool which was compiled with buildroot)

The I put the *.dtbo on the Olimage A64-OLinuXino-bionic-base-20200701-182325.img

With olinuxino-overlay I was now able to enable UART2 and UART3.

The result is :
- UART2 is working properly (TX/RX)
- UART3 is not working at all (either TX or RX). No signal at the oscilloscope.

More info:

root@a64-olinuxino:~# dmesg |grep tty
[    0.000000] Kernel command line: root=PARTUUID=271e3d4c-01 rootwait console=ttyS0,115200 panic=10 loglevel=4
[    3.479045] printk: console [ttyS0] disabled
[    3.479107] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 32, base_baud = 1500000) is a 16550A
[    3.519515] printk: console [ttyS0] enabled
[    3.520842] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 33, base_baud = 1500000) is a 16550A
[    3.521868] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 34, base_baud = 1500000) is a 16550A
[    3.522949] 1c28c00.serial: ttyS3 at MMIO 0x1c28c00 (irq = 35, base_baud = 1500000) is a 16550A

This seems to be OK

root@a64-olinuxino:~# echo "test" > /dev/ttyS2 # Working on PB0
root@a64-olinuxino:~# echo "test" > /dev/ttyS3 # Not working on UEXT

Is the UART3 supposed to work ? Thanks

oli_sbr

Hello again,

Looking closely to dmesg, it is written something about the regulators:

[    3.478140] sun50i-a64-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    3.478415] sun50i-a64-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[    3.479251] printk: console [ttyS0] disabled
[    3.479312] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 32, base_baud = 1500000) is a 16550A
[    3.519715] printk: console [ttyS0] enabled
[    3.520210] sun50i-a64-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[    3.521013] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 33, base_baud = 1500000) is a 16550A
[    3.521999] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 34, base_baud = 1500000) is a 16550A
[    3.522395] sun50i-a64-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    3.523073] 1c28c00.serial: ttyS3 at MMIO 0x1c28c00 (irq = 35, base_baud = 1500000) is a 16550A

Could it be the origin of the problem, or the "dummy-regulator" is OK ?

Thanks

oli_sbr

OK I got the solution.

The UART3 dts file provided here https://github.com/armbian/sunxi-DT-overlays/tree/master/sun50i-a64 uses PB0&PB1 for UART3.

By having a closer look at our beloved Olinuxino board, UART3 is on PH4&PH5 !

So by having this on my device tree :

&uart3_pins {
 pins = "PH4", "PH5";
 function = "uart3";
};

It works like a charm :)