4

I'm trying to understand the impact of using UART communication of the Raspberry's GPIO pins. So I'm reading the Raspberry UART documentation, but I'm not sure if I get everything right.

It says:

By default, on Raspberry Pis equipped with the wireless/Bluetooth module (Raspberry Pi 3 and Raspberry Pi Zero W), the PL011 UART is connected to the BT module

I'm not sure what "connected" means in this context. Because it says "by default", it seems to me that there are other options, potentially configurable, so it's just a software connection.

Later, the documentation says

pi3-disable-bt disables the Bluetooth device and restores UART0/ttyAMA0 to GPIOs 14 and 15.

So does "connected" mean that a) the bluetooth data is forwarded/copied to the PL011 UART (one-way)? Or b) does it also mean that writing to the GPIO pins will send data over bluetooth (two-way)? Or c) the connection between Bluetooth and UART on GPIO pins is an exclusive one. You could either use Bluetooth or use UART.

Last, I have a question on the sentence

pi3-miniuart-bt switches the Raspberry Pi 3 and Raspberry Pi Zero W Bluetooth function to use the mini UART (ttyS0), and restores UART0/ttyAMA0 to GPIOs 14 and 15.

in combination with

The particular deficiencies of the mini UART compared to the PL011 are : [...] [long list of disadvantages]

Since I need Bluetooth and UART, this seems to be the right option to me. Does Bluetooth work really fine using the Mini-UART? I definitely don't like to have Bluetooth issues.


I don't consider the suggested duplicate How do I make serial work on the Raspberry Pi3 , Pi3B+, PiZeroW as a duplicate, because

a) my question is about the impact, not on how to make it work.

b)

The /dev/ttyAMA0 previously used to access the UART now connects to Bluetooth.

is something I already know (mentioned above), except for the term "connect", which is also not defined in the answers.

c)

Unfortunately there are a number of other consequences: [...]

which are already listed in the official documentation which I linked to.

d)

the answers

if you want to change the blutooth to miniuart port(bad)

dtoverlay=pi3-miniuart-bt

just says "it's bad", but does not define how bad it is.

2
  • Possible duplicate of How do I make serial work on the Raspberry Pi3 , Pi3B+, PiZeroW
    – Milliways
    Jan 1, 2019 at 22:31
  • While the SPI port has input/output buffers, the TxD and RxD pins on newer models are only 8 bytes deep, and no RTC or CTS. You are essentially bit-banging the port to read and write data to/from specific self-created larger main buffers. Another negative is that it runs on system clock, so for SPI and serial ports to be stable you need to fix the system clock frequency.
    – user96236
    Jan 2, 2019 at 0:06

2 Answers 2

4

The three options are:

default configuration

  • UART0/ttyAMA0 to Bluetooth
  • Mini-UART/dev/ttyS0 to GPIOs 14 and 15

pi3-disable-bt

  • no Bluetooth support
  • UART0/ttyAMA0 to GPIOs 14 and 15

pi3-miniuart-bt

  • Mini-UART/ttyS0 connected to Bluetooth
  • UART0/ttyAMA0 to GPIOs 14 and 15

In general, the Mini-UART has one big pitfall. It doesn't have its own clock source, so the UART bitrate depends on the CPU clock. Which means you have to set a fixed CPU clock for reliable communication. For serial console this is usually not a problem because it's a debugging tool.

4
  • Does that mean I have to set a fixed baud rate so that Bluetooth works reliably? Is that all? Jan 2, 2019 at 19:45
  • The problem is that the actual baud rate depends on both the baud rate setting registers and the SoCs core clock (note: not the CPU clock). So if you want the mini-uart to work reliablly you have to lock the frequency of the SoC core clock. raspberrypi.org/documentation/configuration/uart.md Jan 2, 2019 at 19:48
  • On the CM, does "Connect to bluetooth" mean GPIO32/33? Should I use "pi3-miniuart-bt" to enable /dev/ttyS0
    – hultqvist
    May 9, 2019 at 15:01
  • Honestly, no idea.
    – Janka
    May 9, 2019 at 18:02
4

(See Janka's answer for the practical implications, I just wanted to clear up another aspect of the question).

so it's just a software connection.

Not exactly.

The BCM283x SoCs like many higher end microcontrollers and SoCs has a pin mux unit. This allows different combinations of perhiperals to be connected to the pins of the SoC.

The BCM283x SoC has two UARTs, the "Mini UART" and the "Full UART". The pin muxing functionality in the SoC can be used to connect either of these UARTs to either the serial pins on the GPIO header or to the on-board bluetooh.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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