Uboot error "can't get kernel image!"


(Daniel) #1

Hello everybody,

I’ve tried to install my R2 to micro SD card via debootstrap with precompiled kernel 4.14.62 from @frank-w. uboot has been installed as described here: http://fw-web.de/dokuwiki/doku.php?id=en/bpi-r2/storage#manual_copy_of_os

My uEnv.txt has been taken from https://github.com/BPI-SINOVOIP/BPI-R2-bsp/blob/master/mt-pack/mtk/bpi-r2/configs/default/linux/uEnv.txt

When I try to boot from SD, UART throws theese errors:

Partition Map for MMC device 1  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     204800          524288          000ed6cd-01     0c
  2     729088          14540800        000ed6cd-02     83
mmc1 is available
Interface:  MMC
  Device 1: Vendor: Man 000003 Snr b742f301 Rev: 8.2 Prod: SS16G▒
            Type: Removable Hard Disk
            Capacity: 15193.5 MB = 14.8 GB (31116288 x 512)
Filesystem: FAT16 "NO NAME    "
Boot from SD
reading bananapi/bpi-r2/linux/uEnv.txt
718 bytes read in 7 ms (99.6 KiB/s)
Loaded environment from uEnv.txt
 Service: linux2
/uImage bananapi
 **magele to read file bananapi
/uImage bananapi
 **magele to read file bananapi
bootm flag=0, states=70f
Wrong Image Format for bootm command
ERROR: can't get kernel image!
bootm flag=0, states=70f
Wrong Image Format for bootm command
ERROR: can't get kernel image!

I’ve no idea why uboot can’t get the kernel image. The filesystem path is present and complete.

Thanks in advance and best regards, temp0r


(Frank W.) #2

Please make

mount |grep /boot
cat /boot/bananapi/bpi-r2/linux/uEnv.txt
ls /boot/bananapi/bpi-r2/linux/

If you use uenv.txt from above your kernel-binary needs filename uImage without version appended (see kernel-var in uenv.txt)

This looks strange…which uboot have you flashed?


(Daniel) #3

Output from your commands:

root@build:~# mount |grep /boot
/dev/sdb1 on /mnt/boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
root@build:~# cat /mnt/boot/bananapi/bpi-r2/linux/uEnv.txt
#
## uEnv.txt
#
bpi=bananapi
board=bpi-r2
chip=mt7623n
service=linux
#
##
#
kernel=uImage
#
##
#
kaddr=0x84000000
rdaddr=0x86000000
#
##
#
#root=/dev/ram
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
console=earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200
bootopts=vmalloc=496M debug=7 initcall_debug=0
#
##
#
abootargs=setenv bootargs board=${board} console=${console} root=${root} service=${service} ${bootopts}
#
##
#
ahello=echo Banana Pi ${board} chip: $chip Service: $service
#
##
#
aboot=if fatload $device $partition $rdaddr ${bpi}/berryboot.img; then bootm $kaddr $rdaddr ; else bootm $kaddr; fi
#
##
#
aload_kernel=fatload $device $partition $kaddr ${bpi}/${board}/${service}/${kernel}
#
##
#
uenvcmd=run ahello abootargs aload_kernel aboot
#
## END
#
root@build:~# ls /mnt/boot/bananapi/bpi-r2/linux/
uEnv.txt  uImage

uboot hasbeen taken from your site:

Checksums:

root@build:~# md5sum *.img.gz
77627afa0fb0ac89cf8dd8bb32c11f8f  bpi-r2-sd-boot1m.img.gz
a83e3cae69dd587d77d3551bad0d23a8  bpi-r2-sd-boot2k.img.gz

(Frank W.) #4

looks right so far…strange is your output from uboot


(Daniel) #5

That’s what my install procedure looks like:

gunzip bpi-r2-sd-boot*
dd if=bpi-r2-sd-boot1m.img of=/dev/sdb
partprobe /dev/sdb
dd if=BPI-R2-720P-2k.img of=/dev/sdb bs=1k seek=2 count=1022
mkfs.ext4 /dev/sdb2
mount /dev/sdb2 /mnt/
mkdir /mnt/boot
mount /dev/sdb1 /mnt/boot/
debootstrap --arch=armhf --foreign stretch .
cp /usr/bin/qemu-arm-static ./usr/bin/
cp /etc/resolv.conf ./etc/
chroot .
export LANG=C
/debootstrap/debootstrap --second-stage
passwd
vi /etc/fstab
vi /etc/hostname
cp /etc/apt/sources.list ./etc/apt/
cp -av BPI-ROOT/* /mnt/

(Frank W.) #6

flashing uboot again is not necessary

dd if=BPI-R2-720P-2k.img of=/dev/sdb bs=1k seek=2 count=1022

can you try to boot into uboot-console and show me a printenv after loading the uenv.txt

execute “mmc init 1”
execute “setenv partition 1:1”
execute “run loadbootenv”
execute “env import -t ${scriptaddr} ${filesize} ”

my log looks like this:

Partition Map for MMC device 1  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	204800    	524288    	000ed6cd-01	0c
  2	729088    	14540800  	000ed6cd-02	83
mmc1 is available
Interface:  MMC
  Device 1: Vendor: Man 00001b Snr a42cb700 Rev: 7.8 Prod: 00000
            Type: Removable Hard Disk
            Capacity: 7788.0 MB = 7.6 GB (15949824 x 512)
Filesystem: FAT16 "BPI-BOOT   "
Boot from SD
reading bananapi/bpi-r2/linux/uEnv.txt
771 bytes read in 7 ms (107.4 KiB/s)
Loaded environment from uEnv.txt
Banana Pi bpi-r2 chip: mt7623n Service: linux
reading bananapi/bpi-r2/linux/uImage
5945033 bytes read in 756 ms (7.5 MiB/s)
reading bananapi/berryboot.img
** Unable to read file bananapi/berryboot.img **
bootm flag=0, states=70f
## Booting kernel from Legacy Image at 84000000 ...
   Image Name:   Linux Kernel 4.14.12-debug_bt
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5944969 Bytes = 5.7 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

partition position and size seems to be right, but your Label is “No Name”. Normally this should be ok, but i suggest to rewrite partition table via my parttable.dat.

also this line from my output looks strange in your output:

   Banana Pi bpi-r2 chip: mt7623n Service: linux

(Daniel) #7

Please see the output attached to the txt file: uboot_console_01.txt (6,9 KB)

I’ll try and skip flashing uboot again this evening.


(Daniel) #8

Finally I got my r2 working :slight_smile: My partition table looked good but was corrupted. Thanks for your help Frank!


(Frank W.) #9

What have you done to fix it?


(Daniel) #10

I wrote the partition table again:

sfdisk /dev/sdb < parttable.dat