SlideShare una empresa de Scribd logo
1 de 15
Raspberry Pi 3 + UART/Bluetooth Issues
By: Yeo Kheng Meng (yeokm1@gmail.com)Hackware v1.6 (30 Mar 2016)
1
Video of my presentation can be found here:
• https://engineers.sg/video/raspberry-pi-3-uart-bluetooth-issues--609
Whats new? (Features)
Specifications Raspberry Pi 2 Raspberry Pi 3
CPU BCM2836
Cortex-A7
900Mhz
ARMv7
BCM2837
Cortex-A53
1.2Ghz
ARMv8 (64-bit)
GPU 250Mhz Videocore IV
1080p,30FPS,H.264 video decoding
400Mhz Videocore IV
1080p,60FPS,H.264 video decoding
Wifi - 802.11n, 2.4Ghz only,
single stream 150Mbps
Bluetooth - Bluetooth 4.1 (Dual-mode)
Classic and BLE
2http://raspi.tv/2016/raspberry-pi-3-model-b-launches-today-64-bit-quad-a53-1-2-ghz-bcm2837
Whats new? (Board)
Specifications Raspberry Pi 2 Raspberry Pi 3
LED positions Top left Bottom left
microSD storage Spring No Spring
3
UART (Debug console) issues on RPi 3
4
UART Debug Console
+
USB-TTL cable
https://www.adafruit.com/product/954
• Universal asynchronous receiver/transmitter
5
UART (Serial Debug console) issue
Received output.
• Garbled or nothing
• Output is 72000 instead of 115200 baud
Expected output
6
Hardware architecture (≤ RPi 2)
System on Chip
BCM2835 (RPi 1 B/B+)
/ BCM2836 (RPi 2)
• BCM283x has 2 UARTs
• UART0: Full UART (/dev/ttyAMA0)
• Based on ARM Primecell PL011
• Larger FIFO buffers
• 16x8 transmit
• 16x12 receive
• High performance full feature serial port
• Older RPi models breaks out UART0 to the pin header
• Default use: Debug console
• UART1: “mini UART” (/dev/ttyS0)
UART0
UART1
BCM2835 datasheet: Page 10
https://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
7
System on Chip
BCM2837 (RPi 3)
Hardware architecture (RPi 3)
SDIO
BCM43438 wireless chip
http://raspi.tv/2016/raspberry-pi-3-model-b-launches-today-64-bit-quad-a53-1-2-ghz-bcm2837
Bluetooth 4.1Wifi
8
• UART0: Full UART (/dev/ttyAMA0)
• UART1: “mini UART” (/dev/ttyS0)
UART1
UART0
Why is UART1 a problem?
BCM2835 datasheet: Page 10- 11
https://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
9
Note:
I use BCM2835 datasheet as
datasheets of newer chips have not
been released by Broadcom.
Mini UART implementation should be
the same across BCM283x.
Problem Explanation
• 𝑏𝑎𝑢𝑑𝑟𝑎𝑡𝑒 =
𝑐𝑜𝑟𝑒𝐹𝑟𝑒𝑞
8 ∗(𝑏𝑎𝑢𝑑𝑅𝑎𝑡𝑒𝑅𝑒𝑔+1)
• RPi 3 boot time core frequency is 400Mhz
• RPI baud rate default 115200
• 115200 =
400 000 000
8 ∗ (𝑏𝑎𝑢𝑑𝑅𝑎𝑡𝑒𝑅𝑒𝑔+1)
• baudRateReg calculated on core
frequency retrieved at boot time
• Frequency scaling, may drop to 250Mhz to
save power under low load
• Fluctuating core frequency -> Fluctuating
baud rate
Who is affected?
Anyone who uses the TX/RX header pins
• People who use the serial debug console
• Headless systems
• RPi shields that uses the UART
• Eg. RS232, GPS/GSM
• Device-Device communication to other MCUs or MPUs
• Require high UART performance (aka full UART) and Bluetooth
10
How do we solve this? Part (1/2)
Lock a constant core frequency during boot time
• (For old firmware) Add “core_freq=250” XOR “force_turbo=1” to /boot/config.txt
• Lock core core_freq to minimum or maximum (400Mhz) respectively
• Minimum -> RPi 3 performance will be affected.
• Maximum -> Requires good cooling.
• Can still be throttled to 250 Mhz under low voltage or high temperature conditions
• (For new firmware) Add “enable_uart=1” to /boot/config.txt
• All RPi distributions will eventually support this option going forward
• Similar to “core_freq=250” with clearer intent
• Raspbian latest stable updates does not support this yet
• Need bleeding-edge firmware update: “sudo apt-get install rpi-update” & “sudo rpi-update”
• Arch Linux requires an update to use this option: Just use “pacman –Syu”
• Distros that support this option will disable debug console if “enable_uart=1” is not set
• “enable_uart=1” explanation Raspberry Pi Foundation Engineer Phil Elwell (pelwell)
• https://github.com/raspberrypi/firmware/issues/553#issuecomment-199486644
11
How do we solve this? Part (2/2)
Remap header pins to use Full UART with device
tree overlay (pin-crossbar)
• Add “dtoverlay=pi3-disable-bt” to /boot/config.txt
• Disables Bluetooth in the process as UART1 is unconnected
• Requires extra “sudo systemctl disable hciuart” for Raspbian
• Or add “dtoverlay=pi3-miniuart-bt” to /boot/config.txt
• Bluetooth now uses mini-UART
• Need to add “core_freq=250” or “force_turbo=1” to
/boot/config.txt so Bluetooth via mini UART is usable
• Edit “/lib/systemd/system/hciuart.service” and replace
“ttyAMA0” with “ttyS0” for Raspbian
• Bluetooth’s performance will be affected. Only low-
throughput BLE may be effectively usable.
• If any of these options are used, the serial console will
be enabled unless “enable_uart=0”
12
System on Chip
BCM2837 (RPi 3)
SDIO
BCM43438 wireless chip
Bluetooth 4.1Wifi
• UART0: Full UART (/dev/ttyAMA0)
• UART1: “mini UART” (/dev/ttyS0)
UART0
UART1
Solution summary
Set in /boot/config.txt
• Serial console and normal Bluetooth
• Lock frequency
• Old: “core_freq=250” XOR “force_turbo=1”
• New: ”enable_uart=1”. Add “force_turbo=1” to lock at high frequency.
• High performance Serial
• Switch UART0 and UART1 pins
• No Bluetooth
• “dtoverlay=pi3-disable-bt”
• (Raspbian) Run “sudo systemctl disable hciuart”
• Slow Bluetooth Classic or BLE
• “dtoverlay=pi3-miniuart-bt” AND (“core_freq=250” XOR “force_turbo=1”)
• (Raspbian) Edit “/lib/systemd/system/hciuart.service” and replace “ttyAMA0” with “ttyS0”
• Add “enable_uart=0” to disable debug console
• The use of the mini UART will always require locking of Core frequency
13
Arch Linux Bluetooth’s issues
• Raspbian uses “pi-bluetooth” to provide Bluetooth features
• “pi-bluetooth” has not been ported to Arch Linux
• Someone has posted a temporary package to AUR
• https://archlinuxarm.org/forum/viewtopic.php?f=67&t=10017s
• https://aur.archlinux.org/packages/pi-bluetooth/
• My setup instructions using that package
• https://gist.github.com/yeokm1/d6c3ca927919c61257cd
14
Useful links
1. BCM2835 datasheet: https://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
2. Original Github issue: https://github.com/raspberrypi/firmware/issues/553
3. “enable_uart=1” explanation by Raspberry Pi Foundation Engineer Phil Elwell
https://github.com/raspberrypi/firmware/issues/553#issuecomment-199486644
4. UART DT overlays: http://www.briandorey.com/post/Raspberry-Pi-3-UART-Boot-Overlay-Part-Two
5. Detailed DT overlays: https://github.com/raspberrypi/linux/blob/rpi-4.1.y/arch/arm/boot/dts/overlays/README
6. Arch Linux ARM Bluetooth forum issue thread: https://archlinuxarm.org/forum/viewtopic.php?f=65&t=9961
7. Instructions to enable Arch Linux Bluetooth: https://gist.github.com/yeokm1/d6c3ca927919c61257cd
15

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
 
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VStatic partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
 
