Banana PI M4 GPIO UART Enable

Hi All,

We can enable raspberry pi UART port for serial connection in /boot/config.txt by entering as below.

dtoverlay= UART3(GPIO 4,5) dtoverlay= UART4(GPIO 8,9) dtoverlay= UART5(GPIO 12,13)

Can anyone help how to enable UART port in Banana pi M4 where to configure .

I am using 2020-05-18-ubuntu-16.04-server-bpi-m4-aarch64-sd-emmc image.

By entering sudo cat /sys/kernel/debug/pinctrl/9804e000.pinctrl/pinmux-pins I can see that uart1 is mapped to GPIO pins 8 and 9, but what do I need to do to access the serial port with my application program?

I’m using 2020-05-18-raspbian-stretch-bpi-m4-sd-emmc.img

I’ve done some more testing and determined that UART1 is mapped to /dev/ttyS1 (by installing setserial and entering setserial -a /dev/ttyS[0123]). I also found that it is operating at 9600 baud by connecting a serial cable and trying different baud rates and doing a simple echo "hello" > /dev/ttyS1 command.

So… How do I get it to run 115200 baud… Use sudo stty -F /dev/ttyS1 115200

uart1: [email protected] {

compatible = " snps,dw-apb-uart" ;

pinctr L- names =" default" ;

pinctrl-0 = <&uart1_ pins> ; /* 2pins */

//pinctrl-0 = <&uart1_ pins_ 0>; /* 4pins */

status = “okay”;


uar t2: ser ial209801B400 {

compatible = " snps,dw-apb-uart" ;

pinctrl-names =” default" ;

pinctrl-0 = <&uart2_ pins>; /* 2pins */

/ /pinctrl-0 = <&uart2_ pins_ 0>; /* 4pins */

status = “disabled”;