Help compiling the kernel

John Gentilin
I am working with the Mini2440 + 7" LCD.
First installed the kernel and root filesystem from 
download from "Kernel Concepts" and successfully booted 
Angstrom. Now I downloaded the kernel source along with 
GCC 4.3.2 and compiled the kernel with the config_mini2440_a70 
config file.. All seemed to compile fine but when boot the board 
it hangs after uncompressing the kernel... below is the 
boot log..  Any ideas what I may be doing wrong..

Thanks
-John G

Loading from NAND 64MiB 3,3V 8-bit, offset 0x60000
   Image Name:   Linux-2.6.29.4-FriendlyARM
   Created:      2009-06-22   9:33:50 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2022376 Bytes =  1.9 MB
   Load Address: 30008000
   Entry Point:  30008000
## Booting kernel from Legacy Image at 32000000 ...
   Image Name:   Linux-2.6.29.4-FriendlyARM
   Created:      2009-06-22   9:33:50 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2022376 Bytes =  1.9 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing
Linux...........................................................................
.......................................................
done, booting the kernel.

Florian Boor
Hi,

maybe try the configuration used by the the kernel folks and OE:
http://cgit.openembedded.net/cgit.cgi/openembedded/plain/recipes/linux/l...

If this doesn't work it might be a problem with your bootloader. 

Greetings

Florian

John Gentilin
Florian,

I tried the OE config recipe but it threw a bunch of errors about 
"__LINUX_ARM_ARCH__" not defined.... probably because the config
is for 2.6.30 and I am trying to compile 2.6.29..

I was thinking even if the config was wrong, there has to be 
something major to make it not even print out the early boot 
messages..  or I am missing something basic when I built the 
kernel... I was unsure of some of the origins of what I had so 
I started from scratch.. Here is what I did...

From http://www.andahammer.com/downloads, 
I downloaded the friendlyarm2440-package.tar.bz2 package.. 
Following the instructions from here to reburn uboot, and install 
the kernel and root file systems
http://labs.kernelconcepts.de/Publications/Micro24401/#Micro2440-Instruc...

That all worked fine and the kernel booted..

Next I downloaded
angstrom-armv4t-linux-gnueabi-toolchain-gpe-20090527.tar.bz2 and installed
it in /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin

Using the linux-2.6.29-mini2440-20090609.tgz download, I untar'ed it into
the ~/src/linux, copied config_mini2440_a70 to .config, and edited the 
Makefile to change the following lines
#CROSS_COMPILE  = arm-linux-
CROSS_COMPILE   = arm-angstrom-linux-gnueabi-

I added the angstrom tool chain in my path, and ran make uImage
everything seemed to compile correctly with the final output having

  CHK     include/linux/compile.h
  Kernel: arch/arm/boot/Image is ready
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
Image Name:   Linux-2.6.29.4-FriendlyARM
Created:      Tue Jun 30 01:44:41 2009
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2019076 Bytes = 1971.75 kB = 1.93 MB
Load Address: 0x30008000
Entry Point:  0x30008000
 Image arch/arm/boot/uImage is ready

I flashed the kernel by following the instructions on the 
kernel concepts page again then reset the Mini2440

uBoot came up fine, it found the kernel image and printed what looks 
like the correct information, verified the checksum, uncompressed 
the kernel, then just died...

Any ideas on what I could be doing wrong.. I am thinking its something 
big like an Endian issue or maybe mkimage is not doing its job...  

The build script is picking up mkimage from my Umbuntu 9.0.4 distro 
from /usr/bin/mkimage Are there any specific version dependencies..

Can you explain how address 0x30008000 is determined to become the boot
entry point ?

Thank you
John Gentilin

Florian Boor
Hi,

the address is from the Makefile.boot used by your kernel arch. If I
remember correctly arch/arm/mach-s3c2410/Makefile.boot in this case.

The address should be correct but you could have set some configuration
options that could cause this effect such as a bad commandline in u-boot or
compiled in or missing serial support. 

mkimage from Ubuntu should be fine, I'm using this one too.

