RPi: Enable serial console on RPi 4 B

Message ID 20250407144723.273275-1-nt@ilbers.de
State Under Review
Headers show
Series RPi: Enable serial console on RPi 4 B | expand

Commit Message

Natalia Tasci April 7, 2025, 2:47 p.m. UTC
Tested with Raspbian Linux 12, baud rate of 115200 bps, 500 lines kernel
log.

Signed-off-by: Natalia Tasci <nt@ilbers.de>
---
 meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Felix Moessbauer April 7, 2025, 4:39 p.m. UTC | #1
On Mon, 2025-04-07 at 16:47 +0200, Natalia Tasci wrote:
> Tested with Raspbian Linux 12, baud rate of 115200 bps, 500 lines
> kernel
> log.

I thought about this as well. We should also consider switching the
RPi4b target over to EFI, as done here:
https://github.com/siemens/mtda/commit/37b0349f59b1c608727907c771f047fb72003fa8

By that, things like the kernel cmdline can be done by the imager and
no longer need to come from bsp packages. This would also easily enable
the use of mount-by-uuid to support USB boot and SD boot at the same
time.

Felix

> 
> Signed-off-by: Natalia Tasci <nt@ilbers.de>
> ---
>  meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
> b/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
> index 417d53f1..6d742f27 100644
> --- a/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
> +++ b/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
> @@ -1,5 +1,11 @@
>  [pi3]
>  # Restore UART0/ttyAMA0 over GPIOs 14 & 15
> +# On RPi 3, using mini UART for serial console is unstable.
> +# 1/3 boots produce garbage and doesn't reach login
>  dtoverlay=miniuart-bt
>  
> +[pi4]
> +# Enable mini UART (UART1/ttyS0) for serial console for RPi 4
> +enable_uart=1
> +
>  [all]
> -- 
> 2.39.5
Natalia Tasci April 10, 2025, 10:19 a.m. UTC | #2
Hi Felix,

On 4/7/25 18:39, MOESSBAUER, Felix wrote:
> On Mon, 2025-04-07 at 16:47 +0200, Natalia Tasci wrote:
>> Tested with Raspbian Linux 12, baud rate of 115200 bps, 500 lines
>> kernel
>> log.
> I thought about this as well. We should also consider switching the
> RPi4b target over to EFI, as done here:
> https://github.com/siemens/mtda/commit/37b0349f59b1c608727907c771f047fb72003fa8
>
> By that, things like the kernel cmdline can be done by the imager and
> no longer need to come from bsp packages. This would also easily enable
> the use of mount-by-uuid to support USB boot and SD boot at the same
> time.

Thanks for the input. Doing this by the imager sounds reasonable. We 
could consider the improvement after release.

With kind regards,

Natalia



> Felix
>
>> Signed-off-by: Natalia Tasci <nt@ilbers.de>
>> ---
>>   meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
>> b/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
>> index 417d53f1..6d742f27 100644
>> --- a/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
>> +++ b/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
>> @@ -1,5 +1,11 @@
>>   [pi3]
>>   # Restore UART0/ttyAMA0 over GPIOs 14 & 15
>> +# On RPi 3, using mini UART for serial console is unstable.
>> +# 1/3 boots produce garbage and doesn't reach login
>>   dtoverlay=miniuart-bt
>>   
>> +[pi4]
>> +# Enable mini UART (UART1/ttyS0) for serial console for RPi 4
>> +enable_uart=1
>> +
>>   [all]
>> -- 
>> 2.39.5

Patch

diff --git a/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt b/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
index 417d53f1..6d742f27 100644
--- a/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
+++ b/meta-isar/recipes-bsp/bootconfig-rpi/files/config.txt
@@ -1,5 +1,11 @@ 
 [pi3]
 # Restore UART0/ttyAMA0 over GPIOs 14 & 15
+# On RPi 3, using mini UART for serial console is unstable.
+# 1/3 boots produce garbage and doesn't reach login
 dtoverlay=miniuart-bt
 
+[pi4]
+# Enable mini UART (UART1/ttyS0) for serial console for RPi 4
+enable_uart=1
+
 [all]