scotty101
Posts: 4106
Joined: Fri Jun 08, 2012 6:03 pm

Re: How to use UART 1 on Raspberry Pi 3 ?

Wed Mar 15, 2017 11:46 am

FYI, I didn't create this topic... the OP's post has been deleted

The process is well documented

http://www.hobbytronics.co.uk/raspberry-pi-serial-port
https://www.cube-controls.com/2015/11/0 ... -raspbian/
Last edited by scotty101 on Tue Sep 01, 2020 8:04 am, edited 1 time in total.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

klricks
Posts: 7300
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: How to use UART 1 on Raspberry Pi 3 ?

Wed Mar 15, 2017 12:58 pm

ShadyProgrammer wrote:...I'm not trying to disable the default serial port, what I want to do is to enable the extra serial port
You can't use both at the same time as they are both mapped to the same physical pins 8 & 10.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

fruitoftheloom
Posts: 24587
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How to use UART 1 on Raspberry Pi 3 ?

Wed Mar 15, 2017 3:15 pm

ShadyProgrammer wrote:
klricks wrote:
ShadyProgrammer wrote:...I'm not trying to disable the default serial port, what I want to do is to enable the extra serial port
You can't use both at the same time as they are both mapped to the same physical pins 8 & 10.
Apologies but I just noticed that I didn't add "Compute module" to the title. I'm working on Compute module 3. Two UARTs should be ready available on CM3 am I right ?
The Mods have moved the post to Compute Module Section and fixed the title, they are great :D :D

The RPF web site have a Section devoted to CM: https://www.raspberrypi.org/documentati ... putemodule ;)
Thinking outside the box is better than burying your head in the sand...

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27461
Joined: Sat Jul 30, 2011 7:41 pm

Re: How to use UART 1 on Raspberry Pi 3 ?

Wed Mar 15, 2017 3:43 pm

ShadyProgrammer wrote:I've currently changed "brcm,pins" of "fragment1" on this file:

https://github.com/raspberrypi/linux/bl ... verlay.dts

to 32 and 33 instead of 14 and 15 in the hopes to get UART 1 working this way. I compiled it and moved to /boot/overlays/. Then I added it to /boot/config.txt . I am now able to communicate with UART 1 but unfortunately all I'm getting on the serial port is garbage. Is this the right to go about it at all ?

Also just to get some confusion out of the way when I research the internetz about it:

If I understand correctly UART 1 on pins 32, 33 is called PL011
The native (default) UART 0 on 14. 15 is called mini-UART

is this right ?
Just to double check - you are using the correct (and matching) voltages on your source and destination? The Pi UART is 3v3 IIRC- make sure whatever is on the other end is also 3v3 or you are using a converter (MAX232 rings a bell). Getting the voltages wrong does result in garbled messages.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

nixy82
Posts: 51
Joined: Sat Sep 12, 2015 9:19 am

Re: How to use UART 1 on Raspberry Pi CM3 ?

Wed Mar 15, 2017 4:02 pm

Try adding

Code: Select all

core_freq=250
to /boot/config.txt

JohW
Posts: 9
Joined: Wed Mar 01, 2017 9:17 am

Re: How to use UART 1 on Raspberry Pi CM3 ?

Tue Apr 04, 2017 8:51 am

I had the same problem (using both UARTS on a CM3 simultaneously)

The UART1 depends on the system clock which can be changed by the "ondemand" governor. So the only way I found to get UART1 working reliably is to disable the governor. Here is my config, also with some explanations:

Code: Select all

force_turbo=1
enable_uart=1

# UART0 /dev/ttyAMA0
# this doesn't wirk yet, the log shows
# $ sudo vcdbg log msg
# Failed to load overlay 'uart0
# and I had to set the GPIO pins manually to A2
# raspi-gpio set 36 a2
# raspi-gpio set 37 a2
dtoverlay=uart0,txd0_pin=36,rxd0_pin=37

# UART1 /dev/ttyS0
dtoverlay=uart1,txd1_pin=32,rxd1_pin=33

harsh632
Posts: 1
Joined: Fri Aug 28, 2020 10:58 am

Re: How to use UART 1 on Raspberry Pi CM3 ?

Sat Aug 29, 2020 11:13 am

Hello,

I am facing same issue with UART1 on CM Board. I am not getting any solution from above discussion. Can any one guide me properly.

As per the last comment by JohW, I did the change in /boot/config.txt but I am confused like how to disable the governor as I am not having any background of kernel side.

Thanks,

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

Re: How to use UART 1 on Raspberry Pi CM3 ?

Sat Aug 29, 2020 2:54 pm

With current firmware there should be no need to "manually" stop the core clock from changing - if UART1 is enabled then the core clock will be fixed at the turbo frequency.

What configuration changes have you made, and what results have you seen?

KKVaka
Posts: 1
Joined: Sat Sep 05, 2020 5:36 pm

Re: How to use UART 1 on Raspberry Pi 3 ?

Sat Sep 05, 2020 6:20 pm

Hello.
I need to use hardware UART (PL011) on pins GPIO40 and 41 on CM3+. I can set alt functions for those pins as ALT5 for TXD1 and RXD1, but hardware port is connected now to TXD0 and RXD0 ( on pins GPIO 36 and 37 with ALT3 , I can send data ), miniUART is disabled now ( no ttyS0 at /dev ).
Can you tell my what I have to do for using GPIO40 and 41 with PL011?
Here is a second case to enable miniUART with hi CPU perfomance and use pins GPIO40 and 41with software USART, but I can't find correct version of settings yet...
Serial console is disabled, grep shows only ttyAMA0.
"sudo systemctl disable hciuart" is sended...

Return to “Compute Module”