cannot boot-up openwrt for beagle bone black(BB-black)

1.5k views Asked by At

I am trying porting openwrt to BBB. And as shown in title, I cannot boot-up openwrt on BeagleBone Black. If someone have tried to do something on BeagleBone Black(BBB), you must know there are two partitions in its flash or SD card. The first partition is FAT32 as a boot partition, the second partition is Ext4 as linux root file system.

When I use original files and BINs of Angstrom for BBB, I can start up system. My work is related to http://wiki.openwrt.org/toh/beaglebone/black#installation

I have done many experiments:

  1. Use BINs and other files, rootfs etc. on snapshot of OPENWRT to replace all the original files. When I power on BBB, I cannot see any log from UART. I think the MLO file on snapshot is wrong.

  2. I modified uEvn.txt only. I can see the log as shown below.

    gpio: pin 53 (gpio 53) value is 1
    mmc0 is current device
    micro SD card found
    mmc0 is current device
    gpio: pin 54 (gpio 54) value is 1
    SD/MMC found on device 0
    reading uEnv.txt
    438 bytes read in 3 ms (142.6 KiB/s)
    Loaded environment from uEnv.txt
    Importing environment from mmc ...
    Running uenvcmd ...
    reading zImage
    2051400 bytes read in 238 ms (8.2 MiB/s)
    reading am335x-boneblack.dtb
    ** Unable to read file am335x-boneblack.dtb **
    ERROR: Did not find a cmdline Flattened Device Tree
    Could not find a valid device tree
    gpio: pin 55 (gpio 55) value is 1
    ** File not found /boot/uImage **

  3. I only replace zImage which on snapshot to my flash. The log from UART shows that, boot-up flow stopped at

    Starting kernel ...

Log shown as below.

U-Boot SPL 2014.01-rc1-00172-ge7e17b0 (Dec 12 2013 - 15:20:09)
reading args
spl: error reading image args, err - -1
reading u-boot.img
reading u-boot.img


U-Boot 2014.01-rc1-00172-ge7e17b0 (Dec 12 2013 - 15:20:09)

I2C:   ready
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment

Net:   <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot:  0
mmc0 is current device
SD/MMC found on device 0
reading uEnv.txt
494 bytes read in 5 ms (95.7 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc ...
Running uenvcmd ...
reading zImage
2187584 bytes read in 214 ms (9.7 MiB/s)
reading am335x-boneblack.dtb
25172 bytes read in 11 ms (2.2 MiB/s)
Kernel image @ 0x80200000 [ 0x000000 - 0x216140 ]

Starting kernel ...

To this step, I found that the files on snapshot may not suit for BBB. And after that, I compile my own version of openwrt for BBB. And replace zImage. The issue is still block in starting kernel.

So Is there anybody have some experience for porting openwrt to BBB? Can you show me what I should do for porting. Or did I do something wrong?

If someone have compiled your own openwrt version for BBB, could you please share your config file to me?

Thanks so much.

Post my uEvn.txtx first:

cat /mnt/p1/uEnv.txt 
kernel_file=zImage
fdtfile=am335x-boneblack.dtb

loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${kernel_file}
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} ${fdtfile}

console=ttyO0,115200n8
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait

mmcargs=setenv bootargs console=${console} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs}

uenvcmd=run loadzimage; run loadfdt; run mmcargs; bootz ${loadaddr} - ${fdtaddr}

optargs="debug init=/etc/preinit"

OUTPUT from printenv:

arch=arm
baudrate=115200
board=am335x
board_name=A335BNLT
board_rev=00A5
boot_fdt=try
bootcmd=i2c mw 0x24 1 0x3e; run findfdt; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; run mmcboot;run nandboot;
bootcount=1
bootdelay=1
bootdir=/boot
bootenv=uEnv.txt
bootfile=zImage
bootpart=0:2
console=ttyO0,115200n8
cpu=armv7
dfu_alt_info_emmc=rawemmc mmc 0 3751936
dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw mmc 100 100;u-boot.img.raw mmc 300 400;spl-os-args.raw mmc 80 80;spl-os-image.raw mmc 900 2000;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part 0 9
dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramdisk ram 0x81000000 0x4000000
ethact=cpsw
ethaddr=7c:66:9d:53:6f:07
fdt_high=0xffffffff
fdtaddr=0x80F80000
fdtfile=am335x-boneblack.dtb
filesize=1f8
findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
kernel_file=zImage
loadaddr=0x80200000
loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} ${fdtfile}
loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
loadzimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${kernel_file}
mmcargs=setenv bootargs console=${console} root=${mmcroot}
mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadimage; then run mmcloados;fi;fi;
mmcdev=0
mmcloados=run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait
mtdids=nand0=omap2-nand.0
mtdparts=mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),128k(SPL.backup3),1792k(u-boot),128k(u-boot-spl-os),128k(u-boot-env),5m(kernel),-(rootfs)
nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} u-boot-spl-os; nand read ${loadaddr} kernel; bootz ${loadaddr} - ${fdtaddr}
nandroot=ubi0:rootfs rw ubi.mtd=7,2048
nandrootfstype=ubifs rootwait=1
netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
netboot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${loadaddr} ${bootfile}; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}
nfsopts=nolock
optargs="debug init=/etc/preinit"
ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M
ramrootfstype=ext2
rdaddr=0x81000000
rootfstype=${mmcrootfstype} ${optargs}
rootpath=/export/rootfs
soc=am33xx
spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
spibusno=0
spiimgsize=0x362000
spiroot=/dev/mtdblock4 rw
spirootfstype=jffs2
spisrcaddr=0xe0000
static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
stderr=serial
stdin=serial
stdout=serial
uenvcmd=printenv; run loadzimage; run loadfdt; run mmcargs; bootz ${loadaddr} -
usbnet_devaddr=7c:66:9d:53:6f:07
vendor=ti
ver=U-Boot 2014.01-rc1-00172-ge7e17b0 (Dec 12 2013 - 15:20:09)

Environment size: 4451/131068 bytes
1

There are 1 answers

0
NickS On

Your output clearly indicates that uBoot was unable to read the device tree binary (am335x-boneblack.dtb). Make sure you have that file in the root of your FAT partition as well. It can be found in the build output: openwrt/bin/omap/dtbs after you make OpenWRT.