Trying to compile kernel for BBB, hangs on "booting the kernel"

691 views
Skip to first unread message

Daniel Hastings

unread,
May 15, 2014, 12:07:39 PM5/15/14
to beagl...@googlegroups.com
Hello,

I've been trying to get a kernel build environment set up for my BBB. I've set up a cross compiler and I've followed the following steps.

git clone git://github.com/beagleboard/kernel.git
cd kernel
git checkout 3.8
./patch.sh
cp configs/beaglebone kernel/arch/arm/configs/beaglebone_defconfig
wget http://arago-project.org/git/projects/?p=am33x-cm3.git\;a=blob_plain\;f=bin/am335x-pm-firmware.bin\;hb=HEAD -O kernel/firmware/am335x-pm-firmware.bin
cd kernel
make ARCH=arm CROSS_COMPILE=${CC} beaglebone_defconfig -j4
make ARCH=arm CROSS_COMPILE=${CC} uImage dtbs LOADADDR=0x80008000 -j4
make ARCH=arm CROSS_COMPILE=${CC} uImage-dtb.am335x-boneblack LOADADDR=0x80008000 -j4

make ARCH=arm CROSS_COMPILE=${CC} modules -j4

I've moved the modules created into /lib/modules/<version> and copied the uImage into /boot in the second partition of the mmc.

When trying to boot the new kernel, this is the last output I receive over the serial port:

Booting from mmc ...
## Booting kernel from Legacy Image at 80007fc0 ...
   Image Name:   Linux-3.8.13+
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4311374 Bytes = 4.1 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 80f80000
   Booting using the fdt blob at 0x80f80000
   XIP Kernel Image ... OK
OK
   Using Device Tree in place at 80f80000, end 80f89133

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Then it just hangs with no led activity until I power cycle it.

I think that this indicates that uboot has finished and that the problem must lie with the kernel I've built. Perhaps I'm missing an option somewhere?

I've tried both using the beaglebone_defconfig and using the info from /proc/config.gz to build a kernel. I've tried two cross compiler tool chains and I've let the thing build natively overnight and still it hangs on "done, booting the kernel".

Does anyone have any idea what I may be doing wrong?

Thanks,
Dan

Cody Lacey

unread,
May 15, 2014, 1:06:56 PM5/15/14
to beagl...@googlegroups.com
Did you move the correct .dtb into the /boot directory


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Hastings

unread,
May 15, 2014, 3:15:35 PM5/15/14
to beagl...@googlegroups.com
Thanks for your reply.

I had not previously but I think that I have now.

I copied <kernel tree>/arch/arm/boot/dts/am335x-boneblack.dtb to /boot/ but the boot process still hangs at the same spot.

Cody Lacey

unread,
May 15, 2014, 5:20:37 PM5/15/14
to beagl...@googlegroups.com
Do you have a uEnv.txt file on the fat partition?
What are the contents?

Daniel Hastings

unread,
May 15, 2014, 6:15:14 PM5/15/14
to beagl...@googlegroups.com
I do, the contents are the same as what I use for the angstrom linux that I am using as a base.

optargs=quiet drm.debug=7


I've also checked printenv from uboot and it looks like the values it has should boot the linux image. Indeed it seems to find and load the file and the file size displayed matches the newly compiled kernel image.

