Beagleboard XM kernel compile/bitbake issues. New to this.

Hi beagleboard community,

First off, Id just like to say that the information I have found here
has been a great help to me in the past 2 months. Thank you all for
your time and knowledge.
My Problem is that I cannot get past a particular step in the boot
process regardless of how many time I have compiled OE or just a
kernel image.

My situation:

I am using the xM rev-A to build an oscilloscope model which will be
used by my University in it's open circuits lab. This involves
interfacing the beagle to a custom FPGA PC board. My ultimate goal is
to enable McSPI3 and McSPI4 so that I can talk to the FPGA and this,
as I understand it, involves rolling my own kernel with SPI enabled.
I have booted the demo Images just fine and build custom packages with
narcissus. All them have booted.

My problem:

So far, after generating many many uImages in many different ways
including compiling the kernel natively on the beagle 3 time, I have
not been able to boot a custom kernel on the beagleboard. I always get
to either of these points:
Uncompressing
Linux........................................................
or
Uncompressing Linux... done, booting the kernel.
and then nothing (over minicom).
I can then remove my uImage and replace it with the one taken from
angstrom generates packages and it boots up just fine.

What I have tried:

-Building the kernel manual using openembedded source files and quilt
to apply patches. (from wiki page), did this with 6.2.28, 6.2.32, and
6.2.37
-Building the kernel natively on the beagleboard using modified steps
above. Did this with 6.2.32 and 6.2.37.
-Downloading bitbake and openembedded manually and executing bitbake
commands such bitbake console-image bitbake beagleboard-demo-image
bitbake base-image bitbake -xxxxxx/linus-omap_2.6.xx.bb
-Downloading oebb.sh script and executed that (my computer is still
working on this. It is having issues with QA and RPATH or something.)

My Steps, (please check me here, I am on my own with this and I might
just not know about some obvious step)

Compile kernel (Either with make, make CROSS_COMP....., or bitbake)
Delete uImage from DOS partition of SD card.
Copy generate uImage to DOS partition
Boot on beagle
...no dice.
Every kernel I have built has given me the same two errors above. So
far, I have pretty much spent a week non-stop on this to no avail. I
even set up a computer with a new install of ubuntu just to handle
bitbakes. I only have MLO u-boot.bin and uImage on the DOS partition.

Please help me. If you have an idea about what I am doing wrong here
let me know. Even if you just have a feeling about something, point me
to it. Also, if you happen to have a copy of a uImage with SPI patched
and muxed, please send it to me. I would be very grateful. I really
need to focus on other aspects of this project and this is taking all
of my time.

I am starting to suspect that it is something other that the uImage I
have generated. I am including the output of printenv. Do u-boot.bin
and uImage have to match or something?

OMAP3 beagleboard.org # printenv
bootcmd=if mmc init ${mmcdev}; then if userbutton; then setenv bootscr
user.scr;if run loadbootscript; theni
bootdelay=3
baudrate=115200
loadaddr=0x80200000
rdaddr=0x81600000
usbtty=cdc_acm
console=ttyS2,115200n8
optargs=
bootscr=boot.scr
camera=lbcm3m1
vram=12M
dvimode=640x480MR-16@60
defaultdisplay=dvi
mmcdev=1
mmcroot=/dev/mmcblk0p2 rw
mmcrootfstype=ext3 rootwait
nandroot=/dev/mtdblock4 rw
nandrootfstype=jffs2
ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M
ramrootfstype=ext2
mmcargs=setenv bootargs console=${console} ${optargs} mpurate=$
{mpurate} buddy=${buddy} camera=${camera} vr}
nandargs=setenv bootargs console=${console} ${optargs} mpurate=$
{mpurate} buddy=${buddy} camera=${camera} v}
loadbootscript=fatload mmc ${mmcdev} ${loadaddr} ${bootscr}
ramargs=setenv bootargs console=${console} ${optargs} mpurate=$
{mpurate} buddy=${buddy} camera=${camera} vr}
loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz
bootscript=echo Running bootscript from mmc ...; source ${loadaddr}
loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage
mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr}
nandboot=echo Booting from nand ...; run nandargs; nand read $
{loadaddr} 280000 400000; bootm ${loadaddr}
ramboot=echo Booting from ramdisk ...; run ramargs; bootm ${loadaddr}
buddy=none
beaglerev=xMA
mpurate=1000
dieid#=56be00011ff00000015739eb0a020006

Thank you so much for reading.

Uncompressing
Linux........................................................
or
Uncompressing Linux... done, booting the kernel.
and then nothing (over minicom).

In 2.6.37 at least, you need to use console=ttyO2,115200n8 as the name of the
processor's built-in serial ports has changed. I'm not sure which kernel
version this change was applied at.

If that's not the issue then I suspect there must be something wrong with
your kernel configuration, as it appears that the kernel successfully
decompresses itself. Perhaps you could try posting your .config file
somewhere for people to look through?

I am starting to suspect that it is something other that the uImage I
have generated. I am including the output of printenv. Do u-boot.bin
and uImage have to match or something?

Perhaps it will be clear to others on this list, but it is not clear to me
what command line the kernel will be booted with, and this is pretty
important. What command do you type to boot? (if any?).

u-boot.bin and uImage don't have to match to my knowledge.

Bye for now,

I missed the original post you were responding to so maybe this isn't
what you were asking, but just in case (and because I've had to work on
these a lot lately)....

The bootloader (re: u-boot) is used to pass command line arguments to
the kernel. This is passed in an environment variable set in u-boot.
You can type all the commands to boot the Linux kernel from u-boot's
shell prompt. But most of the available BeagleBoard distributions
simplify this for you.

