buildroot output files & NGW100 flash mismatch

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The EXCELLENT buildroot project for AVR32 produces various binary files int the binary directory.

The documentation reports regarding the rootfs.avr32_nofpu.jffs2 file :"...The JFFS2 root file system is target for the onboard flash device...

The serial flash partition size of NGW100 for root is only 8MB. But the rootfs.avr32_nofpu.jffs2 (default compilation) file size is over 18MB!!! (rc5)

It is obvious that only sdcard(problematic for many users) and network boot is the only usable solution for NGW100 owners.

Is there any plan to support buildroot and NGW100 internal flash?

Thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, hacking on it right now. That is why it is a release candidate, and not a final release ;)

Buildroot will split up the JFFS2 image so it can be fitted right into the flash devices on the NGW100.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The latest Buildroot RC8 produces root & usr files that fit the flash sizes.

I tested them and worked perfectly.
I used the default settings for ngw100. Compilation is flawless.

I tested all possible ways to boot from, SDCard, on board flash, NFS and all worked with no problem.

Congratulations to all developers involeved to this project. Buildroot port to AVR32 has made tremendous progress.

I attach the following uboot settings for anyone interested to check various boot options available for buildroot images.

board flash:

setenv bootcmd 'fsload boot/uImage;bootm'
boot

to boot from sdcard :

askenv bootcmd
mmcinit; ext2load mmc 0:1 0x10200000 /boot/uImage; bootm 0x10200000
set bootargs 'console=ttyS0 root=/dev/mmcblk0p1 ro rootwait=1' 
boot

Viron.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vpapadopoulos wrote:
The latest Buildroot RC8 produces root & usr files that fit the flash sizes.

I tested them and worked perfectly.
I used the default settings for ngw100. Compilation is flawless.[...]
Viron.

Hi,
I have just built RC8 as well with Buildroot, can you give me exact instructions on how to flash my system. What files exactly should I have in /binaries? I don't for example have an rootfs.avr32_nofpu.ext2 file like in the Docs on http://www.atmel.no/buildroot/bu...

be gentle - I am new to this - but I am loving it, this forum has already helped me enormously.

Regards,
Garry Hayne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The files I have in the binaries directory after compilation with default settings are the following:

Quote:
linux-kernel-2.6.23-avr32
rootfs.avr32_nofpu.jffs2
rootfs.avr32_nofpu.jffs2-root
rootfs.avr32_nofpu.jffs2-usr
rootfs.avr32_nofpu.tar
u-boot.bin

The following is a quick HOW_TO , I will update it with more details later.

You need these two files.
rootfs.avr32_nofpu.jffs2-root
rootfs.avr32_nofpu.jffs2-usr

You must boot either from nfs server or SDCard.
To boot from SDcard do the following.
You should copy the files from rootfs.avr32_nofpu.tar(not he file its self but the contents of it) to the sdcard and the above mentioned two files(put them in root directory). This is how the sdcard contents should look like

drwxr-xr-x 2 root root    4096 2007-11-12 09:35 bin
drwxr-xr-x 2 root root    4096 2007-11-09 12:42 boot
drwxr-xr-x 2 root root    4096 2007-11-09 12:43 config
drwxr-xr-x 2 root root    4096 2007-11-09 12:43 dev
drwxr-xr-x 8 root root    4096 2007-11-12 11:31 etc
drwxrwxrwx 4 root root    4096 2007-11-09 12:43 home
drwxr-xr-x 3 root root    4096 2007-11-12 09:35 lib
lrwxrwxrwx 1 root root      11 2007-11-12 11:14 linuxrc -> bin/busybox
drwx------ 2 root root    4096 2007-11-09 12:43 lost+found
drwxr-xr-x 3 root root    4096 2007-11-12 11:58 media
drwxr-xr-x 2 root root    4096 2007-11-09 12:43 proc
-rw-r--r-- 1 root root 7208960 2007-11-12 12:13 rootfs.avr32_nofpu.jffs2-root
-rw-r--r-- 1 root root 5998080 2007-11-12 12:13 rootfs.avr32_nofpu.jffs2-usr
drwxr-xr-x 2 root root    4096 2007-11-12 09:35 sbin
drwxr-xr-x 2 root root    4096 2007-11-09 12:43 sys
drwxrwxrwt 2 root root    4096 2007-11-09 12:43 tmp
drwxr-xr-x 8 root root    4096 2007-11-09 12:28 usr
drwxr-xr-x 8 root root    4096 2007-11-09 12:43 var
drwxr-xr-x 6 root root    4096 2007-11-09 12:29 www

Restart and type the following at the uboot prompt.(press space at the beggining of boot to get the prompt):

Quote:
askenv bootcmd
mmcinit; ext2load mmc 0:1 0x10200000 /boot/uImage; bootm 0x10200000
set bootargs 'console=ttyS0 root=/dev/mmcblk0p1 ro rootwait=1'
boot

