Bug 13052 - Serial Console stops displaying at "Starting kernel" on RPi4B
Summary: Serial Console stops displaying at "Starting kernel" on RPi4B
Status: MODIFIED
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: unspecified Unspecified
: - Unknown - - Unknown -
Assignee: Arne.F
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-03 01:32 UTC by Jon
Modified: 2026-11-23 12:47 UTC (History)
6 users (show)

See Also:


Attachments
screenshot of log (incomplete) (525.51 KB, image/png)
2023-03-03 17:05 UTC, Jon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jon 2023-03-03 01:32:22 UTC
During a boot with the serial console, the serial console stops displaying at "Starting kernel".  The RPi4b seems to boot OK but the serial console does not work.


```
[root@ipfireRPi4B9 ~]# cat /boot/uENV.txt
KVER=6.1.11
DTBSUNXI=sun8i-h3-nanopi-r1.dtb
root_dev=UUID=1234567....
SERIAL-CONSOLE=ON

[root@ipfireRPi4B9 ~]# cat /boot/config.txt
. . .
enable_uart=1
. . .
hdmi_safe=1
```


```
U-Boot 2022.10 (Dec 27 2022 - 13:59:35 +0000) RPi4 - IPFire.org

DRAM:  3.9 GiB
RPI 4 Model B (0xc03111)
Core:  205 devices, 16 uclasses, devicetree: board
MMC:   mmcnr@7e300000: 1, mmc@7e340000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... 3 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2824 bytes read in 10 ms (275.4 KiB/s)
## Executing script at 02400000
113 bytes read in 7 ms (15.6 KiB/s)
Load uEnv.txt...
...
Set console to ttyAMA0,115200n8
27265536 bytes read in 1222 ms (21.3 MiB/s)
27434 bytes read in 22 ms (1.2 MiB/s)

16139829 bytes read in 693 ms (22.2 MiB/s)
Ramdisk loaded...
Unknown command 'bootz' - try 'help'
Moving Image from 0x80000 to 0x200000, end=1cf0000
## Loading init Ramdisk from Legacy Image at 02700000 ...
   Image Name:   
   Image Type:   AArch64 Linux RAMDisk Image (lzma compressed)
   Data Size:    16139765 Bytes = 15.4 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02600000
   Booting using the fdt blob at 0x2600000
   Loading Device Tree to 000000003df2c000, end 000000003df35b29 ... OK

Starting kernel ...
```


Tested with:
Raspberry Pi 4 Model B Rev 1.1
IPFire 2.27 (aarch64) - Core-Update 173
Comment 1 Michael Tremer 2023-03-03 11:00:32 UTC
I believe this one is for Arne.
Comment 2 Jon 2023-03-03 17:05:09 UTC
Created attachment 1139 [details]
screenshot of log (incomplete)

The first post was an update from CU 172 to CU 173.  This post is a new CU 713 download and build.

Similar errors as first post.
Comment 3 Adolf Belka 2025-07-02 15:21:04 UTC
Is this bug still valid with CU195?
Comment 4 Jon 2025-07-02 15:58:56 UTC
my test RPi4B got repurposed for something else. 

Arne - does the serial console on a RPi4B work well for you?
Comment 5 Adolf Belka 2025-12-07 12:16:29 UTC
As there has been no further response on this bug since July 2025 I am closing it.

If it is still an issue then the bug report can be re-opened and updated info provided.
Comment 6 pscar13 2026-02-12 16:44:52 UTC
Tested on Raspberry Pi 4 with CU199 and CU200, the bug is still present
https://community.ipfire.org/t/test-ipfire-cu199-raspberry-4-model-b-does-not-display-on-serial-port/15473
Comment 7 Alexander 2026-03-03 14:04:44 UTC
Is there any good news on the topic?
Comment 8 Antonio Quartulli 2026-11-13 00:13:53 UTC
I've deepened this issue using raspi4b on QEMU and the problem is that for various RPi models (4B, 400, 3A+, Zero 2 W) boot.cmd chooses ttyAMA0, which is wired to the BT module, instead of ttyS1.

This happens because boot.cmd encodes a hardcoded decision which doesn't work on all models.

To make this approach generic and ensure it works on all models, read the stdout device from the dtb file *before* configuring the console. This way we always pick the value written in the dtb and we don't need a board list with hardcoded console devices.

I'll send a patch to the list soon addressing this issue.

Unfortunately I don't have any physical hardware to test with, but I'll poke the forum thread to see if anybody is available for a test.
Comment 9 Antonio Quartulli 2026-11-13 00:15:31 UTC
patch is on the list: https://lists.ipfire.org/development/20261113001443.2118539-1-antonio@mandelbit.com/T/#u
Comment 10 pscar13 2026-11-13 12:28:07 UTC
(In reply to Antonio Quartulli from comment #9)
> patch is on the list:
> https://lists.ipfire.org/development/20261113001443.2118539-1-
> antonio@mandelbit.com/T/#u


I confirm that the patch works as expected.
https://community.ipfire.org/t/test-ipfire-cu199-raspberry-4-model-b-does-not-display-on-serial-port/15473/5?u=pscar13
Comment 11 Antonio Quartulli 2026-11-13 12:37:41 UTC
(In reply to pscar13 from comment #10)
> I confirm that the patch works as expected.
> https://community.ipfire.org/t/test-ipfire-cu199-raspberry-4-model-b-does-
> not-display-on-serial-port/15473/5?u=pscar13

Thanks a lot!
Comment 12 Alexander 2026-11-15 15:06:56 UTC
The patch works correctly, thanks.
I tested it on a Raspberry Pi 4 Model B Rev 1.4 running IPFire 2.29 (aarch64) - core205.
Comment 13 Michael Tremer 2026-11-23 12:47:37 UTC
https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=fc6647e90a194e5975c711e1f389c1c646e063ab

Author: Antonio Quartulli <antonio@mandelbit.com>

u-boot: Fix serial console on Raspberry Pi 4

boot.cmd only selects the mini UART (ttyS1) for the Pi 3B/3B+ dtbs and
falls back to ttyAMA0 on every other Pi. On boards with Bluetooth
(4B, 400, 3A+, Zero 2 W) ttyAMA0 is the PL011 wired to the BT module, so
the kernel console disappears after "Starting kernel ...".

Pick the console from the stdout-path of the dtb being booted instead:
serial1 is the mini UART on the pin header (ttyS1), serial0 the PL011.

Fixes: #13052
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>