I need to use all five of the PL011 UARTs on a Raspberry Pi 4. I am having no problems with UART2 - UART5. It is only UART0 that is giving me problems.
I connect a serial cable from a laptop to the raspi on UART0, run a terminal on COM1 on the laptop, and I SSH into the raspi and run a terminal (minicom) for "/dev/ttyAMA0". On any other UART when I do this, I can type in either terminal and get the characters echoed on the other terminal. On UART0, however, I get random garble on the raspi side, and I get the string "Minicom2.7.1" echoed repeatedly on the laptop side. If I type in characters on the raspi side, I do see them echoed on the laptop along with the "Minicom" string. What could cause this?
These are the steps I used to enable UART0:
- Disabled bluetooth by adding "dtoverlay=disable-bt" to "/boot/config.txt"
- Setting "enable_uart=1" in the same config file.
- Using raspi-config to enable serial ports and disable the shell over serial
- Disabled the service "hciuart".
The OS is updated with the latest versions of everything.
Also, if I wire the RX to the TX (pin 8 to pin 10) then it behaves as expected, i.e. typing characters into a terminal echoes them back.
Here is part of the output of "raspi-gpio get"
GPIO 14: level=1 fsel=4 alt=0 func=TXD0 pull=NONE
GPIO 15: level=1 fsel=4 alt=0 func=RXD0 pull=UP
There is no func=TXD1 or RXD1. So I am not sure why some people are saying UART 0 and 1 are clashing.
Note: here is my cmdline.txt:
console=tty1 root=PARTUUID=df23dc83-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
1 Answer 1
AFAIK you can not use 5 UART.
Although the SOC has 6 UART not all are accessible on the Pi4 because some share the same pins (the other GPIO banks are not accessible). One can only use the reserved pins on the header used for HATS and I2C extender.
It may be possible if you disable Bluetooth (which uses one UART).
-
I did disable Bluetooth. I also disabled SPI and I2C.YWE– YWE2020年08月26日 12:39:35 +00:00Commented Aug 26, 2020 at 12:39
-
Though I still do not know why this is true, I believe this is correct that 5 UARTs cannot all be used simultaneously. I disabled UARTS2-5 and UART0 worked. In fact, just enabling any one of UARTS2-4 messed up UART0 (5 didn't for some reason).YWE– YWE2020年08月26日 13:55:48 +00:00Commented Aug 26, 2020 at 13:55
console=tty1
part out - leave everything else on one line and reboot.