This error you got initially is suspicious and migh lead to a broken config
("__LINUX_ARM_ARCH__" not defined....). This sounds like a broken toolachin
or you forgot to set "ARCH=arm" in your make command. You need to do this
for every config target too.

Greetings

Florian

John Gentilin
Great idea.. no serial support.. I was thinking that it didn't die, it just
went silent.. So I attached the LCD to see if I had a screen and
unfortunately no.. it was blank.. Do you have a place where you can post a
kernel src image that should just make and load... it would help a lot if I
had a reference point to get me started.

BTW, I also tried the 
 Linux-2.6.29 (20090609) compiled with the toolchain
 arm-linux-gcc-4.3.2 with EABI downloaded from this site.
and got the same results.

I only got the undefined __LINUX_ARM_ARCH__ error when I tried to
copy the OE config recipe that you provided a link for in my 2.6.29 
tree..

Thank you
John Gentilin

John Gentilin
Florian,

Is it possible that my uboot is compiled with a different tool
chain than I am using for my kernel ?? I grabbed the uboot image
from the friendlyarm2440-package on the andahammer site..

Which tool chain should I be using.. I currently have 3
GCC 4.3.2 EABI
arm-angstrom-linux-gnueabi
Code Sourcery 2009 Q1 arm-none-eabi

Someone on another blog mentioned that I need to disable the USB drivers..
I tried it but no luck... see 
http://www.friendlyarm.org/topic.asp?TOPIC_ID=42

Thank you for your time
John Gentilin

Florian
Hi,

that's possible but the toolchain shouldn't matter. I'm using the Angstrom
toolchain only.

Greetings

Florian

John Gentilin
k, I will recompile all and try again..

Thank you for all your input.. can you suggest 
other ways to diagnose this ?

Is there a tool to disassemble the uImage files.
I could go the crazy route and assembler diff my working
image from all the others.

Are there any flags I can set to cause a more verbose level
of logging.. This is really hard to proceed on where there
is no information.

How difficult is it to single step with a JTag debugger..
I have a JLink setup.. sounds a little hard code, but maybe
I can isolate where the kernel goes south.. Since there
are no log messages what so ever, hopefully its early on in
the code.

One thing I have not tried yet is a get pull from OE, will
that kernel have all the drivers to run the LCD, etc..

Thanks again
John Gentilin

John Gentilin
Success !

I successfully compiled the kernel posted by buserror.. 
Here are my step by step instructions.

Using the tool chain from here
http://labs.kernelconcepts.de/downloads/angstrom-armv4t-linux-gnueabi-to...


mkdir src; cd src
mkdir mini2440;  cd mini2440
mkdir uboot; cd uboot

git clone git://repo.or.cz/u-boot-openmoko/mini2440.git

cd mini2440
make ARCH=arm mini2440_config
make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi-

Replace the bootload using 
http://labs.kernelconcepts.de/Publications/Micro24401


cd src
mkdir kernel; cd kernel
git clone git://repo.or.cz/linux-2.6/mini2440.git

cd mini2440
make ARCH=arm  mrproper
make ARCH=arm  mini2440_defconfig
make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- uImage

cp arch/arm/boot/uImage to an sdcard
put the sdcard into the mini2440

Replace the kernel using 
http://labs.kernelconcepts.de/Publications/Micro24401


References
http://wiki.linuxmce.org/index.php/Mini2440
http://mini2440.googlecode.com/files/mini2440-bootstrap-v2.sh


John Gentilin

Yossarian
I had success with the method laid out in kernelconcepts.de

I'm now running their prebuilt version of 2.6.30.

However, now my networking doesn't seem to work.
I know the HW works since the original 2.6.13 was okay
but now I don't even get the little RJ45 lights to
flicker when I plug in a working cable.

I'm trying to get this whole thing running so I can
telnet into the mini2440.

Any help available?

Yossarian
I purchased a new board from andahammer.com and now
I don't get the hang after "booting the kernel" message.

I'm able to load both the pre-built kernel in the
download section and load my own zImage built from
2.6.29.

Telnet works as well.

Someone else bought the first board so I'm not sure
where it came from but I know it's a 64MB board.
I suspect the supervivi on the NOR flash needs to
be upgraded but I'll try that later.  I'd rather
work on the new board now.