Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: Anushka on April 16, 2022, 08:11:40 AM

Title: A20-OLinuXino-Lime UART ports
Post by: Anushka on April 16, 2022, 08:11:40 AM
I am using olimex A20 UART port for data communication but only UART0 is responding other UART ports are not working. Also UART0 is having problem it is not working well I am using RS232 to transmit and receive the data from computer via UART cable but my data is not received properly. 
I want to use other UART ports like UART3 as PG6(tx) &PG7(rx) but I am not getting any output.
Here is my code,
ser = serial.Serial("/dev/ttyS3" , 9600, timeout = 0.5)
receivedString = ser.readline().decode("utf-8")
print(receivedString)

I get empty string as my output.
Title: Re: A20-OLinuXino-Lime UART ports
Post by: LubOlimex on April 18, 2022, 08:35:53 AM
Are you using Olimage Linux? Did you run olinuxino-config script to enable more UARTs?

Refer to this document: https://github.com/OLIMEX/OLINUXINO/blob/master/DOCUMENTS/OLIMAGE/Olimage-guide.pdf
Title: Re: A20-OLinuXino-Lime UART ports
Post by: Anushka on April 19, 2022, 09:26:09 PM
Yes I am using olimage Linux. I can not find location of config script. Can you tell its location commands?
Title: Re: A20-OLinuXino-Lime UART ports
Post by: mactronica on April 19, 2022, 09:30:48 PM
The encoded address (/soc@1c00000/serial@1c28c00) in DTS is the wrong one and refers to UART1 instead of UART3.
You can see it here:

https://github.com/OLIMEX/olinuxino-overlays/blob/master/sun7i-a20/sun7i-a20-uart3.dts (https://github.com/OLIMEX/olinuxino-overlays/blob/master/sun7i-a20/sun7i-a20-uart3.dts)
Title: Re: A20-OLinuXino-Lime UART ports
Post by: JohnS on April 19, 2022, 11:37:28 PM
Quote from: mactronica on April 19, 2022, 09:30:48 PMThe encoded address (/soc@1c00000/serial@1c28c00) in DTS is the wrong one and refers to UART1 instead of UART3.
You can see it here:

https://github.com/OLIMEX/olinuxino-overlays/blob/master/sun7i-a20/sun7i-a20-uart3.dts (https://github.com/OLIMEX/olinuxino-overlays/blob/master/sun7i-a20/sun7i-a20-uart3.dts)
Looks correct to me, referring to the A20 doc.

John
Title: Re: A20-OLinuXino-Lime UART ports
Post by: LubOlimex on April 20, 2022, 08:53:55 AM
Quote from: Anushka on April 19, 2022, 09:26:09 PMYes I am using olimage Linux. I can not find location of config script. Can you tell its location commands?

It is just you can type and execute commands in the command line interface as soon as you login.

How do you access the board?
Title: Re: A20-OLinuXino-Lime UART ports
Post by: mactronica on April 20, 2022, 11:50:36 AM
Quote from: JohnS on April 19, 2022, 11:37:28 PMLooks correct to me, referring to the A20 doc.

John

I'm sorry. My statement is not accurate. It's UART3 but it's mapped on ttyS1:


olimex@a20-olinuxino:~$ dmesg | grep tty
[    0.000000] Kernel command line: root=PARTUUID=de3c5b85-01 rootwait console=ttyS0,115200 panic=10 loglevel=4
[    1.079397] printk: console [ttyS0] disabled
[    1.079534] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 59, base_baud = 1500000) is a 16550A
[    1.096391] printk: console [ttyS0] enabled
[    1.098798] 1c28c00.serial: ttyS1 at MMIO 0x1c28c00 (irq = 60, base_baud = 1500000) is a 16550A
[    1.100638] 1c29000.serial: ttyS2 at MMIO 0x1c29000 (irq = 61, base_baud = 1500000) is a 16550A
[    1.102874] 1c29400.serial: ttyS3 at MMIO 0x1c29400 (irq = 62, base_baud = 1500000) is a 16550A
[    1.104632] 1c29800.serial: ttyS4 at MMIO 0x1c29800 (irq = 63, base_baud = 1500000) is a 16550A
[    1.106474] 1c29c00.serial: ttyS5 at MMIO 0x1c29c00 (irq = 64, base_baud = 1500000) is a 16550A
[    6.771787] systemd[1]: Created slice system-getty.slice.
[    6.812537] systemd[1]: Created slice system-serial\x2dgetty.slice.

Title: Re: A20-OLinuXino-Lime UART ports
Post by: JohnS on April 20, 2022, 04:55:37 PM
Is there a problem with uart2.dts?

It uses
serial2 = "/soc/serial@1c28800";

which I thought might be
serial2 = "/soc@1c00000/serial@1c28800";

Is there no ttySx for it?

John
Title: Re: A20-OLinuXino-Lime UART ports
Post by: Anushka on April 20, 2022, 09:30:50 PM

Quote from: LubOlimex on April 20, 2022, 08:53:55 AM
Quote from: Anushka on April 19, 2022, 09:26:09 PMYes I am using olimage Linux. I can not find location of config script. Can you tell its location commands?

It is just you can type and execute commands in the command line interface as soon as you login.

How do you access the board?
I typed that comments on terminal but its not working.It is showing commands not found after typing the code in the doc https://github.com/OLIMEX/olinuxino-overlays/blob/master/sun7i-a20/sun7i-a20-uart3.dts
Title: Re: A20-OLinuXino-Lime UART ports
Post by: LubOlimex on April 22, 2022, 04:53:58 PM
Umm it looks like this here: https://i.imgur.com/GgOgdrq.jpg

How do you access the board?
Title: Re: A20-OLinuXino-Lime UART ports
Post by: Anushka on April 23, 2022, 01:26:57 PM
Quote from: LubOlimex on April 22, 2022, 04:53:58 PMUmm it looks like this here: https://i.imgur.com/GgOgdrq.jpg

How do you access the board?

I access the board through terminal. I run the code but its not working. When I typed command olinuxino- on terminal it said commands not found.
Title: Re: A20-OLinuXino-Lime UART ports
Post by: JohnS on April 23, 2022, 02:39:11 PM
As in the image posted, the command is olinuxino-overlay

John
Title: Re: A20-OLinuXino-Lime UART ports
Post by: LubOlimex on April 26, 2022, 04:57:35 PM
Quote from: Anushka on April 23, 2022, 01:26:57 PM
Quote from: LubOlimex on April 22, 2022, 04:53:58 PMUmm it looks like this here: https://i.imgur.com/GgOgdrq.jpg

How do you access the board?

I access the board through terminal. I run the code but its not working. When I typed command olinuxino- on terminal it said commands not found.


"olinuxino-" then you press "TAB" key to auto-complete all items whose name start with "olinuxino-"