Search code examples
u-boot

pcDuino3 Nano stuck at "Starting kernel ..." using u-boot


Actually I'm doing an experiment of a course to compile u-boot and replace the existing one. I met this problem and it seems that nothing from Google helped. So I post it here and want some possible reasons or solutions.

Board: pcDuino3 Nano

OS: Linaro 12.07 (GNU/Linux 3.4.79+ armv7l) (the first image in the page)

Media: SD card

Steps:

  1. I have succeed in booting from SD card and entered the shell.
  2. Then I compiled the latest u-boot and got u-boot-sunxi-with-spl.bin.
  3. I used dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8 to flash the bin to SD card.
  4. pcDuino3 Nano stuck at Starting kernel ....

The old output of u-boot:

U-Boot 2014.04-rc3-10520-g87ca6dc-dirty (Apr 09 2014 - 18:46:35) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Board: pcDuino3
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
In:    serial
Out:   serial
Err:   serial
Net:   emac
Hit any key to stop autoboot:  0 
reading uEnv.txt
575 bytes read in 21 ms (26.4 KiB/s)
reading script.bin
50660 bytes read in 27 ms (1.8 MiB/s)
reading uImage
6495136 bytes read in 331 ms (18.7 MiB/s)
## Booting kernel from Legacy Image at 48000000 ...
   Image Name:   Linux-3.4.79+
   Created:      2014-12-05   9:23:21 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    6495072 Bytes = 6.2 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

The new output of u-boot:

U-Boot 2016.05-rc3-gad14166 (May 01 2016 - 18:19:38 +0800) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Model: LinkSprite pcDuino3
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
In:    serial
Out:   serial
Err:   serial
SCSI:  SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst 
Net:   eth0: ethernet@01c50000
Hit any key to stop autoboot:  0 
reading uEnv.txt
575 bytes read in 21 ms (26.4 KiB/s)
reading script.bin
50660 bytes read in 32 ms (1.5 MiB/s)
reading uImage
6495136 bytes read in 703 ms (8.8 MiB/s)
## Booting kernel from Legacy Image at 48000000 ...
   Image Name:   Linux-3.4.79+
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    6495072 Bytes = 6.2 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

The old output of printenv:

sun7i# printenv 
baudrate=115200
boot_mmc=fatload mmc 0 0x43000000 script.bin && fatload mmc 0 0x48000000 uImage && bootm 0x48000000
boot_nand=fatload mmc 0 0x43000000 script.bin && fatload mmc 0 0x48000000 ${kernel} && bootm 0x48000000
bootargs=console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 loglevel=8 panic=10
bootcmd=if run loadbootenv; then env import -t ${scriptaddr} ${filesize};fi;run setargs boot_mmc;
bootdelay=1
bootenv=uEnv.txt
bootscr=boot.scr
console=ttyS0,115200
ethact=emac
filesize=631ba0
kernel=uImage
loadbootenv=fatload mmc 0 $scriptaddr ${bootenv}
loadbootscr=fatload mmc 0 $scriptaddr ${bootscr} || ext2load mmc 0 $scriptaddr ${bootscr} || ext2load mmc 0 $scriptaddr boot/${bootsc}
loglevel=8
mmc_root=/dev/mmcblk0p2
panicarg=panic=10
recovery_key_value_max=0x13
recovery_key_value_min=0x10
root=/dev/mmcblk0p6 rootwait
scriptaddr=0x44000000
setargs=setenv bootargs console=${console} console=tty1 root=${mmc_root} loglevel=${loglevel} ${panicarg} ${extraargs}
stderr=serial
stdin=serial
stdout=serial
udrate=115200

Environment size: 1082/131068 bytes

The new output of printenv:

=> printenv 
baudrate=115200
boot_mmc=fatload mmc 0 0x43000000 script.bin && fatload mmc 0 0x48000000 uImage && bootm 0x48000000
boot_nand=fatload mmc 0 0x43000000 script.bin && fatload mmc 0 0x48000000 ${kernel} && bootm 0x48000000
bootargs=console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 loglevel=8 panic=10
bootcmd=if run loadbootenv; then env import -t ${scriptaddr} ${filesize};fi;run setargs boot_mmc;
bootdelay=1
bootenv=uEnv.txt
bootscr=boot.scr
console=ttyS0,115200
ethact=emac
ethaddr=02:8b:08:42:69:fe
fdtcontroladdr=7af319c0
filesize=631ba0
kernel=uImage
loadbootenv=fatload mmc 0 $scriptaddr ${bootenv}
loadbootscr=fatload mmc 0 $scriptaddr ${bootscr} || ext2load mmc 0 $scriptaddr ${bootscr} || ext2load mmc 0 $scriptaddr boot/${bootsc}
loglevel=8
mmc_root=/dev/mmcblk0p2
panicarg=panic=10
recovery_key_value_max=0x13
recovery_key_value_min=0x10
root=/dev/mmcblk0p6 rootwait
scriptaddr=0x44000000
serial#=1651668b084269fe
setargs=setenv bootargs console=${console} console=tty1 root=${mmc_root} loglevel=${loglevel} ${panicarg} ${extraargs}
stderr=serial
stdin=serial
stdout=serial
udrate=115200

Environment size: 1163/131068 bytes

Anything related will be grateful : )


Solution

  • The answer you need is likely found on https://linux-sunxi.org/Mainline_U-Boot#Legacy_kernel_won.27t_start as booting an older or vendor kernel with mainline U-Boot requires some care.

    H/T to NiteHawk on IRC.