Hi,
I saw a brief comment on the forum (The Raspberry Pi 3 Model B Q&A thread) that the new Bluetooth module uses the PL011 UART and the GPIO header will be using Broadcom's mini-UART instead. Is this the case?
I have a project where I needed a 9-bit UART and so was modifying the parity bit (mark/space/one/zero) on an 8bit UART to get this to work. As the mini-UART is not fully 16550 compliant (and doesn't have a parity bit), then this will not work.
Am I correct in all of this? And if so then how do I get a fully functioning UART on the RPi3 (FTDI chips are not an option)?
Thanks in advance,
Steaky
-
- Posts: 19
- Joined: Wed Sep 07, 2011 5:18 pm
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
If this is an issue then hopefully it should be possible to create device overlay that disables bluetooth and puts the uart right back where it was. Atleast the page http://elinux.org/RPi_BCM2835_GPIOs lists this as alternative configuration (ALT0 vs ALT5 for GPIO14,15)
-
- Posts: 2
- Joined: Tue Mar 01, 2016 3:06 pm
- Location: Lexington VA
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
noo! I hope this is wrong. I use the hardware uart on the gpio pins for rs485. Swapping this to the crappy mini uart is a bad design decision. ugh.
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
Yes, this is a *serious* shortcoming! I may need parity for some applications, too.
Is the GPIO configuration flexible enough to swap around the UARTs? Bluetooth doesn't really need all that much bandwidth, right?
Edit: looking at the possible pin configurations and the Pi 3 DT configuration, it looks like it is possible to just swap around the UARTs, either PL011 or the Mini UART could have been used for Bluetooth. So why was the PL011 used?
Is the GPIO configuration flexible enough to swap around the UARTs? Bluetooth doesn't really need all that much bandwidth, right?
Edit: looking at the possible pin configurations and the Pi 3 DT configuration, it looks like it is possible to just swap around the UARTs, either PL011 or the Mini UART could have been used for Bluetooth. So why was the PL011 used?
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
Use a Pi2?BloodyCactus wrote:noo! I hope this is wrong. I use the hardware uart on the gpio pins for rs485. Swapping this to the crappy mini uart is a bad design decision. ugh.
As to the decision, sometimes, decisions have to be made. Since the huge majority of people are more likely to want BT that this UART in exactly the format you want, I guess the decision was fairly simple.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.
Working in the Applications Team.
-
- Posts: 2
- Joined: Tue Mar 01, 2016 3:06 pm
- Location: Lexington VA
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
yes it is a simple decision to be sure, if you dont think about it. its just boneheaded decision really.jamesh wrote:As to the decision, sometimes, decisions have to be made. Since the huge majority of people are more likely to want BT that this UART in exactly the format you want, I guess the decision was fairly simple.
1 - existing users, existing solutions, expect things to stay the same.
2 - BT is low power, low speed. it does not need a full hardware uart.
a much simpler decision to make would be to add BT with the mini uart and not break existing solutions.
someone didnt spend the 5 seconds it takes to think about this change.
at least, it looks like it can be reconfigured so not all is lost!
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
wrongBloodyCactus wrote:
yes it is a simple decision to be sure, if you dont think about it. its just boneheaded decision really.
1 - existing users, existing solutions, expect things to stay the same.
2 - BT is low power, low speed. it does not need a full hardware uart.
a much simpler decision to make would be to add BT with the mini uart and not break existing solutions.
Also wrongsomeone didnt spend the 5 seconds it takes to think about this change.
Correct, you can still use the wifi and steer the PL011 UART pins back to the GPIO header.at least, it looks like it can be reconfigured so not all is lost!
Rockets are loud.
https://astro-pi.org
https://astro-pi.org
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
Impressive that someone with a two post count comes striding in thinking he knows better than the very professional and competent engineers at the Foundation, who are on their 4th iteration of a board that's sold 8 million devices. One would think they might actually be pretty good at this sort of thing by now.BloodyCactus wrote:yes it is a simple decision to be sure, if you dont think about it. its just boneheaded decision really.jamesh wrote:As to the decision, sometimes, decisions have to be made. Since the huge majority of people are more likely to want BT that this UART in exactly the format you want, I guess the decision was fairly simple.
1 - existing users, existing solutions, expect things to stay the same.
2 - BT is low power, low speed. it does not need a full hardware uart.
a much simpler decision to make would be to add BT with the mini uart and not break existing solutions.
someone didnt spend the 5 seconds it takes to think about this change.
at least, it looks like it can be reconfigured so not all is lost!
Can I suggest that you may not be fully conversant with all the facts, and therefore may not be in the best situation to comment?
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.
Working in the Applications Team.
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
Ignoring the trolling, it would be interesting to know why the PL011 UART is used for the BT, and if it's actually possible to use the Mini UART with BT (with lower performance or whatever).
-
- Posts: 19
- Joined: Wed Sep 07, 2011 5:18 pm
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
Hi,
It's really difficult to ask why something was done in a particular way without frustrating the engineer that worked on it - one of my weekly challenges at code/design review meetings. I am sure design reviews are carried out at RPF so I'm not suggesting that this was a boneheaded decision.
Datasheets for the BCM43438 are pretty hard to come by so there's probably some hidden qwerk that requires a fully compliant UART to operate so the mini-UART could not be used etc etc. With this in mind:
- It would be interesting to know why the PL011 was used over the mini-UART.
- Is there any way that the mini-UART could be used for the Bluetooth and the PL011 is exposed on the GPIO header?
I know my goto response for the second question would be NO (I deal with those sorts of questions from people who don't understand the system on a daily basis), but in truth the answer is never so simple. The answer is normally "yes BUT the speed will be limited, might drop the odd packet, it doesn't quite fit into the codebase as elegantly, and will take 5x as long".
From some of the answers above I guess that I can just not use the Bluetooth and remap the PL011 to the GPIO header, but (just like a normal customer) I would like to have both Bluetooth and an exposed PL011.
Thanks again,
Steaky
It's really difficult to ask why something was done in a particular way without frustrating the engineer that worked on it - one of my weekly challenges at code/design review meetings. I am sure design reviews are carried out at RPF so I'm not suggesting that this was a boneheaded decision.
Datasheets for the BCM43438 are pretty hard to come by so there's probably some hidden qwerk that requires a fully compliant UART to operate so the mini-UART could not be used etc etc. With this in mind:
- It would be interesting to know why the PL011 was used over the mini-UART.
- Is there any way that the mini-UART could be used for the Bluetooth and the PL011 is exposed on the GPIO header?
I know my goto response for the second question would be NO (I deal with those sorts of questions from people who don't understand the system on a daily basis), but in truth the answer is never so simple. The answer is normally "yes BUT the speed will be limited, might drop the odd packet, it doesn't quite fit into the codebase as elegantly, and will take 5x as long".
From some of the answers above I guess that I can just not use the Bluetooth and remap the PL011 to the GPIO header, but (just like a normal customer) I would like to have both Bluetooth and an exposed PL011.
Thanks again,
Steaky
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
Ok guys, a couple of questions:
1) What's the mini-uart? And what's so different from a "normal" UART?
2) How do i get my serial console back in full work on my pi3?
This change should be mentioned in the RaspberryPI3 release notes or in a FAQ, IMHO, at first i thought i had a faulty hardware.
1) What's the mini-uart? And what's so different from a "normal" UART?
2) How do i get my serial console back in full work on my pi3?
This change should be mentioned in the RaspberryPI3 release notes or in a FAQ, IMHO, at first i thought i had a faulty hardware.
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
viewtopic.php?p=917865#p917865flag26838 wrote: 2) How do i get my serial console back in full work on my pi3?
-
- Posts: 19
- Joined: Wed Sep 07, 2011 5:18 pm
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
More importantly, how do I get the Bluetooth working with the mini-UART? Or is this mapping not possible?
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
The Mini UART has less buffering, so you may want to use a lower baud rate. That's not a big deal for most use cases, I guess.
What's more problematic is that the Mini UART uses the core clock, which can vary, particularly in case of thermal events or when there's too little power. However, this applies to *all* users of the Mini UART...
Maybe the baud rate should be tuned by the firmware whenever the core clock is changed. There would still be glitches, but it wouldn't just completely fail to work like it currently does.
A workaround for now (although not nice) would be to fix core clock to a low speed (e.g. 250 MHz).
Mapping the Mini UART to Bluetooth pins is possible. I have yet to test the Mini UART with Bluetooth. My Device Tree knowledge is quite limited, but I'll give it a try.
What's more problematic is that the Mini UART uses the core clock, which can vary, particularly in case of thermal events or when there's too little power. However, this applies to *all* users of the Mini UART...
Maybe the baud rate should be tuned by the firmware whenever the core clock is changed. There would still be glitches, but it wouldn't just completely fail to work like it currently does.
A workaround for now (although not nice) would be to fix core clock to a low speed (e.g. 250 MHz).
Mapping the Mini UART to Bluetooth pins is possible. I have yet to test the Mini UART with Bluetooth. My Device Tree knowledge is quite limited, but I'll give it a try.

Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
FWIW, with the new pi3-miniuart-bt overlay, Bluetooth works fine and stable with the Mini UART. I was able to scan, pair, send files over OBEX, and so on. Of course, it is 8x slower than the PL011 UART at 115200 baud. Keep in mind to adjust the "console" value in cmdline.txt and to lock the core clock with core_freq=250 or alternatively force_turbo=1 in config.txt. Also, you have to adjust the systemd control file to use ttyS0 and a lower baud rate of 115200 for hciattach.
-
- Posts: 19
- Joined: Wed Sep 07, 2011 5:18 pm
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
lb,lb wrote:FWIW, with the new pi3-miniuart-bt overlay, Bluetooth works fine and stable with the Mini UART. I was able to scan, pair, send files over OBEX, and so on. Of course, it is 8x slower than the PL011 UART at 115200 baud. Keep in mind to adjust the "console" value in cmdline.txt and to lock the core clock with core_freq=250 or alternatively force_turbo=1 in config.txt. Also, you have to adjust the systemd control file to use ttyS0 and a lower baud rate of 115200 for hciattach.
Thanks for looking into that. Now I just need to understand how to apply the overlays

