inteloid
Posts: 4
Joined: Wed Jan 02, 2013 12:07 pm

Device Tree to enable 2 serials and bluetooth

Sun Jul 23, 2017 6:22 am

Hi.

I have Raspberry Pi Zero W and want to connect 2 serial modules (GSM/GPRS modem and GPS receiver) and use built-in bluetooth at the same time.

Is there a device tree configuration that enables me to do that?

I'm aware of bitbanging and various i2c/usb->serial converters, don't want to use them as device tree seems to be a better solution.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2589
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Device Tree to enable 2 serials and bluetooth

Sun Jul 23, 2017 6:49 am

Device Tree is just a way of describing and (to some extent) configuring hardware. It enables the use of hardware and (some) software modules without having to explicitly run modprobe.

If the Raspberry Pi had a third hardware serial port then Device Tree would be used to set it up, but it doesn't. You have to use one of the existing hardware interfaces (I2C, SPI, USB) to connect a bridge - the SC16IS75x range is popular -
otherwise your only option is to bit-bash.

inteloid
Posts: 4
Joined: Wed Jan 02, 2013 12:07 pm

Re: Device Tree to enable 2 serials and bluetooth

Sun Jul 23, 2017 9:44 am

Thanks for your fast reply.

What if we drop bluetooth, how to configure the device to use 2 serial ports?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2589
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Device Tree to enable 2 serials and bluetooth

Sun Jul 23, 2017 9:51 am

Even without Bluetooth that isn't possible on any Pi except a Compute Module. The problem is that both UART interfaces only appear on one set of GPIOs found on the 40-pin header (GPIOs 14&15, pins 8&10), so you can't use both at once. That's a feature of the BCM283x architecture, not a Pi-specific restriction.

mkirk
Posts: 47
Joined: Tue Mar 06, 2018 4:21 pm

Re: Device Tree to enable 2 serials and bluetooth

Thu Sep 05, 2019 6:36 pm

Can you confirm UART pin mapping on GPIO for Pi 3B+ and CM3+

GPIO 14/15 (ALT0) = 32/33 (ALT 3) = TXD0/RXD0 = PL011 UART
GPIO 14/15 (ALT5) = 32/33 (ALT5) = 40/41 (ALT5) = TXD1/RXD1 = mini UART

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2589
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Device Tree to enable 2 serials and bluetooth

Thu Sep 05, 2019 7:23 pm

You're missing 36/37 (alt2) for UART 0, but otherwise that list is correct.

Return to “Device Tree”