[RPi 4] UArt boot hangs on 'Starting kernel...'

I have problems starting NixOS 23.11 on RPi 4. It gets to kernel and than hangs:

U-Boot 2023.07.02 (Jul 11 2023 - 15:20:44 +0000)

DRAM:  948 MiB (effective 3.9 GiB)
RPI 4 Model B (0xc03115)
Core:  209 devices, 16 uclasses, devicetree: board
MMC:   mmcnr@7e300000: 1, mmc@7e340000: 0
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... 
In:    serial
Out:   serial
Err:   serial
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
scanning bus xhci_pci for devices... 2 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:2...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
1:	NixOS - Default
Enter choice: 1:	NixOS - Default
Retrieving file: /boot/extlinux/../nixos/shg46g624ks929x1wvbnqk6w1hhrwr5a-linux-6.1.90-Image
Retrieving file: /boot/extlinux/../nixos/9wz4ryvi3jy77yglpjlqppishn0vmjy7-initrd-linux-6.1.90-initrd
append: init=/nix/store/p6a87rsbl6h8ih5wclaw7vsk002crg00-nixos-system-nixos-23.11.6827.383ffe076d9b/init console=ttyS0,115200n8 console=ttyAMA0,115200n8 console=tty0 nohibernate loglevel=7
Retrieving file: /boot/extlinux/../nixos/shg46g624ks929x1wvbnqk6w1hhrwr5a-linux-6.1.90-dtbs/broadcom/bcm2711-rpi-4-b.dtb
Moving Image from 0x80000 to 0x200000, end=3a80000
## Flattened Device Tree blob at 04700000
   Booting using the fdt blob at 0x4700000
Working FDT set to 4700000
   Using Device Tree in place at 0000000004700000, end 000000000470c3d9
Working FDT set to 4700000

Starting kernel ...

I used nixos-sd-image-23.11.6827.383ffe076d9b-aarch64-linux.img image (no device connected except power and uart).

1 Like

Found on wiki that console might be incorrectly configured but on RPi 4 page it is not mentioned what is correct configuration. Trying from RPi 3…

Could you share your configs?

Got that for a pi-hole on docker if you want a working base: GitHub - JimJ92120/nixos-pi-hole: A NixOS image build for Raspberry Pi with Pi-hole.

Maybe worth taking a look at non-nixos setup, some seem to encounter similar issue:

I used standard sd build and I had problem as they use console=ttyS0,115200n8 instead of console=ttyS1,115200n8.

1 Like