I2c drivers
I2c driversI2c drivers
I2c drivers
 
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-VRISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
RISC-V on Edge: Porting EVE and Alpine Linux to RISC-V
 
Spi drivers
Spi driversSpi drivers
Spi drivers
 
Pcie drivers basics
Pcie drivers basicsPcie drivers basics
Pcie drivers basics
 
I2C Drivers
I2C DriversI2C Drivers
I2C Drivers
 
BKK16-205 RDK-B IoT
BKK16-205 RDK-B IoTBKK16-205 RDK-B IoT
BKK16-205 RDK-B IoT
 
Linux dma engine
Linux dma engineLinux dma engine
Linux dma engine
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Slideshare - PCIe
Slideshare - PCIeSlideshare - PCIe
Slideshare - PCIe
 
SPI Protocol
SPI ProtocolSPI Protocol
SPI Protocol
 
RDMA programming design and case studies – for better performance distributed...
RDMA programming design and case studies – for better performance distributed...RDMA programming design and case studies – for better performance distributed...
RDMA programming design and case studies – for better performance distributed...
 
Getting Started with Raspberry Pi
Getting Started with Raspberry PiGetting Started with Raspberry Pi
Getting Started with Raspberry Pi
 
BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
 
PCI express
PCI expressPCI express
PCI express
 
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Processes
ProcessesProcesses
Processes
 