After booting from SDCard, do the following

Quote:
~# flash_eraseall /dev/mtd3
~# flash_eraseall /dev/mtd1
~# dd if=/rootfs.avr32_nofpu.jffs2-root of=/dev/mtd1 bs=1024
~# dd if=/rootfs.avr32_nofpu.jffs2-usr of=/dev/mtd3 bs=1056

Please be carefull not to mispell the mtd partitions and delete the uboot program.

Ιi will take several minutes to erase and reprogram the on board flash , wait and do not break the procedure. (it seems forever but the prompt will reappear.)

At the end restart the board and again at the uboot prompt type

Quote:
setenv bootcmd 'fsload boot/uImage;bootm'
boot

This completes all necessary steps to program the onboard flash.

Regards,

Viron.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
askenv bootcmd
mmcinit; ext2load mmc 0:1 0x10200000 /boot/uImage; bootm 0x10200000
set bootargs 'console=ttyS0 root=/dev/mmcblk0p1 ro rootwait=1'
boot

Got this far but the board didn't boot. I just had a flashing red LED until I pressed reset (after waiting 10 minutes.

Regards,
Garry Hayne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want to boot from SD card, just unpack the tar file onto it (after formatting it with the ext2 or ext3 filesystem.) No need to copy the jffs2 images.

Oh, and if you have a large kernel, I recommend using 0x10400000 as the load address instead of 0x10200000.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ghayne wrote:
Quote:
askenv bootcmd
mmcinit; ext2load mmc 0:1 0x10200000 /boot/uImage; bootm 0x10200000
set bootargs 'console=ttyS0 root=/dev/mmcblk0p1 ro rootwait=1'
boot

Got this far but the board didn't boot. I just had a flashing red LED until I pressed reset (after waiting 10 minutes.

Hi,
Flashing red led is good!!! it means that the core of linux is running.
Could you please attach the output of the boot sequence to help troubleshooting.

Try the same but remove rootwait=1 parameter from bootargs uboot command line.

Another possible conflict could be the fstab in /etc directory that instructs the operating system to mount usr from onboard flash.
Edit the /etc/fstab directory from scdard and put # in front of all lines, then try again the boot sequence.

Regards,
Viron.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vpapadopoulos wrote:
ghayne wrote:
Quote:
askenv bootcmd
mmcinit; ext2load mmc 0:1 0x10200000 /boot/uImage; bootm 0x10200000
set bootargs 'console=ttyS0 root=/dev/mmcblk0p1 ro rootwait=1'
boot

Got this far but the board didn't boot. I just had a flashing red LED until I pressed reset (after waiting 10 minutes.

Hi,
Flashing red led is good!!! it means that the core of linux is running.
Could you please attach the output of the boot sequence to help troubleshooting.

Try the same but remove rootwait=1 parameter from bootargs uboot command line.

Another possible conflict could be the fstab in /etc directory that instructs the operating system to mount usr from onboard flash.
Edit the /etc/fstab directory from scdard and put # in front of all lines, then try again the boot sequence.

Regards,
Viron.

Hi, tried all the suggestions - no luck. See attached file.

Attachment(s): 

Regards,
Garry Hayne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I do not see the problem, your card is booting, but painfully slow. For some reason Dropbear gets bad entropy from /dev/urandom. Could you have a look in build_avr32_nofpu/dropbear-0.50/options.h or similar file and see what it uses as RANDOM file?

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hce wrote:
I do not see the problem, your card is booting, but painfully slow. For some reason Dropbear gets bad entropy from /dev/urandom. Could you have a look in build_avr32_nofpu/dropbear-0.50/options.h or similar file and see what it uses as RANDOM file?

Hi,
my /dev folder on the SD Card only contains null and console!!!!! when I look at the TAR I extracted from (in Binaries) it looks the same?? Have I done something wrong while compiling? the Kernel starts to boot OK - BTW dropbear uses urandom, but of course it's not present. Would appreciate some help.

Regards,
Garry Hayne

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Look at the S00virtualfs or similar file, and you will discover that /dev is a tmpfs and mdev is used to populate the directory. Saves loads of flash erase cycles :)

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks to all. I successfuly boot from my 128Mbyte MMC card :)

I had the same problem:

Quote:
mkdir: cannot create directory '/etc/dropbear': Read-only file system
Will output 1024 bit rsa secret key to '/etc/dropbear/dropbear_rsa_host_key'
Generating key, this may take a while...
Warning: Reading the random source seems to have blocked.
If you experience problems, you probably need to find a better entropy source.

I just comment fstab in /etc to not use onboard flash partition and it is working nice.

BTW I boot every time without any problem maybe problems with the booting are related only to SD cards