2

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:

  1. Disabled bluetooth by adding "dtoverlay=disable-bt" to "/boot/config.txt"
  2. Setting "enable_uart=1" in the same config file.
  3. Using raspi-config to enable serial ports and disable the shell over serial
  4. 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.

  • Do you have anything for the serial console in cmdline.txt ? You will need to take that out. – Andyroo Aug 25 at 14:03
  • @Andyroo, here is my cmdline.txt: "console=tty1 root=PARTUUID=df23dc83-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" – YWE Aug 25 at 14:25
  • Try taking the console=tty1 part out - leave everything else on one line and reboot. – Andyroo Aug 25 at 17:52
  • @Andyroo, There is no difference after removing "console=tty1" – YWE Aug 25 at 19:24
  • 1
    (1) Well I also use UART 0, but never with BlueTooth at the same time. I am pessimistic and I think BlueZ5x might not be clean for the next couple of years. (2) Also I think it is very tricky to use both UART0 and UART1 at the same time. (3) I always use UART0, for basic testing/prototyping. I prefer to use USB UARTn because it is easy to swap/scale up. (4) I don't use other on board UARTS, because I want to use the other 5 on board SPIs, and I2Cs, and I don't have enough pins to go around. – tlfong01 Aug 26 at 13:04
2

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 I²C extender.

It may be possible if you disable Bluetooth (which uses one UART).

See Raspberry Pi4 UART

| improve this answer | |
  • I did disable Bluetooth. I also disabled SPI and I2C. – YWE Aug 26 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 Aug 26 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.