Steaky
-
- Posts: 2
- Joined: Wed Mar 09, 2016 11:15 pm
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
@steaky1212
To apply an overlay edit your /boot/config.txt file
Then add:
Save and then reboot.
I have gotten that far! LOL I now have serial communication over GPIO14 & GPIO15 but now I have now bluetooth.
I receive this error:
with this command:
config.txt:
hcitool dev sees no devices?
Any advice?
To apply an overlay edit your /boot/config.txt file
Code: Select all
sudo nano /boot/config.txt
Code: Select all
dtoverlay=pi3-miniuart-bt-overlay
I have gotten that far! LOL I now have serial communication over GPIO14 & GPIO15 but now I have now bluetooth.
I receive this error:
Code: Select all
hciuart.service - Configure Bluetooth Modems connected by UART
Loaded: loaded (/lib/systemd/system/hciuart.service; enabled)
Active: failed (Result: exit-code) since Wed 2016-03-09 23:44:11 UTC; 48s ago
Process: 376 ExecStart=/usr/bin/hciattach /dev/ttyS0 bcm43xx 115200 noflow - (code=exited, status=1/FAILURE)
Code: Select all
systemctl status hciuart.service
Code: Select all
dwc_otg.lpm_enable=0 console=serial1,115200 console=tty1 root=/dev/mmcblk0p2 kgdboc=serial1,115200 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Any advice?
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
@twelvearrays
Lock the core clock by adding core_freq=250 to config.txt. Also try launching hciattach manually, what does it say?
Lock the core clock by adding core_freq=250 to config.txt. Also try launching hciattach manually, what does it say?
-
- Posts: 2
- Joined: Wed Mar 09, 2016 11:15 pm
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
@lb
I added core_freq=250 and tried to attach manually and I get a timeout.lb wrote:@twelvearrays
Lock the core clock by adding core_freq=250 to config.txt. Also try launching hciattach manually, what does it say?
Code: Select all
sudo hciattach ttyS0 bcm43xx 115200
bcm43xx_init
Initialization timed out.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 5069
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
Change the serial1 in cmdline.txt to serial0. (That use of serial1 was a short-lived special needed when the miniuart overlay was first added - with the latest firmware it is no longer necessary, and serial0 is always the non-BT uart).
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
Did we get an answer for above?steaky1212 wrote: - Is there any way that the mini-UART could be used for the Bluetooth and the PL011 is exposed on the GPIO header?
I am using the PL011 for several applications. It would be a shame if the RPi 3 does not support the PL011 on the GPIO header.
Thanks, Arjan
http://www.raspberrypi-dmx.com/
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
dtoverlay=pi3-miniuart-bt
Re: Raspberry Pi 3 - Bluetooth PL011 UART (9bit on mini-UART
Thanks. But this is for Linux. Are there any detailed instructions for a baremetal environment?clivem wrote:dtoverlay=pi3-miniuart-bt
- Arjan
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions