Build New Kernel with BuildRoot

martin
hi all 
I'm trying to build a new kernel with buildroot, but I can not make it work
with my mini2440. 
I used the following configuration: 

Target Architecture
    [*] arm

Target Architecture Variant
    [*] arm920t

Target ABI: 
    [*] EABI

Toolchain
    [*] Enable RPC // need for NFS support in busybox
    [*] Use software floating point // need for for busybox 

Package Selection for the target 
    [*] <choose software you want to use in your system>

Target filesystem options
    [ ] tar
    [ ] ext2
    [*] jffs2
    Endianess
        [*] little-endian

        Flash Type
            (x) NAND flash with 2kB Page and 128 kB erasesize

Kernel 2.6.30.2
[*] Linux (Advance Configuration)
       Kernel Binary format
          [*]zImage


This generates 2 files I zImage file 
and a file rootfs.arm.jff2 

then attempt to upload the files using mini2440 vivi, doing the following: 

[k] Download linux kernel 
I upload the file zImage 

[y] Download root_yaffs image 

I upload the file rootfs.arm.jff2 
restart the system 
but does absolutely nothing. 

can someone help me with this, am I doing wrong?

thanks for helping

mgalemin
Hi martin, 

1. Please post here traces you got from console.

2. I think you should try to use these options for kernel:

[z] Download zImage into RAM
[g] Boot linux from RAM

3. Also you got rootfs in jffs2 format but why did you load it as yaffs?

These are just my suppositions as I use u-boot instead of supervivi.

Sincerely, 
Maksim.

martin
hello, thank you very much with the response. 
I see the problem I use jffs, and should use yaffs. 
but this generates a new wonder to me as I get the buildroot generates a
"rootfs" in yaffs format, since that option I do not have, fires only
offers me. (ART, squashfs, jffs2, cramfs, cloop and ext2). 
how can I resolve this.??? 
I have another question. I have seen many guides to aid in the menu of
supervivi is thus: 

##### FriendlyARM BIOS for 2440 #####
[x] bon part 0 320k 2368k
[v] Download vivi
[k] Download linux kernel
[y] Download root_yaffs image
[c] Download root_cramfs image
[a] Absolute User Application
[n] Download Nboot
[e] Download Eboot
[i] Download WinCE NK.nb0
[w] Download WinCE NK.bin
[d] Download & Run
[z] Download zImage into RAM
[g] Boot linux from RAM
[f] Format the nand flash
[p] Partition for Linux
[b] Boot the system
[s] Set the boot parameters
[t] Print the TOC struct of wince
[u] Backup NAND Flash to HOST through USB(upload)
[r] Restore NAND Flash from HOST through USB
[q] Goto shell of vivi
Enter your selection:


and mine goes like this: because I do not have these options? my
motherboard is an mini2440 128mb


##### FriendlyARM BIOS 2.0 for 2440 #####
[x] format NAND FLASH for Linux
[v] Download vivi
[k] Download linux kernel
[y] Download root_yaffs image
[a] Absolute User Application
[n] Download Nboot for WinCE
[l] Download WinCE boot-logo
[w] Download WinCE NK.bin
[d] Download & Run
[z] Download zImage into RAM
[g] Boot linux from RAM
[f] Format the nand flash
[b] Boot the system
[s] Set the boot parameters
[u] Backup NAND Flash to HOST through USB(upload)
[r] Restore NAND Flash from HOST through USB
[q] Goto shell of vivi
Enter your selection:

I tried to replace it with u-boot but I was unable, however hard they try
always reappears supervivi, I tested with the following two guides: 

http://narnia.cs.ttu.edu/drupal/node/131 
http://crysol.org/es/node/1241

thanks for helping 
greetings

Maksim Galemin
Hi, 

Show all you steps for replacing supervivi with u-boot. Post here all
console output since supervivi start till 'reset' command in u-boot shell.
I can't understand what do you mean "always reappears supervivi". If you
scrubbed NAND flash and flashed it with u-boot.bin how supervivi could
reappear???

martin
hello thanks for the reply I put the information below. 
as really the end of everything, whatever you do reappears "vivi".

##### FriendlyARM BIOS 2.0 for 2440 #####
[x] format NAND FLASH for Linux
[v] Download vivi
[k] Download linux kernel
[y] Download root_yaffs image
[a] Absolute User Application
[n] Download Nboot for WinCE
[l] Download WinCE boot-logo
[w] Download WinCE NK.bin
[d] Download & Run
[z] Download zImage into RAM
[g] Boot linux from RAM
[f] Format the nand flash
[b] Boot the system
[s] Set the boot parameters
[u] Backup NAND Flash to HOST through USB(upload)
[r] Restore NAND Flash from HOST through USB
[q] Goto shell of vivi
Enter your selection: q


Supervivi> load ram 0x31000000 239016 u
USB host is connected. Waiting a download.

Now, Downloading [ADDRESS:31000000h,TOTAL:239026]
RECEIVED FILE SIZE:  239026 (233KB/S, 1S)
Downloaded file at 0x31000000, size = 239016 bytes

Supervivi> go 0x31000000
go to 0x31000000
  argument 0 = 0x00000000
  argument 1 = 0x000á

U-Boot 1.3.2-dirty-moko12 (Apr 16 2009 - 18:14:52)

I2C:   ready
DRAM:  64 MB
Flash:  2 MB
NAND:  128 MiB
*** Warning - bad CRC or NAND, using default environment

USB:   S3C2410 USB Deviced
In:    serial
Out:   serial
Err:   serial
MAC: 08:08:11:18:12:27
Hit any key to stop autoboot:  0
MINI2440 #


MINI2440 # nand info
Device 0: NAND 128MiB 3,3V 8-bit, page size 2048, sector size 128 KiB
MINI2440 #

MINI2440 # version
U-Boot 1.3.2-dirty-moko12 (Apr 16 2009 - 18:14:52)
MINI2440 #

MINI2440 # nand scrub
NAND scrub: device 0 whole chip
Warning: scrub option will erase all factory set bad blocks!
         There is no reliable way to recover them.
         Use this command only for testing purposes if you
         are sure of what you are doing!

Really scrub this NAND flash? <y/N>
Erasing at 0x7fe0000 -- 100% complete.
Bad block table not found for chip 0
Bad block table not found for chip 0
OK
MINI2440 #




MINI2440 # nand createbbt
Create BBT and erase everything ? <y/N>
Skipping bad block at  0x07f80000
Skipping bad block at  0x07fa0000
Skipping bad block at  0x07fc0000
Skipping bad block at  0x07fe0000

Creating BBT. Please wait ...Bad block table not found for chip 0
Bad block table not found for chip 0
Bad block table written to 0x07fe0000, version 0x01
Bad block table written to 0x07fc0000, version 0x01

MINI2440 #



MINI2440 # mtdparts

device nand0 <mini2440-nand>, # parts = 4
 #: name                        size            offset          mask_flags
 0: u-boot              0x00040000      0x00000000      0
 1: env                 0x00020000      0x00040000      0
 2: kernel              0x00500000      0x00060000      0
 3: root                0x07aa0000      0x00560000      0

active partition: nand0,0 - (u-boot) 0x00040000 @ 0x00000000

defaults:
mtdids  : nand0=mini2440-nand
mtdparts: <NULL>
MINI2440 #



MINI2440 # nand write 0x31000000 u-boot
NAND write: device 0 offset 0x0, size 0x40000
 262144 bytes written: OK
MINI2440 #


MINI2440 # reset

##### FriendlyARM BIOS 2.0 for 2440 #####
[x] format NAND FLASH for Linux
[v] Download vivi
[k] Download linux kernel
[y] Download root_yaffs image
[a] Absolute User Application
[n] Download Nboot for WinCE
[l] Download WinCE boot-logo
[w] Download WinCE NK.bin
[d] Download & Run
[z] Download zImage into RAM
[g] Boot linux from RAM
[f] Format the nand flash
[b] Boot the system
[s] Set the boot parameters
[u] Backup NAND Flash to HOST through USB(upload)
[r] Restore NAND Flash from HOST through USB
[q] Goto shell of vivi
Enter your selection:

Maksim Galemin
Did you set NAND/NOR switch on your board back to NAND state?

martin
hello, I have tried almost everything. 
previous tests were thus: 
mini2440 and then turn off the Interuptor "NAND / NOR, NOR in position. and
light the mini2440. 
starts the VIVI, and from there the previous steps. In this way I worked. 
I tried the same but with the variant: 
1. I turn off the mini2440 
2. NOR position switch 
3. I turn on the mini2440 
4. vivi starts, and by the u-boot 
5. Interuptor to change the position NAND 
6. repeat the above steps. 

unsuccessfully, whenever I turn the plate in normal position, it appears he
lived, and if the start position in NAND, not incidentally, the u-boot, it
just is not showing anything 


greetings

martin
I forget to comment on an important detail, when the mini2440 home for the
first time after doing the above steps, I get the following error: 


U-Boot 1.3.2-dirty-moko12 (Apr 16 2009 - 18:14:52)

I2C:   ready
DRAM:  64 MB
Flash:  2 MB
NAND:  nand_scan(): Cannot allocate oob_buf
0 MiB

but only occurred once at the end of the previous steps. 
and never after as much as the power off and back on, nothing is displayed
again. 

greetings

Maksim Galemin
1. Turn OFF mini2440;

2. 'NOR/NAND' switch in 'NOR' position;

3. Turn ON mini2440;

4. Do all the steps from here
http://www.friendlyarm.net/forum/topic/156?lang=en#654;

5. Turn OFF mini2440;

6. 'NOR/NAND' switch in 'NAND' position;

7. Turn On mini2440;

8. If you got "NAND:  nand_scan(): Cannot allocate oob_buf" error read next
topic http://www.friendlyarm.net/forum/topic/79?lang=en.

9. If you got some other errors - post here all console output.

martin
hi all, I wanted to thank, I got it to work, the u-boot on mini2440 
with these steps: 


1. load ram 0x32000000 242332 u

2. go 0x32000000

3. nand scrub

4. nand createbbt

5. nand write.e 0x32000000 0x0 0x3b29c

6. dynpart

7. dynenv set u-boot_env

8. saveenv


thanks

Dave S
NAND:  nand_scan(): Cannot allocate oob_buf

A lot of people have had this problem, but I haven't seen a solution.

Here' the list of files that got made.

-rw-rw-r-- 1 smead smead 245760 Mar  5 18:46 u-boot-nand16k.bin
-rw-rw-r-- 1 smead smead 235520 Mar  5 18:46 u-boot-nand2k.bin
-rwxrwxr-x 1 smead smead 234004 Mar  5 18:46 u-boot.bin*

I've tried them all with enough RAM allocated, i.e.
load ram 0x32000000 250000 u
and I still get the problem.

Can someone give a real solution?

Thanks, Dave.

gene.sally
> NAND:  nand_scan(): Cannot allocate oob_buf

This is from the "buserror" u-boot (lacking a better label_), you'll see
this error if you attempt to run u-boot from RAM.  

The *very* lazy way to get u-boot on the board is to let Linux boot (the
Qtopia image that came with the board) and then use the nandtools to write
u-boot into /dev/mtd0 with nandtools, like so

# flash_eraseall /dev/mtd0
# nandwrite /dev/mtd0 <u-boot image>

Visit http://www.linux-mtd.infradead.org/source.html to get the sources, or
you can compile them using buildroot.  I compile them from scratch so I can
build static binaries, which makes them not dependent on any C library.  If
you want to build these with build root, search for "flash_eraseall" and
you'll see where to enable these.  (I seem to recall that you can make a
static binary with buildroot) 

Once u-boot is written into /dev/mtd0, reboot and than do the nand scrub /
create bbt routine.  This is the approach I've taken, we've re-programmed
literally 100's of boards this way with no errors.

You can also use supervivi to load the u-boot image directly into flash by
writing it directly into flash, by doing the following from the supervivi
booloader prompt:

load ram 0x0 <size of file> u

However, this is less dependable, it seems like the download hangs every
once in a while.  I have an automated board flashing script, so a
dependable repeatable process is paramount.

As for the error oob error message, that occurs at the first "malloc" in
u-boot.  I haven't had the time to trace down why malloc() is failing, I'm
guessing that some initialization was skipped and malloc() doesn't have a
pointer into the bottom of the heap.  But that's just a guess.

Regards,
gene

kevi
Hi Martin i'm also trying to create a zImage with jffs2 rootfs using
BUILDROOT. but as i type the make command i get the following error->

"target/u-boot/Makefile.in:272: *** NO U-Boot board name set. Check your
BR2_TARGET_UBOOT_BOARDNAME setting.  Stop."

Nandu
Hi, I use mini2440 with 64Mb flash. 
I get nand_scan(): Cannot allocate oob_buf error, when I try to run u-boot
from RAM. I tried all the possibilites but in vain... Is there a U-boot
binary which can fix this issue? If so please share me.
Thanks in advance,
Nandu

davef
https://www.blogger.com/comment.g?blogID=11320970&postID=41189769619...

Also, search the bootloader section here.

summer
I want to share my blog to you. there are information about mini2440 and
buildroot from my experience.
Please go to see it at http://www.evolvelib.com and leave your comments.
Thanks