Destacado

PCB Business Card
PCB Business CardPCB Business Card
PCB Business Cardyeokm1
 
Windows 3.1 (WFW) on vintage and modern hardware
Windows 3.1 (WFW) on vintage and modern hardwareWindows 3.1 (WFW) on vintage and modern hardware
Windows 3.1 (WFW) on vintage and modern hardwareyeokm1
 
A Science Project: Building a sound card based on the Covox Speech Thing
A Science Project: Building a sound card based on the Covox Speech ThingA Science Project: Building a sound card based on the Covox Speech Thing
A Science Project: Building a sound card based on the Covox Speech Thingyeokm1
 
Repair Kopitiam Specialty Electrical Equipment
Repair Kopitiam Specialty Electrical EquipmentRepair Kopitiam Specialty Electrical Equipment
Repair Kopitiam Specialty Electrical Equipmentyeokm1
 
Raspberry pi : an introduction
Raspberry pi : an introductionRaspberry pi : an introduction
Raspberry pi : an introductionLTG Oxford
 
Introduction to Bluetooth Low Energy
Introduction to Bluetooth Low EnergyIntroduction to Bluetooth Low Energy
Introduction to Bluetooth Low Energyyeokm1
 
Raspberry Pi 3 Latest PPT - Robomart
Raspberry Pi 3 Latest PPT - RobomartRaspberry Pi 3 Latest PPT - Robomart
Raspberry Pi 3 Latest PPT - RobomartRobomart
 
Repair Kopitiam Electrical Training
Repair Kopitiam Electrical TrainingRepair Kopitiam Electrical Training
Repair Kopitiam Electrical Trainingyeokm1
 
Repair Kopitiam Circuit Breaker Training
Repair Kopitiam Circuit Breaker TrainingRepair Kopitiam Circuit Breaker Training
Repair Kopitiam Circuit Breaker Trainingyeokm1
 
Raspberry Pi Presentation
Raspberry Pi PresentationRaspberry Pi Presentation
Raspberry Pi PresentationGeekizer
 
技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい
技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい
技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたいKenichiro MATOHARA
 
NUS SOC Print
NUS SOC PrintNUS SOC Print
NUS SOC Printyeokm1
 
Distance Machine Locker
Distance Machine LockerDistance Machine Locker
Distance Machine Lockeryeokm1
 
BTLE (Bluetooth Low Energy) and CoreBluetooth
BTLE (Bluetooth Low Energy) and CoreBluetooth BTLE (Bluetooth Low Energy) and CoreBluetooth
BTLE (Bluetooth Low Energy) and CoreBluetooth Zach Dennis
 
Introduction to Windows IoT via Raspberry Pi 3
Introduction to Windows IoT via Raspberry Pi 3Introduction to Windows IoT via Raspberry Pi 3
Introduction to Windows IoT via Raspberry Pi 3Lee Richardson
 
A Science Project: Swift Serial Chat
A Science Project: Swift Serial ChatA Science Project: Swift Serial Chat
A Science Project: Swift Serial Chatyeokm1
 
Raspberry Pi Based GPS Tracking System and Face Recognition System.
Raspberry Pi Based GPS Tracking System and Face Recognition System.Raspberry Pi Based GPS Tracking System and Face Recognition System.
Raspberry Pi Based GPS Tracking System and Face Recognition System.Ruthvik Vaila
 
Reflections on Trusting Trust
Reflections on Trusting TrustReflections on Trusting Trust
Reflections on Trusting Trustyeokm1
 

Destacado (20)

PCB Business Card
PCB Business CardPCB Business Card
PCB Business Card
 
Windows 3.1 (WFW) on vintage and modern hardware
Windows 3.1 (WFW) on vintage and modern hardwareWindows 3.1 (WFW) on vintage and modern hardware
Windows 3.1 (WFW) on vintage and modern hardware
 
A Science Project: Building a sound card based on the Covox Speech Thing
A Science Project: Building a sound card based on the Covox Speech ThingA Science Project: Building a sound card based on the Covox Speech Thing
A Science Project: Building a sound card based on the Covox Speech Thing
 
Repair Kopitiam Specialty Electrical Equipment
Repair Kopitiam Specialty Electrical EquipmentRepair Kopitiam Specialty Electrical Equipment
Repair Kopitiam Specialty Electrical Equipment
 
Raspberry pi : an introduction
Raspberry pi : an introductionRaspberry pi : an introduction
Raspberry pi : an introduction
 