If u-boot is configured with the dash shell, then you can write small
scripts of u-boot commands. These are text files that are compiled into
a binary file. The binary is loaded into memory (using u-boot commands)
and then u-boot is told to run what it finds at that memory location,
re: the script commands. Note that the u-boot configuration for
BeagleBoard distributions already has dash configured, so u-boot scripts
are available.

The simplification provided by Angstrom releases, especially Koen's demo
release images (and possibly the Ubuntu releases though I haven't really
tried those), is that a script is already created that helps with the
booting. The script, called boot.scr, is placed on an SD card. It
contains basic command line arguments for the kernel. You can see what
those are after the kernel boots by using the following command:

cat /proc/cmdline

For this to work, the following occurs:
1. The X-Loader (a minimal bootloader with a targeted purpose) loads
u-boot from the SD card.
2. u-boot loads the boot.scr from the SD card and runs it.
3. This causes the Linux kernel to be loaded from the SD card and run.
4. The Linux kernel command line arguments determine where the kernel
will find the root file system.

To make changes to the way the kernel boots you can edit the text file
version of boot.scr. The hardest part for most is simply finding where
that file is located and what command to use to compile it. I can't say
where to find the text file but I'm sure Robert or Koen or others can
help there. The command looks something like this:

$(MKIMAGE) -T script -A arm -C none -a 0 -e 0 \
   -n 'BeagleBox u-boot script' \
   -d $(UBOOT_SCRIPT) $(UBOOT_DESTDIR)/boot.scr

Where MKIMAGE is the path to the "mkimage" script, which can be found in
the u-boot source code (uboot/tools/mkimage), UBOOT_SCRIPT is the path
to the source file and UBOOT_DESTDIR is where you want the compiled
script to be saved. The "-n" option is just a name embedded in the
file.

FYI, you typically modify the "bootargs" environment variable setting in
the script. However, the bootargs can often be built from other
environment variables. I make my own boot scripts so can't describe the
contents and what to edit in the ones used from the Angstrom images.

Hope that helps.

Update: Thanks for the tip about tty02 rather than S2. If I did manage
to successfully compile a 2.6.37 kernel that definitely would have
prevented me from seeing anything.

Anyways, thanks to the very generous help of a user, David Wiebe, I
confirmed that it was not the board and I was able to boot the kernel!

If anyone is looking for information, I did the following, keep in
mind that I am writing these commands from memory so the paths/
spelling might not be quite right. I spent pretty much all my free
time for a week trying to figure this stuff out......many, many failed
uImages were made. So, in the interest of sparing some poor soul out
there some agony (or possible wasting their time...hopefully not), I
putting my steps out there.

First of all, I guess this repository worked while the others didn't,
why this is so, neither I nor David know, this is a different
repository than what it says on the elinux page.

---------- Step 0, set things up ---------------------
get the Code Sourcery cross compiler
add it to you path eg
:export PATH=$PATH:/path to code sourcery bin.

and get uboot-mkimage. You can get it in the Ubuntu software center.

---------- Step 1, get the sources -------------------
Make a working directory:
:cd
:mkdir stuff
:git clone git://gitorious.org/beagleboard-validation/linux.git
:cd linux

(and here we are in the sources directory)

---------- Step 2, set up the compile ----------------
:export ARCH = arm
clean it
:make CROSS_COMPILE=arm-none-gnueabi- mrproper

copy the default config file for the beagle
:cp arch/arm/config/omap3_beagle_defconfig .config

change what ever else you want to change
:make CROSS_COMPILE=arm-none-gnueabi menuconfig
the only change I made was to turn off module support.

make uImage
:make -j4 CROSS_COMPILE=arm-none-gnueabi- uImage

Then go find it and copy uImage onto your boot partition.

And that’s wrong. I wonder why people keep using that prebuilt codesourcery crap. It doesn’t even use vfp or neon in it’s standard libs.

Can you explain please? What should I be doing to build kernels? Thank
you, Eric.

Hi Eric

I too had allot of difficulty in getting bitbake to work and i also
tried the code sourcery approach and faced the issue you face.

After biting the bullet i got stuck into openembedded and got a
working image that i could customise, i attach my steps from a vanalli
ubuntu 10.04 lts install.

I hope this helps you

1: create ${HOME}/openembedded

2: Install necessarty dependencies
        2.1: Install all
    -> sudo apt-get install wget git-core python-dev texi2html chrpath
svn-buildpackage

3: go to angstrom page -> http://www.angstrom-distribution.org/building-angstrom
  3.1: get the scripts (from within openembedded folder)
    -> git clone git://gitorious.org/angstrom/angstrom-setup-scripts.git

4: get psycho into the sources folder -> http://psyco.sourceforge.net/download.html
  4.1: download psycho
    -> wget http://wyvern.cs.uni-duesseldorf.de/psyco/psyco-snapshot.tar.gz
  4.2: extract the source files
    -> tar -zxf psyco-snapshot.tar.gz
  4.3: install psycho
    -> cd psyco-dist
    -> sudo python setup.py install

5: configure the environment
  5:1 create the build config folder (from within angrstrom setup
scripts folder)
    -> mkdir -p build/config
  5:2 run the oebb.sh to configure things
    -> ./oebb.sh config beagleboard
  5

6: Build stuff
  7.1: export environment variables
    -> . ~/.oe/environment
  7.2: Perofrm a full build (from the build directory)
    -> bitbake base-image

7: Install the image
  8.1: copy the images from build/tmp-angstrom.../deploy/glibc/images/
Angstrom.....tar.bz2 to an extraction folder
  8.2: Extract the image

Kano