arch=arm
baudrate=115200
board=am335x
board_name=A335BNLT
board_rev=00A5
bootcmd=gpio set 53; i2c mw 0x24 1 0x3e; run findfdt; mmc dev 0; if mmc rescan ; then echo micro SD card found;setenv mmcdev 0;else echo No micro SD card found, setting mmcdev to 1;setenv mmcdev 1;fi;setenv bootpart ${mmcdev}:2;mmc dev ${mmcdev}; if mmc rescan; then gpio set 54; 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;gpio set 55; if run loaduimage; then gpio set 56; run loadfdt;run mmcboot;fi;fi;
bootdelay=1
bootdir=/boot
bootenv=uEnv.txt
bootfile=uImage
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 3C0;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;kernel part 0 7;rootfs part 0 8
ethact=cpsw
ethaddr=d0:ff:50:e8:b5:34
fdt_high=0xffffffff
fdtaddr=0x80F80000
fdtfile=am335x-boneblack.dtb
findfdt=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 $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
kloadaddr=0x80007fc0
loadaddr=0x80200000
loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}
loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
loaduimage=load mmc ${bootpart} ${kloadaddr} ${bootdir}/${bootfile}
mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${kloadaddr} - ${fdtaddr}
mmcdev=0
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),1920k(u-boot),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 ${loadaddr} ${nandsrcaddr} ${nandimgsize}; bootm ${loadaddr}
nandimgsize=0x500000
nandroot=ubi0:rootfs rw ubi.mtd=7,2048
nandrootfstype=ubifs rootwait=1
nandsrcaddr=0x280000
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; bootm ${loadaddr} - ${fdtaddr}
nfsopts=nolock
ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
ramboot=echo Booting from ramdisk ...; run ramargs; bootm ${loadaddr} ${rdaddr} ${fdtaddr}
ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M
ramrootfstype=ext2
rdaddr=0x81000000
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}; bootm ${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
usbnet_devaddr=d0:ff:50:e8:b5:34
vendor=ti
ver=U-Boot 2013.04-dirty (Jul 10 2013 - 14:02:53)

Environment size: 3877/131068 bytes

John Syn

unread,
May 15, 2014, 7:18:37 PM5/15/14
to beagl...@googlegroups.com
So, why don’t you just use Robert Nelson’s linux-dev kernel?


All you do is run ./build_kernel

Everything you need will be placed in the deploy folder. 

Regards,
John
From: Daniel Hastings <daniel.robe...@gmail.com>
Reply-To: <beagl...@googlegroups.com>
Date: Thursday, May 15, 2014 at 3:15 PM
To: <beagl...@googlegroups.com>
Subject: Re: [beagleboard] Trying to compile kernel for BBB, hangs on "booting the kernel"

Daniel Hastings

unread,
May 16, 2014, 12:09:58 PM5/16/14
to beagl...@googlegroups.com
Hi John,

Thank you for the suggestion.

The reason I had tried that is because I didn't know about it. I've taken a look and noticed that there is no defconfig for the beaglebone black in arch/arm/configs/

Further, there is no uImage in deploy after running the build_kernel script. I think that can be remedied with proper application of mkimage from uboot but I haven't had time to try it yet.

I'm concerned that an image built in this manner won 't have the propoer support for the beaglebone black hardware, the prus in particular, do you know if it would or not?

Thanks again,
Dan

Robert Nelson

unread,
May 16, 2014, 12:16:11 PM5/16/14
to Beagle Board
On Fri, May 16, 2014 at 11:09 AM, Daniel Hastings <daniel.robe...@gmail.com> wrote:
Hi John,

Thank you for the suggestion.

The reason I had tried that is because I didn't know about it. I've taken a look and noticed that there is no defconfig for the beaglebone black in arch/arm/configs/

Further, there is no uImage in deploy after running the build_kernel script. I think that can be remedied with proper application of mkimage from uboot but I haven't had time to try it yet.

It's trivial to convert a zImage to uImage, but it's just easier to use a zImage

 
I'm concerned that an image built in this manner won 't have the propoer support for the beaglebone black hardware, the prus in particular, do you know if it would or not?


Laughs, considering the official images use the kernel from that exact repo, your concern is well nutz. ;)

Regards,

--
Robert Nelson
http://www.rcn-ee.com/

Robert Nelson

unread,
May 16, 2014, 12:26:01 PM5/16/14
to Beagle Board
Just make sure you select the correct branch, there's a couple other projects in that repo.

Regards,

Daniel Hastings

unread,
May 16, 2014, 12:45:17 PM5/16/14
to beagl...@googlegroups.com
Thanks Robert, I'll give it a try.

Daniel Hastings

unread,
May 16, 2014, 1:06:14 PM5/16/14
to beagl...@googlegroups.com
Pardon my ignorance, but how does one use a zImage with uBoot?

John Syn

unread,
May 16, 2014, 1:10:09 PM5/16/14
to beagl...@googlegroups.com
From: Daniel Hastings <daniel.robe...@gmail.com>
Reply-To: <beagl...@googlegroups.com>
Date: Friday, May 16, 2014 at 10:06 AM

To: <beagl...@googlegroups.com>
Subject: Re: [beagleboard] Trying to compile kernel for BBB, hangs on "booting the kernel"

Pardon my ignorance, but how does one use a zImage with uBoot?
If you stop at the u-boot prompt, do a printenv. You will see a line with bootz and this is what boots zImage.

Regards,
John
--

William Hermans

unread,
May 16, 2014, 1:11:01 PM5/16/14
to beagl...@googlegroups.com


--
Reply all
Reply to author
Forward
0 new messages