Introduction to Bluetooth Low Energy
Introduction to Bluetooth Low EnergyIntroduction to Bluetooth Low Energy
Introduction to Bluetooth Low Energy
 
Raspberry Pi 3 Latest PPT - Robomart
Raspberry Pi 3 Latest PPT - RobomartRaspberry Pi 3 Latest PPT - Robomart
Raspberry Pi 3 Latest PPT - Robomart
 
Repair Kopitiam Electrical Training
Repair Kopitiam Electrical TrainingRepair Kopitiam Electrical Training
Repair Kopitiam Electrical Training
 
Repair Kopitiam Circuit Breaker Training
Repair Kopitiam Circuit Breaker TrainingRepair Kopitiam Circuit Breaker Training
Repair Kopitiam Circuit Breaker Training
 
Raspberry pi 3
Raspberry pi 3Raspberry pi 3
Raspberry pi 3
 
Raspberry Pi Presentation
Raspberry Pi PresentationRaspberry Pi Presentation
Raspberry Pi Presentation
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
 
技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい
技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい
技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい
 
NUS SOC Print
NUS SOC PrintNUS SOC Print
NUS SOC Print
 
Distance Machine Locker
Distance Machine LockerDistance Machine Locker
Distance Machine Locker
 
BTLE (Bluetooth Low Energy) and CoreBluetooth
BTLE (Bluetooth Low Energy) and CoreBluetooth BTLE (Bluetooth Low Energy) and CoreBluetooth
BTLE (Bluetooth Low Energy) and CoreBluetooth
 
Introduction to Windows IoT via Raspberry Pi 3
Introduction to Windows IoT via Raspberry Pi 3Introduction to Windows IoT via Raspberry Pi 3
Introduction to Windows IoT via Raspberry Pi 3
 
A Science Project: Swift Serial Chat
A Science Project: Swift Serial ChatA Science Project: Swift Serial Chat
A Science Project: Swift Serial Chat
 
Raspberry Pi Based GPS Tracking System and Face Recognition System.
Raspberry Pi Based GPS Tracking System and Face Recognition System.Raspberry Pi Based GPS Tracking System and Face Recognition System.
Raspberry Pi Based GPS Tracking System and Face Recognition System.
 
Reflections on Trusting Trust
Reflections on Trusting TrustReflections on Trusting Trust
Reflections on Trusting Trust
 

Similar a Raspberry Pi 3 + UART/Bluetooth issues

M series technical presentation-part 1
M series technical presentation-part 1M series technical presentation-part 1
M series technical presentation-part 1xKinAnx
 
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdfBRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdfssusercbaa33
 
Cyclone II FPGA Overview
Cyclone II FPGA OverviewCyclone II FPGA Overview
Cyclone II FPGA OverviewPremier Farnell
 
Product Selection Guide
Product Selection GuideProduct Selection Guide
Product Selection GuideRoozbeh Molavi
 
Cambium network ptp 810 series 01 00 system release note
Cambium network ptp 810 series 01 00 system release noteCambium network ptp 810 series 01 00 system release note
Cambium network ptp 810 series 01 00 system release noteAdvantec Distribution
 
SoM with Zynq UltraScale device
SoM with Zynq UltraScale deviceSoM with Zynq UltraScale device
SoM with Zynq UltraScale devicenie, jack
 
Boards for the IoT-Prototyping
Boards for the IoT-PrototypingBoards for the IoT-Prototyping
Boards for the IoT-PrototypingLars Gregori
 
American Fibertek MX50FXSTPOEPLUS Data Sheet
American Fibertek MX50FXSTPOEPLUS Data SheetAmerican Fibertek MX50FXSTPOEPLUS Data Sheet
American Fibertek MX50FXSTPOEPLUS Data SheetJMAC Supply
 
American Fibertek MX50FX1FSTPOEPLUS Data Sheet
American Fibertek MX50FX1FSTPOEPLUS Data SheetAmerican Fibertek MX50FX1FSTPOEPLUS Data Sheet
American Fibertek MX50FX1FSTPOEPLUS Data SheetJMAC Supply
 
Webinar: BlueNRG-LP - Bluetooth 5.2 de longo alcance para aplicações industriais
Webinar: BlueNRG-LP - Bluetooth 5.2 de longo alcance para aplicações industriaisWebinar: BlueNRG-LP - Bluetooth 5.2 de longo alcance para aplicações industriais
Webinar: BlueNRG-LP - Bluetooth 5.2 de longo alcance para aplicações industriaisEmbarcados
 
MPC8313E PowerQUICC II Pro Processor
MPC8313E PowerQUICC II Pro ProcessorMPC8313E PowerQUICC II Pro Processor
MPC8313E PowerQUICC II Pro ProcessorPremier Farnell
 
