After installing a new kernel, boot fails

Hello !

After installing a new kernel, it hangs after printing “Starting kernel …”.
I built a Linux kernel by following steps in https://wiki.radxa.com/Rockpi4/dev/Debian, and I got “boot.img” file in “out” folder.

I uploaded files with rkdeveloptool:

rkdeveloptool db rk3399_loader_*.bin
rkdeveloptool wl 64 idbloader.img
rkdeveloptool wl 16384 uboot.img
rkdeveloptool wl 24576 trust.img
rkdeveloptool wl 32768 boot.img
rkdeveloptool wl 262144 rootfs.img

After reboot, it hangs after printing out “Starting kernel …”.

Here’s the log from terminal.

Hit any key to stop autoboot: 0
Card did not respond to voltage select!
mmc_init: -95, time 9
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:4…
Found /extlinux/extlinux.conf
pxefile_addr_str = 0x00500000
bootfile = /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
reading /extlinux/extlinux.conf
184 bytes read in 14 ms (12.7 KiB/s)
Retrieving file: /hw_intfc.conf
** Unable to read file /hw_intfc.conf **
hw_conf.valid = 0
hw_conf.pwm0 = 2
hw_conf.pwm1 = 2
hw_conf.uart2 = 2
hw_conf.uart4 = 2
hw_conf.spi1 = 2
hw_conf.spi2 = 2
hw_conf.i2c2 = 2
hw_conf.i2c6 = 2
hw_conf.i2c7 = 2
hw_conf.dts_overlay_count = 0
1: kernel-4.4
Retrieving file: /Image
reading /Image
20140040 bytes read in 463 ms (41.5 MiB/s)
append: earlyprintk console=ttyFIQ0,1500000n8 rw root=PARTUUID=b921b045-1d rootfstype=ext4 init=/sbin/init rootwait
Retrieving file: /rockpi-4b-linux.dtb
reading /rockpi-4b-linux.dtb
96783 bytes read in 16 ms (5.8 MiB/s)
fdt addr 0000000001f00000
fdt magic number edfe0dd0
fdt size 1048576

Flattened Device Tree blob at 01f00000

Booting using the fdt blob at 0x1f00000
Loading Device Tree to 00000000f3ced000, end 00000000f3deffff … OK
Adding bank: start=0x00200000, size=0xf7e00000

Starting kernel …

I think I missed something, but I did it several times, but it always hangs.

The problem stems from DTB. When I switched the DTB file to the one provided by Radxa, the system works correctly.
Not sure why the DTB I built was wrong.

Hi, @RA_loop

well, you built your own debian system image.

By default, the console is disabled in rockpi-4b-linux.dtb (kernel 4.4.154-78), so there is nothing after showing “Starting kernel …”

You can install the rockpi4-dtbo package to enable console.

Solutoin one, using ssh

If you can access pi4 using ssh, you can try

add the following at file, /etc/apt/sources.list.

deb http://apt.radxa.com/stretch/ stretch main

And execute these commands

wget -O -  apt.radxa.com/stretch/public.key | sudo apt-key add -
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y rockchip-overlay rockchip-fstab
sudo apt-get install -y rockpi4-dtbo

Solution two, using chroot

(system image on eMMC) Insert eMMC Module into eMMC to μSD card converter board, and insert μSD card converter board into μSD Card Reader, which connects to your PC.

(system image on uSD) Insert the μSD Card into μSD Card Reader, which connects to your PC.

In your PC, you can see there are five poaretitions like this:

$ lsblk
sdb           8:16   1  29.1G  0 disk 
├─sdb4        8:20   1   512M  0 part 
├─sdb2        8:18   1     4M  0 part 
├─sdb5        8:21   1     2G  0 part /media/stephen/ROOTFS
├─sdb3        8:19   1     4M  0 part 
└─sdb1        8:17   1   3.9M  0 part 

start chroot

cd ~
sudo umount /dev/sdb5 # umount device.
sudo mkdir tmp-rootfs
sudo mount /dev/sdb5 tmp-rootfs
sudo mount /dev/sdb4 tmp-rootfs/boot
sudo chroot tmp-rootfs

add the following at file, /etc/apt/sources.list.

deb http://apt.radxa.com/stretch/ stretch main

And execute these commands

wget -O -  apt.radxa.com/stretch/public.key | sudo apt-key add -
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y rockchip-overlay
sudo apt-get install -y rockpi4-dtbo
sync

Then run the new system image on ROCK Pi 4.

1 Like

Thank you Stephen !
It works perfect !

1 Like

@Stephen what would be the best way to switch from kernel 4.4 to 4.15 on the Ubuntu image you provide? A project that I’m developing requires that I use that kernel. I’ve added http://apt.radxa.com/bionic/ bionic main to my sources.list and see many results when using sudo apt-cache search linux-image-4.15 but I can’t get into the Ubuntu boot prompt with Shift or Esc to select it. Thank you in advance.

@strangeways Currently, ROCK Pi 4 does support kernel of version 4.4.154 and 5.2-rc but not 4.15 .

Umm, what’s the story with “rockchip-overlay” package and why do you install it? it contains an interesting update-extlinux script which doesn’t recognize the kernel that comes with the standard Debian image. (Installing “rockship-fstab” also doesn’t seem to do anything productive.)

Second question, are these overlay DTBs compatible with the 5.2-rc kernel?

The overlays are like the raspberry pi overlays and all additional and configuration options to be added without need to convert and recompile dts/dtbo.

https://wiki.radxa.com/Rockpi4/hardware/devtree_overlays

5.2 / 5.1 is mainline and uses the mainline device tree whilst rockpi4-dtbo is specifically for 4.4 that contains many backports.

5.2 RC5 has been released but there are some quite major gneral changes to memory availability and case agnostic Ext4 that might need patches, might get shifted to 5.3 but those are pretty major linux kernel changes and not just rockpi4 specific.

Unfortunately the patches for Wifi/Bt and PCIe are in 5.3 and not particularly large but would need to be patched to 5.2 to get them running.
@ Antram made a great summary

1 Like

Just for reference, the staging kernel with the proposed 5.3 updates is here:

https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git

1 Like