saeedjohar
Posts: 4
Joined: Wed Jul 24, 2019 12:45 pm

RXD5 TXD5 Rpi4

Wed Jul 24, 2019 1:04 pm

How can I get access to serial other than Serial0?

Like for serial0, we have used /dev/ttyS0. Though I have enabled my serial from raspi-config.

Appreciate your help.

User avatar
thagrol
Posts: 2212
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: RXD5 TXD5 Rpi4

Wed Jul 24, 2019 6:10 pm

May I suggest you read up on /boot/config.txt and devicetree overlays.

/boot/overlays/README would probably be a good starting place.

I suspect the various uart? overlays are what you need.

This is a guess, but I'd expect raspi-config to only affect serial0 as that's the only one present on all Pi.
Attempts to contact me outside of these forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

danjperron
Posts: 3438
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: RXD5 TXD5 Rpi4

Thu Jul 25, 2019 1:00 am

TXD3 => GPIO 4
RXD3 => GPIO 5
CTS3 => GPIO 6
RTS3 => GPIO 7

TXD4 => GPIO 8
RXD4 => GPIO 9
CTS4 => GPIO 10
RTS4 => GPIO 11

TO enable add the dtoverlay into /boot/config.txt
(sudo nano /boot/config.txt)

dtoverlay=uart3
dtoverlay=uart4


Reboot your computer and they should be /dev/ttyAMA1 and /dev/ttyAMA2

Code: Select all

[email protected]:~ $ ls -l /dev/ttyA*
crw-rw---- 1 root dialout 204, 64 jui 25 01:30 /dev/ttyAMA0
crw-rw---- 1 root dialout 204, 65 jui 25 01:47 /dev/ttyAMA1
crw-rw---- 1 root dialout 204, 66 jui 25 01:47 /dev/ttyAMA2
[email protected]:~ $ ls -l /dev/serial*
lrwxrwxrwx 1 root root 5 jui 25 01:30 /dev/serial0 -> ttyS0
lrwxrwxrwx 1 root root 7 jui 25 01:30 /dev/serial1 -> ttyAMA1
[email protected]:~ $ 
P.S. dtoverlay with no parameters disable the RTS and CTS. Also do not enable the SPI or the 1wire.

danjperron
Posts: 3438
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: RXD5 TXD5 Rpi4

Thu Jul 25, 2019 1:11 am

And for the serial 5

TXD5 = GPIO 12
RXD5 = GPIO 13
CTS5 = GPIO 14
RTS5 = GPIO 15


dtoverlay=uart5

Code: Select all

[email protected]:~ $ ls -l /dev/ttyAM*
crw-rw---- 1 root dialout 204, 64 jui 25 02:06 /dev/ttyAMA0
crw-rw---- 1 root dialout 204, 65 jui 25 02:06 /dev/ttyAMA1
crw-rw---- 1 root dialout 204, 66 jui 25 02:06 /dev/ttyAMA2
crw-rw---- 1 root dialout 204, 67 jui 25 02:06 /dev/ttyAMA3
Be carefull about /dev/ttyAMA? . number increment each time you add dtoverlay=uart?

N.B. This only works with the PI4.

saeedjohar
Posts: 4
Joined: Wed Jul 24, 2019 12:45 pm

Re: RXD5 TXD5 Rpi4

Thu Jul 25, 2019 11:56 am

Thank you.

Worked fine.

Return to “Interfacing (DSI, CSI, I2C, etc.)”