Hacom%20pf sense%20quick start%20guide
Hacom%20pf sense%20quick start%20guideHacom%20pf sense%20quick start%20guide
Hacom%20pf sense%20quick start%20guideHARRY CHAN PUTRA
 
4 Channel Relay Board 5V-Bluetooth Compatible for Arduino
4 Channel Relay Board 5V-Bluetooth Compatible for Arduino4 Channel Relay Board 5V-Bluetooth Compatible for Arduino
4 Channel Relay Board 5V-Bluetooth Compatible for ArduinoRaghav Shetty
 
Piccolo F2806x Microcontrollers
Piccolo F2806x MicrocontrollersPiccolo F2806x Microcontrollers
Piccolo F2806x MicrocontrollersPremier Farnell
 
American Fibertek MTX46FXSTPOEPLUS Data Sheet
American Fibertek MTX46FXSTPOEPLUS Data SheetAmerican Fibertek MTX46FXSTPOEPLUS Data Sheet
American Fibertek MTX46FXSTPOEPLUS Data SheetJMAC Supply
 

Similar a Raspberry Pi 3 + UART/Bluetooth issues (20)

M series technical presentation-part 1
M series technical presentation-part 1M series technical presentation-part 1
M series technical presentation-part 1
 
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdfBRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdf
 
Cyclone II FPGA Overview
Cyclone II FPGA OverviewCyclone II FPGA Overview
Cyclone II FPGA Overview
 
Product Selection Guide
Product Selection GuideProduct Selection Guide
Product Selection Guide
 
Cambium network ptp 810 series 01 00 system release note
Cambium network ptp 810 series 01 00 system release noteCambium network ptp 810 series 01 00 system release note
Cambium network ptp 810 series 01 00 system release note
 
Mother board
Mother boardMother board
Mother board
 
SoM with Zynq UltraScale device
SoM with Zynq UltraScale deviceSoM with Zynq UltraScale device
SoM with Zynq UltraScale device
 
U8638manual
U8638manualU8638manual
U8638manual
 
uCluster
uClusteruCluster
uCluster
 
Boards for the IoT-Prototyping
Boards for the IoT-PrototypingBoards for the IoT-Prototyping
Boards for the IoT-Prototyping
 
Soyo syd6iba
Soyo syd6ibaSoyo syd6iba
Soyo syd6iba
 
American Fibertek MX50FXSTPOEPLUS Data Sheet
American Fibertek MX50FXSTPOEPLUS Data SheetAmerican Fibertek MX50FXSTPOEPLUS Data Sheet
American Fibertek MX50FXSTPOEPLUS Data Sheet
 
American Fibertek MX50FX1FSTPOEPLUS Data Sheet
American Fibertek MX50FX1FSTPOEPLUS Data SheetAmerican Fibertek MX50FX1FSTPOEPLUS Data Sheet
American Fibertek MX50FX1FSTPOEPLUS Data Sheet
 
Webinar: BlueNRG-LP - Bluetooth 5.2 de longo alcance para aplicações industriais
Webinar: BlueNRG-LP - Bluetooth 5.2 de longo alcance para aplicações industriaisWebinar: BlueNRG-LP - Bluetooth 5.2 de longo alcance para aplicações industriais
Webinar: BlueNRG-LP - Bluetooth 5.2 de longo alcance para aplicações industriais
 
MPC8313E PowerQUICC II Pro Processor
MPC8313E PowerQUICC II Pro ProcessorMPC8313E PowerQUICC II Pro Processor
MPC8313E PowerQUICC II Pro Processor
 
Hacom%20pf sense%20quick start%20guide
Hacom%20pf sense%20quick start%20guideHacom%20pf sense%20quick start%20guide
Hacom%20pf sense%20quick start%20guide
 
Msp430
Msp430Msp430
Msp430
 
4 Channel Relay Board 5V-Bluetooth Compatible for Arduino
4 Channel Relay Board 5V-Bluetooth Compatible for Arduino4 Channel Relay Board 5V-Bluetooth Compatible for Arduino
4 Channel Relay Board 5V-Bluetooth Compatible for Arduino
 
Piccolo F2806x Microcontrollers
Piccolo F2806x MicrocontrollersPiccolo F2806x Microcontrollers
Piccolo F2806x Microcontrollers
 
American Fibertek MTX46FXSTPOEPLUS Data Sheet
American Fibertek MTX46FXSTPOEPLUS Data SheetAmerican Fibertek MTX46FXSTPOEPLUS Data Sheet
American Fibertek MTX46FXSTPOEPLUS Data Sheet
 

Más de yeokm1

I became a Private Pilot and this is my story
I became a Private Pilot and this is my storyI became a Private Pilot and this is my story
I became a Private Pilot and this is my storyyeokm1
 
