0
votes

I try to crosscompile the linux kernel 3.14 much time for my beaglebone black with different ARCH(x64, i386) and different toolchain. But none of them can start correctly. It always stop at

## Booting kernel from Legacy Image at 80007fc0 ...
Image Name:   Linux-3.17.1+
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    6732680 Bytes = 6.4 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 80f92df6

Starting kernel ...

I think I use a incorrect toolchain, So I try to use the toolchain in ti StarsWares and linaro-toolchain. But it still not work. I also think I need to use 32bit ubuntu instead of my ubuntu 14.10(64bit), but it still not work.

finally, I try to compile an sample c program and try to run it on my beaglebone. it says:

root@beaglebone:~\# ./test 
-sh: ./test: No such file or directory

it seems I use incorrect toolchain.

I try to use the the kernel config file on:

git://github.com/beagleboard/kernel.git

but it still stop at:

Starting kernel ...

My crosscompile tool chain was.

linaro toolchain

My kernel build command was:

make ARCH=arm CROSS_COMPILE=/home/larry/develop/linaro-toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-

make modules ARCH=arm CROSS_COMPILE=/home/larry/develop/linaro-toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-

make modules_install INSTALL_MOD_PATH=mymodules ARCH=arm CROSS_COMPILE=/home/larry/develop/linaro-toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-

make LOADADDR=0x80008000 uImage dtbs ARCH=arm CROSS_COMPILE=/home/larry/develop/linaro-toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-

kernel .config was here:

kernel .config

My U-Boot config was:

`U-Boot# printenv
arch=arm
baudrate=115200
board=am335x
board_name=A335BNLT
board_rev=000B
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=1c:ba:8c:95:c8:fa
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=1c:ba:8c:95:c8:fa
vendor=ti
ver=U-Boot 2013.04-dirty (Jun 19 2013 - 09:57:14)

Environment size: 3877/131068 bytes

It spend my to much time. Anyone Can help me? Thanks.

4
I guess that installing Linux on your desktop could help: first, you'll learn Linux, and secondly, cross-compilation is probably easier on Linux.Basile Starynkevitch
You may not have a cross compile issue. Booting from 0x80007fc0 seem typical for Beaglebone, but not other ARM boards. Try loading the uImage to 0x80200000 and the DTB to 0x81200000 as described here. These addresses have to be modified in the bootcmd U-Boot environment variable.sawdust
"I try to compile an sample c program and try to run it on my beaglebone..." -- This failure is very likely a shared library issue. Link your program statically using the -static GCC compile/link option.sawdust
I loading uImage to 0x80200000 and the DTB 0x81200000 in the uboot, but it still stop at Starting kernel, I use the uboot default config, it can boot the kernel-3.8(system default), but can't boot from my kernel-3.17(compile by me). @sawdustlarry
Then you need to start explaining what your build environment is, what toolchain you are using, the commands you use to build the kernel, and the U-Boot environment variables. Add this information to your question by editing it.sawdust

4 Answers

1
votes

We had similar problems with Beagleboard xM. We followed the steps on wiki pages but it always used to hung up at Starting kernel....

And one of the freakiest solutions was to use the HDMI cable to plug it in to the monitor instead of using minicom or other serial console. Earlier we didn't have a monitor supporting HDMI...but when we changed the monitor and plugged in with HDMI...there it was the sought after Angstrom sign and log in screen.

I searched a lot for the reason why this happened. No reply's yet but maybe you can change the console parameter in the bootargs. we were using the standard ttyS0 change it to ttyO2 and try or just try plugging in the HDMI cable.

1
votes

I had the same trouble on my debian pre-installed BBB. I compiled the 3.14 kernel and when I tried it on my BBB it used to get stuck at "Starting kernel..."

But my mistake was that I had only replaced the zImage in /boot/uboot/ with the new one. When I replaced the am335x-boneblack.dtb in /boot/uboot/dtbs/ with the one I compiled in 3.14 it started working. The new am335x-boneblack.dtb can be found in kernel_dir/arch/arm/boot/dts. And don't forget to copy the directory with the new modules (from modules_install command) to /lib/modules of the BBB

0
votes

root@beaglebone:~\# ./test -sh: ./test: No such file or directory

This issue is due to shared library issuewhich is not same as the one having rootfs and your toolchain.

How you can verify..?

compile the code with statically linked

e.g arm-none-linux-gnueabi-gcc hello.c -static -o hello

and try to execute.

Also check this Linux Cant find dynamically linked applications

0
votes

I encountered similar problem and finally solved it by put dtb at 0x88000000. I guess the original position may overlap the kernel....