-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update UART documentation for Raspberry Pi 5 #3294
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a few things. This may not be an exhaustive list, but I'll struggle to see more until these are fixed.
@@ -4,6 +4,32 @@ There are two types of UART available on the Raspberry Pi - http://infocenter.a | |||
|
|||
All UARTs on the Raspberry Pi are 3.3V only - damage will occur if they are connected to 5V systems. An adaptor can be used to connect to 5V systems. Alternatively, low-cost USB to 3.3V serial adaptors are available from various third parties. | |||
|
|||
=== Raspberry Pi 5 | |||
|
|||
On the Raspberry Pi 5, the primary UART is the mini UART port. The Raspberry Pi 5 also has an additional four PL011s, which are disabled by default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No - on Pi 5 the default primary UART is UART10 (on the 3-pin Debug connector).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And there are 4 additional PL011 UARTs, disabled by default, but they are labelled UART1 to UART4.
@@ -118,7 +148,14 @@ Linux devices on Raspberry Pi OS: | |||
| secondary UART | |||
|=== | |||
|
|||
NOTE: `/dev/serial0` and `/dev/serial1` are symbolic links which point to either `/dev/ttyS0` or `/dev/ttyAMA0`. | |||
`/dev/serial0` and `/dev/serial1` are symbolic links which point to either `/dev/ttyS0` or `/dev/ttyAMA0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or /dev/ttyAMA10
on Pi 5.
|
||
| Raspberry Pi 5 | ||
| secondary (Bluetooth) | ||
| primary | ||
|=== | ||
|
||
NOTE: The mini UART is disabled by default, whether it is designated primary or secondary UART. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No - only if it is the primary, or if Bluetooth is disabled.
@@ -96,6 +122,10 @@ The following table summarises the assignment of the first two UARTs: | |||
| Raspberry Pi 4 | |||
| secondary (Bluetooth) | |||
| primary | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would take Pi 5 out of this table - it's Bluetooth is controlled by yet another UART, not previously discussed. It can't be used for anything else, and with the latest kernels it doesn't get a /dev/tty*
entry, so it's almost as if it doesn't exist.
Alternatively, change the table column headings to be Model, Primary, Secondary and put the UART numbers in each row (with a special note for Pi 5).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the column headings to "Primary/console" and "Secondary/Bluetooth". Drop the third column - it's all not needed (and mostly wrong).
[source,bash] | ||
---- | ||
dtparam=krnbt=off | ||
---- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, this is not recommended, and the option may not work on all models in future.
@@ -171,7 +208,7 @@ By default, the primary UART is assigned to the Linux console. If you wish to us | |||
|
|||
Although the Linux kernel starts the UARTs relatively early in the boot process, it is still long after some critical bits of infrastructure have been set up. A failure in those early stages can be hard to diagnose without access to the kernel log messages from that time. To enable `earlycon` support for one of the UARTs, add one of the following options to `cmdline.txt`, depending on which UART is the primary: | |||
|
|||
For Raspberry Pi 4, 400 and Compute Module 4: | |||
For Raspberry Pi 5, 4, 400 and Compute Module 4: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No - Pi 5 is different. The earlycon output only appears on the 3-pin Debug connector, and the magic runes are:
earlycon=pl011,0x107d001000,115200n8
@@ -4,6 +4,32 @@ There are two types of UART available on the Raspberry Pi - http://infocenter.a | |||
|
|||
All UARTs on the Raspberry Pi are 3.3V only - damage will occur if they are connected to 5V systems. An adaptor can be used to connect to 5V systems. Alternatively, low-cost USB to 3.3V serial adaptors are available from various third parties. | |||
|
|||
=== Raspberry Pi 5 | |||
|
|||
On the Raspberry Pi 5, the primary UART is the mini UART port. The Raspberry Pi 5 also has an additional four PL011s, which are disabled by default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we've ever referred to this as "mini UART port" anywhere?
@@ -118,7 +148,14 @@ Linux devices on Raspberry Pi OS: | |||
| secondary UART | |||
|=== | |||
|
|||
NOTE: `/dev/serial0` and `/dev/serial1` are symbolic links which point to either `/dev/ttyS0` or `/dev/ttyAMA0`. | |||
`/dev/serial0` and `/dev/serial1` are symbolic links which point to either `/dev/ttyS0` or `/dev/ttyAMA0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again I don't think I've ever seen us use the term "mini UART"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a thing - the cut-down 8250 clone - and I'm sure some of my early documentation referred to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 2711 datasheet refers to it as a mini UART. That's the terminology that we have always used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fascinating. I've never heard anyone refer to it like that. But then I haven't seen the 2711 datasheet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. 🤷♂️
We're still not referring to it in the Pi 5 documentation as the mini UART though. Most people who read the Pi 5 online documentation have not read the BCM2711 datasheet. We've been referring to it as "the dedicated debug UART connector" so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Pi 5 doesn't possess a mini UART, as I've already commented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Alasdair might be confusing what Phil and James are calling the "mini UART" (the cut-down 8250 clone in the SoCs for Pi0-4) which is also mentioned in https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-uarts , with the 3-pin debug UART connector on the Pi 5? (which I agree shouldn't be called a "mini UART").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I am indeed doing that.
@pelwell I would appreciate a glance at the latest changes. In particular, the new UART table summarizing primary, secondary and Bluetooth. Given the new setup, I'm not sure if we have a good value to use for the Bluetooth column in the Pi 5 row -- maybe you can think of a reasonable value or a decent note. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's looking much better - just a few remaining issues.
@@ -4,6 +4,30 @@ There are two types of UART available on the Raspberry Pi - http://infocenter.a | |||
|
|||
All UARTs on the Raspberry Pi are 3.3V only - damage will occur if they are connected to 5V systems. An adaptor can be used to connect to 5V systems. Alternatively, low-cost USB to 3.3V serial adaptors are available from various third parties. | |||
|
|||
=== Raspberry Pi 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "additional" comment makes more sense after the Pi 0-3 section (and after Pi 4 is more logical), and we should mention that the mini-UART has gone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the section and added a note about the mini UART.
@@ -96,6 +122,10 @@ The following table summarises the assignment of the first two UARTs: | |||
| Raspberry Pi 4 | |||
| secondary (Bluetooth) | |||
| primary | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the column headings to "Primary/console" and "Secondary/Bluetooth". Drop the third column - it's all not needed (and mostly wrong).
dtparam=krnbt=off | ||
---- | ||
|
||
TIP: This option may not work on all models in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"This option is almost certainly not what you really want, and may not work on all models in the future."
Ready to merge @nathan-contino @pelwell ? |
Not yet - the Primary/Secondary table still has a Bluetooth column, for a start. |
Updated as per your recommendations. Check again -- I just pushed it a minute ago. |
Sorry - 3 more changes, then I think we're done:
|
Thanks @pelwell, updated! |
@aallan should be good to go now. |
Thanks @pelwell ! |
|
||
NOTE: The mini UART is disabled by default, whether it is designated primary or secondary UART. | ||
| Raspberry Pi 5 | ||
| UART10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is UART10? it is not mentioned in the table of UART0 -> UART4 above. This isn't super clear. Nor is it clear how this relates to settings like /boot/cmdline.txt - is this table defaults?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The information is there, just spread across multiple sections:
On the Raspberry Pi 5, the primary UART appears on the Debug header.
and:
Model | Primary | Secondary |
---|---|---|
Raspberry Pi 5 | UART10 | dedicated UART |
and:
/dev/ttyAMA10 | Raspberry Pi 5 Debug UART
and:
On the Raspberry Pi 5, /dev/serial0 is a symbolic link that points to /dev/ttyAMA10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok maybe to explain my confusion a bit more. I think firstly it's not clear that /dev/ttyAMAx refers to UARTx. And I'm still not clear which UART from the PL011 is being used for UART10 - or is it another UART altogether? "Raspberry Pi 5 has an additional four PL011s, which are disabled by default:" doesn't mention UART10 so it might be handy to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the Pi 5 UARTs we use are PL011s. UARTs 0-4 are in the RP1 I/O chip, UART10 is in the BCM2712 SoC.
@pelwell , I would appreciate a sanity check to make sure that these changes are correct. I am no UART expert.