What's inside a Cessna 172 and flying a light plane
What's inside a Cessna 172 and flying a light planeWhat's inside a Cessna 172 and flying a light plane
What's inside a Cessna 172 and flying a light planeyeokm1
 
Speaking at Tech meetups/conferences for Junior Devs
Speaking at Tech meetups/conferences for Junior DevsSpeaking at Tech meetups/conferences for Junior Devs
Speaking at Tech meetups/conferences for Junior Devsyeokm1
 
Reflections on Trusting Trust for Go
Reflections on Trusting Trust for GoReflections on Trusting Trust for Go
Reflections on Trusting Trust for Goyeokm1
 
Meltdown and Spectre
Meltdown and SpectreMeltdown and Spectre
Meltdown and Spectreyeokm1
 
Gentoo on a 486
Gentoo on a 486Gentoo on a 486
Gentoo on a 486yeokm1
 
BLE Localiser (Full) for iOS Dev Scout
BLE Localiser (Full) for iOS Dev ScoutBLE Localiser (Full) for iOS Dev Scout
BLE Localiser (Full) for iOS Dev Scoutyeokm1
 
BLE Localiser for iOS Conf SG 2017
BLE Localiser for iOS Conf SG 2017BLE Localiser for iOS Conf SG 2017
BLE Localiser for iOS Conf SG 2017yeokm1
 
Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
 Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiteryeokm1
 
PCB Business Card (Singapore Power)
PCB Business Card (Singapore Power)PCB Business Card (Singapore Power)
PCB Business Card (Singapore Power)yeokm1
 
SP Auto Door Unlocker
SP Auto Door UnlockerSP Auto Door Unlocker
SP Auto Door Unlockeryeokm1
 
SP IoT Doorbell
SP IoT DoorbellSP IoT Doorbell
SP IoT Doorbellyeokm1
 
The slide rule
The slide ruleThe slide rule
The slide ruleyeokm1
 
A2: Analog Malicious Hardware
A2: Analog Malicious HardwareA2: Analog Malicious Hardware
A2: Analog Malicious Hardwareyeokm1
 
My Life as a Maker
My Life as a MakerMy Life as a Maker
My Life as a Makeryeokm1
 
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huang
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' HuangTalk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huang
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huangyeokm1
 
Intel Edison: Beyond the Breadboard
Intel Edison: Beyond the BreadboardIntel Edison: Beyond the Breadboard
Intel Edison: Beyond the Breadboardyeokm1
 
The Linux Scheduler: a Decade of Wasted Cores
The Linux Scheduler: a Decade of Wasted CoresThe Linux Scheduler: a Decade of Wasted Cores
The Linux Scheduler: a Decade of Wasted Coresyeokm1
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduinoyeokm1
 
HC-SR04 Ultrasonic sensor with Arduino
HC-SR04 Ultrasonic sensor with ArduinoHC-SR04 Ultrasonic sensor with Arduino
HC-SR04 Ultrasonic sensor with Arduinoyeokm1
 

Más de yeokm1 (20)

I became a Private Pilot and this is my story
I became a Private Pilot and this is my storyI became a Private Pilot and this is my story
I became a Private Pilot and this is my story
 
What's inside a Cessna 172 and flying a light plane
What's inside a Cessna 172 and flying a light planeWhat's inside a Cessna 172 and flying a light plane
What's inside a Cessna 172 and flying a light plane
 
Speaking at Tech meetups/conferences for Junior Devs
Speaking at Tech meetups/conferences for Junior DevsSpeaking at Tech meetups/conferences for Junior Devs
Speaking at Tech meetups/conferences for Junior Devs
 
Reflections on Trusting Trust for Go
Reflections on Trusting Trust for GoReflections on Trusting Trust for Go
Reflections on Trusting Trust for Go
 
Meltdown and Spectre
Meltdown and SpectreMeltdown and Spectre
Meltdown and Spectre
 
Gentoo on a 486
Gentoo on a 486Gentoo on a 486
Gentoo on a 486
 
BLE Localiser (Full) for iOS Dev Scout
BLE Localiser (Full) for iOS Dev ScoutBLE Localiser (Full) for iOS Dev Scout
BLE Localiser (Full) for iOS Dev Scout
 
BLE Localiser for iOS Conf SG 2017
BLE Localiser for iOS Conf SG 2017BLE Localiser for iOS Conf SG 2017
BLE Localiser for iOS Conf SG 2017
 
Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
 Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
Repair Kopitiam Specialty Tools (Part 2): Short Circuit Limiter
 
PCB Business Card (Singapore Power)
PCB Business Card (Singapore Power)PCB Business Card (Singapore Power)
PCB Business Card (Singapore Power)
 
SP Auto Door Unlocker
SP Auto Door UnlockerSP Auto Door Unlocker
SP Auto Door Unlocker
 
