UART_EE_A RTS and CTS

Post Reply
rpineau
Posts: 25
Joined: Sun Sep 30, 2018 12:19 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 1 time
Contact:

UART_EE_A RTS and CTS

Unread post by rpineau » Mon Aug 12, 2019 12:29 pm

On the expansion connection page ( https://wiki.odroid.com/odroid-n2/hardw ... connectors ) I can see that pin 29 and 31 are UART_EE_A_CTS and UART_EE_A_RTS.
I've enable the UART_EE_A but if I select hardware flow control in minicom (aka rts/cts flow control) and do the same on the other end, this doesn't work (no data as I guess RTS never goes to the right state and CTS is not read).
Is there something else that needs to be done to actually enable these pins as RTS/CTS for UART_EE_A ?

Rodolphe

User avatar
odroid
Site Admin
Posts: 31852
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 89 times
Been thanked: 255 times
Contact:

Re: UART_EE_A RTS and CTS

Unread post by odroid » Mon Aug 12, 2019 6:30 pm

Did you modify the DeviceTree file arch/arm64/boot/dts/amlogic/meson64_odroidn2.dts and compile it?
You have to add the following lines in the DT file to enable the hw flow-control feature.

Code: Select all

&uart_A {
   status = "okay";
};
We tested the RTS/CTS functionality with two N2 boards and it worked well.

rpineau
Posts: 25
Joined: Sun Sep 30, 2018 12:19 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 1 time
Contact:

Re: UART_EE_A RTS and CTS

Unread post by rpineau » Mon Aug 12, 2019 11:14 pm

I did not modify the device tree.
I guess I need the kernel sources for this. I was hopping to not have to have to compile anything and be able to enable this via /sys or and other sysctl. I have no issue compiling kernel and other things but this means my project will have a non standard kernel and if our users do an update without doing the above tit will break what was done.

User avatar
tobetter
Posts: 3786
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 29 times
Been thanked: 130 times
Contact:

Re: UART_EE_A RTS and CTS

Unread post by tobetter » Mon Aug 12, 2019 11:48 pm

rpineau wrote:
Mon Aug 12, 2019 11:14 pm
I did not modify the device tree.
I guess I need the kernel sources for this. I was hopping to not have to have to compile anything and be able to enable this via /sys or and other sysctl. I have no issue compiling kernel and other things but this means my project will have a non standard kernel and if our users do an update without doing the above tit will break what was done.
You can add this command after fdt addr ${dtb_loadaddr} in boot.ini.

Code: Select all

fdt set /serial@ffd24000 status okay

rpineau
Posts: 25
Joined: Sun Sep 30, 2018 12:19 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 1 time
Contact:

Re: UART_EE_A RTS and CTS

Unread post by rpineau » Tue Aug 13, 2019 1:02 am

I already have this as a one time setup :

Code: Select all

fdtput -t s /media/boot/meson64_odroidn2.dtb /serial@ffd24000 status "okay"
to enable the serial port. So is the above just another way or does it actually enable the RTS/CTS mapping of the pins ?


And the kernel boot log shows all 3 serial port being enabled :

Code: Select all

[    1.017389] ff803000.serial: clock gate not found
[    1.017414] meson_uart ff803000.serial: ==uart0 reg addr = ffffff80084f5000
[    1.017436] ff803000.serial: ttyS0 at MMIO 0xff803000 (irq = 34, base_baud = 1500000) is a meson_uart
[    1.017446] meson_uart ff803000.serial: ttyS0 use xtal(24M) 24000000 change 0 to 115200
[    3.116882] console [ttyS0] enabled
[    3.120750] meson_uart ffd24000.serial: ==uart1 reg addr = ffffff80084f7000
[    3.127641] ffd24000.serial: ttyS1 at MMIO 0xffd24000 (irq = 42, base_baud = 1500000) is a meson_uart
[    3.137141] meson_uart ffd23000.serial: ==uart2 reg addr = ffffff80084f9000
[    3.144104] ffd23000.serial: ttyS2 at MMIO 0xffd23000 (irq = 43, base_baud = 1500000) is a meson_uart
but nothing about RTS/CTS even after adding what you posted above in boot.ini
Rodolphe

User avatar
odroid
Site Admin
Posts: 31852
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 89 times
Been thanked: 255 times
Contact:

Re: UART_EE_A RTS and CTS

Unread post by odroid » Wed Aug 21, 2019 5:27 pm

How did you test the RTS/CTS flow-control function?

We used two N2 boards and ran minicom application on the both boards.
Two boards are connected via five wires as the following connection.
RX-TX
TX-RX
RTS-CTS
CTS-RTS
GND-GND

And enabled the hardware flow-control option in the minicom settings.
If we type something on the first N2, we can see same things on the second N2.
If we disconnect RTS/CTS lines, communication didn't work.
So we guessed the RTS/CTS flow-control handshake worked fine.
20190821_172957.jpg
20190821_172957.jpg (315.49 KiB) Viewed 114 times

Code: Select all

[    1.067548] cpufreq: cpufreq_online: CPU2: Running at unlisted freq: 999999 KHz
[    1.069391] cpufreq: cpufreq_online: CPU2: Unlisted initial frequency changed to: 1000000 KHz
[    1.071111] ff803000.serial: clock gate not found
[    1.071135] meson_uart ff803000.serial: ==uart0 reg addr = ffffff80084f5000
[    1.071156] ff803000.serial: ttyS0 at MMIO 0xff803000 (irq = 33, base_baud = 1500000) is a meson_uart
[    1.071166] meson_uart ff803000.serial: ttyS0 use xtal(24M) 24000000 change 0 to 115200
[    3.475494] console [ttyS0] enabled
[    3.479364] meson_uart ffd24000.serial: ==uart1 reg addr = ffffff80084f7000
[    3.486256] ffd24000.serial: ttyS1 at MMIO 0xffd24000 (irq = 41, base_baud = 1500000) is a meson_uart
[    3.496052] amlogic-new-usb2-v2 ffe09000.usb2phy: USB2 phy probe:phy_mem:0xffe09000, iomap phy_base:0xffffff80084f9000

rpineau
Posts: 25
Joined: Sun Sep 30, 2018 12:19 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 1 time
Contact:

Re: UART_EE_A RTS and CTS

Unread post by rpineau » Thu Aug 22, 2019 12:51 am

I tested between a N2 via a MAX3233 connected to another computer. Here is the schematic :
Screen Shot 2019-08-21 at 08.41.33.png
Screen Shot 2019-08-21 at 08.41.33.png (98.31 KiB) Viewed 92 times
I'll re-test with 2 N2 to make sure this at least works, which would point toward an issue with my MAX3233 circuit.
Rodolphe

rpineau
Posts: 25
Joined: Sun Sep 30, 2018 12:19 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 1 time
Contact:

Re: UART_EE_A RTS and CTS

Unread post by rpineau » Fri Aug 23, 2019 3:38 am

I haven't had time to test but I'm also starting to wonder if it could be related to one of the other things I'm seeing : viewtopic.php?f=177&t=35427
As the pin I'm setting to PWM mode are on the same port (GPIO_X).
My assumption is that each pin can be controlled independently and I should be able to set the 2 pin I need to PWM and still use the other one as RTS/CTS by enabling the ttyS1 port via the fdt set or fdtput commands.
I know the register for the EE_UART_0 (aka EE_UART_A) and the PWM_C and PWM_E are not at the same address but may be there is a bug somewhere.
I'll try the direct connect as you did with minicom to make sure we're testing the same thing and see if the fact that I'm also using PWM is what's causing the issue.

User avatar
odroid
Site Admin
Posts: 31852
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 89 times
Been thanked: 255 times
Contact:

Re: UART_EE_A RTS and CTS

Unread post by odroid » Fri Aug 23, 2019 10:19 am

I see. we will wait for your test result with the PWM pin-mux tweaking.
I really hope it is not an Amlogic SoC design errata.

rpineau
Posts: 25
Joined: Sun Sep 30, 2018 12:19 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 1 time
Contact:

Re: UART_EE_A RTS and CTS

Unread post by rpineau » Fri Aug 23, 2019 11:40 am

So .. I'm an idiot ... no really ... RTS/CTS will not work if the cable I use doesn't have them wired ... yea .. I'll walk myself out (totally works with the right cable).

Sorry.
Rodolphe

User avatar
odroid
Site Admin
Posts: 31852
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 89 times
Been thanked: 255 times
Contact:

Re: UART_EE_A RTS and CTS

Unread post by odroid » Fri Aug 23, 2019 11:41 am

:o :oops: :mrgreen:

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 0 guests