SP IoT Doorbell
SP IoT DoorbellSP IoT Doorbell
SP IoT Doorbell
 
The slide rule
The slide ruleThe slide rule
The slide rule
 
A2: Analog Malicious Hardware
A2: Analog Malicious HardwareA2: Analog Malicious Hardware
A2: Analog Malicious Hardware
 
My Life as a Maker
My Life as a MakerMy Life as a Maker
My Life as a Maker
 
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huang
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' HuangTalk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huang
Talk on The Essential Guide to Electronics in Shenzhen by Andrew 'Bunnie' Huang
 
Intel Edison: Beyond the Breadboard
Intel Edison: Beyond the BreadboardIntel Edison: Beyond the Breadboard
Intel Edison: Beyond the Breadboard
 
The Linux Scheduler: a Decade of Wasted Cores
The Linux Scheduler: a Decade of Wasted CoresThe Linux Scheduler: a Decade of Wasted Cores
The Linux Scheduler: a Decade of Wasted Cores
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
HC-SR04 Ultrasonic sensor with Arduino
HC-SR04 Ultrasonic sensor with ArduinoHC-SR04 Ultrasonic sensor with Arduino
HC-SR04 Ultrasonic sensor with Arduino
 

Último

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Último (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 

Raspberry Pi 3 + UART/Bluetooth issues

  • 1. Raspberry Pi 3 + UART/Bluetooth Issues By: Yeo Kheng Meng (yeokm1@gmail.com)Hackware v1.6 (30 Mar 2016) 1 Video of my presentation can be found here: • https://engineers.sg/video/raspberry-pi-3-uart-bluetooth-issues--609
  • 2. Whats new? (Features) Specifications Raspberry Pi 2 Raspberry Pi 3 CPU BCM2836 Cortex-A7 900Mhz ARMv7 BCM2837 Cortex-A53 1.2Ghz ARMv8 (64-bit) GPU 250Mhz Videocore IV 1080p,30FPS,H.264 video decoding 400Mhz Videocore IV 1080p,60FPS,H.264 video decoding Wifi - 802.11n, 2.4Ghz only, single stream 150Mbps Bluetooth - Bluetooth 4.1 (Dual-mode) Classic and BLE 2http://raspi.tv/2016/raspberry-pi-3-model-b-launches-today-64-bit-quad-a53-1-2-ghz-bcm2837
  • 3. Whats new? (Board) Specifications Raspberry Pi 2 Raspberry Pi 3 LED positions Top left Bottom left microSD storage Spring No Spring 3
  • 4. UART (Debug console) issues on RPi 3 4
  • 5. UART Debug Console + USB-TTL cable https://www.adafruit.com/product/954 • Universal asynchronous receiver/transmitter 5
  • 6. UART (Serial Debug console) issue Received output. • Garbled or nothing • Output is 72000 instead of 115200 baud Expected output 6
  • 7. Hardware architecture (≤ RPi 2) System on Chip BCM2835 (RPi 1 B/B+) / BCM2836 (RPi 2) • BCM283x has 2 UARTs • UART0: Full UART (/dev/ttyAMA0) • Based on ARM Primecell PL011 • Larger FIFO buffers • 16x8 transmit • 16x12 receive • High performance full feature serial port • Older RPi models breaks out UART0 to the pin header • Default use: Debug console • UART1: “mini UART” (/dev/ttyS0) UART0 UART1 BCM2835 datasheet: Page 10 https://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf 7
  • 8. System on Chip BCM2837 (RPi 3) Hardware architecture (RPi 3) SDIO BCM43438 wireless chip http://raspi.tv/2016/raspberry-pi-3-model-b-launches-today-64-bit-quad-a53-1-2-ghz-bcm2837 Bluetooth 4.1Wifi 8 • UART0: Full UART (/dev/ttyAMA0) • UART1: “mini UART” (/dev/ttyS0) UART1 UART0
  • 9. Why is UART1 a problem? BCM2835 datasheet: Page 10- 11 https://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf 9 Note: I use BCM2835 datasheet as datasheets of newer chips have not been released by Broadcom. Mini UART implementation should be the same across BCM283x. Problem Explanation • 𝑏𝑎𝑢𝑑𝑟𝑎𝑡𝑒 = 𝑐𝑜𝑟𝑒𝐹𝑟𝑒𝑞 8 ∗(𝑏𝑎𝑢𝑑𝑅𝑎𝑡𝑒𝑅𝑒𝑔+1) • RPi 3 boot time core frequency is 400Mhz • RPI baud rate default 115200 • 115200 = 400 000 000 8 ∗ (𝑏𝑎𝑢𝑑𝑅𝑎𝑡𝑒𝑅𝑒𝑔+1) • baudRateReg calculated on core frequency retrieved at boot time • Frequency scaling, may drop to 250Mhz to save power under low load • Fluctuating core frequency -> Fluctuating baud rate
  • 10. Who is affected? Anyone who uses the TX/RX header pins • People who use the serial debug console • Headless systems • RPi shields that uses the UART • Eg. RS232, GPS/GSM • Device-Device communication to other MCUs or MPUs • Require high UART performance (aka full UART) and Bluetooth 10
  • 11. How do we solve this? Part (1/2) Lock a constant core frequency during boot time • (For old firmware) Add “core_freq=250” XOR “force_turbo=1” to /boot/config.txt • Lock core core_freq to minimum or maximum (400Mhz) respectively • Minimum -> RPi 3 performance will be affected. • Maximum -> Requires good cooling. • Can still be throttled to 250 Mhz under low voltage or high temperature conditions • (For new firmware) Add “enable_uart=1” to /boot/config.txt • All RPi distributions will eventually support this option going forward • Similar to “core_freq=250” with clearer intent • Raspbian latest stable updates does not support this yet • Need bleeding-edge firmware update: “sudo apt-get install rpi-update” & “sudo rpi-update” • Arch Linux requires an update to use this option: Just use “pacman –Syu” • Distros that support this option will disable debug console if “enable_uart=1” is not set • “enable_uart=1” explanation Raspberry Pi Foundation Engineer Phil Elwell (pelwell) • https://github.com/raspberrypi/firmware/issues/553#issuecomment-199486644 11
  • 12. How do we solve this? Part (2/2) Remap header pins to use Full UART with device tree overlay (pin-crossbar) • Add “dtoverlay=pi3-disable-bt” to /boot/config.txt • Disables Bluetooth in the process as UART1 is unconnected • Requires extra “sudo systemctl disable hciuart” for Raspbian • Or add “dtoverlay=pi3-miniuart-bt” to /boot/config.txt • Bluetooth now uses mini-UART • Need to add “core_freq=250” or “force_turbo=1” to /boot/config.txt so Bluetooth via mini UART is usable • Edit “/lib/systemd/system/hciuart.service” and replace “ttyAMA0” with “ttyS0” for Raspbian • Bluetooth’s performance will be affected. Only low- throughput BLE may be effectively usable. • If any of these options are used, the serial console will be enabled unless “enable_uart=0” 12 System on Chip BCM2837 (RPi 3) SDIO BCM43438 wireless chip Bluetooth 4.1Wifi • UART0: Full UART (/dev/ttyAMA0) • UART1: “mini UART” (/dev/ttyS0) UART0 UART1
  • 13. Solution summary Set in /boot/config.txt • Serial console and normal Bluetooth • Lock frequency • Old: “core_freq=250” XOR “force_turbo=1” • New: ”enable_uart=1”. Add “force_turbo=1” to lock at high frequency. • High performance Serial • Switch UART0 and UART1 pins • No Bluetooth • “dtoverlay=pi3-disable-bt” • (Raspbian) Run “sudo systemctl disable hciuart” • Slow Bluetooth Classic or BLE • “dtoverlay=pi3-miniuart-bt” AND (“core_freq=250” XOR “force_turbo=1”) • (Raspbian) Edit “/lib/systemd/system/hciuart.service” and replace “ttyAMA0” with “ttyS0” • Add “enable_uart=0” to disable debug console • The use of the mini UART will always require locking of Core frequency 13
  • 14. Arch Linux Bluetooth’s issues • Raspbian uses “pi-bluetooth” to provide Bluetooth features • “pi-bluetooth” has not been ported to Arch Linux • Someone has posted a temporary package to AUR • https://archlinuxarm.org/forum/viewtopic.php?f=67&t=10017s • https://aur.archlinux.org/packages/pi-bluetooth/ • My setup instructions using that package • https://gist.github.com/yeokm1/d6c3ca927919c61257cd 14
  • 15. Useful links 1. BCM2835 datasheet: https://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf 2. Original Github issue: https://github.com/raspberrypi/firmware/issues/553 3. “enable_uart=1” explanation by Raspberry Pi Foundation Engineer Phil Elwell https://github.com/raspberrypi/firmware/issues/553#issuecomment-199486644 4. UART DT overlays: http://www.briandorey.com/post/Raspberry-Pi-3-UART-Boot-Overlay-Part-Two 5. Detailed DT overlays: https://github.com/raspberrypi/linux/blob/rpi-4.1.y/arch/arm/boot/dts/overlays/README 6. Arch Linux ARM Bluetooth forum issue thread: https://archlinuxarm.org/forum/viewtopic.php?f=65&t=9961 7. Instructions to enable Arch Linux Bluetooth: https://gist.github.com/yeokm1/d6c3ca927919c61257cd 15