AVR32 ngw100 custom uImage

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

Hello,

I am having problums using a custom uImage om my ngw100. My steps are listed below:

1. Downloaded openwrt-avr32-2.6-uImage from http://downloads.openwrt.org/kam...

2. I copied the uImage from the ngw100 to my SD card:
cp uImage /mnt/media/uImage.old

3. I renamed openwrt-avr32-2.6-uImage to uImage an copied it to my ngw100 in the / directory.

4. Reset the NGW.

Now it boots up and I get a kernel panic :D

The last 2 lines read:

Warning: Unable To Open an initial console.
Kernel panic - not syncing: No init found. Try passing init= option to kernel.

Any help would be great. I would love to boot into openwrt.

Thank you!!!!

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

If you want to boot OpenWRT, then you need to install the entire OpenWRT, i.e. replace content of both flash devices.

Hans-Christian

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

hce,

I have no idea how to do that. I did not know there was two flashes to replace. Can you point me in the right direction please?

Lastnight I made a ext2 file system on a SD card the copied the uImge to that. No luck at all. On the openWRT page they have the uImage an a squashfs.img. I tried to dd the squashfs.img to the SD card an well the NGW nor my linux box will see it now :D

Thank you!

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

I guess you should read the documentation for OpenWRT, or try their emaillist. I have yet to try their Buildroot fork.

Hans-Christian

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

I have went over the docs. I will again might of missed something. Do you happen to know if a root.img is the same as a uImage? I know where I messed up. I think the wrt uImage can read the squashfs.img It seems like it would just be a matter of loading the uImage first on the NGW.

Then the squashfs.img would / should work. Do you / anyone happen to have any idea on the steps for that?

Thank you!!!!!

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

I would think that the .img files are filesystem images containing your root filesystem as well as the kernel image (uImage). A common mistake is that uImage is only a kernel binary, no more or less, whereas most .img files contain a whole filesystem.

I don't know whether uboot can boot a squashfs filesystem. I'm almost certain the one on your ngw won't be able to, you'll need to build a new uboot with squashfs supported if I'm understanding what you're trying to do correctly.

What you'll need is, as you originally said, a uImage and a root filesystem, probably on an ext2 filesystem. Your original error usually means your root filesystem is incorrect. If you're sure you've correctly specified where the rootfs is located then make sure the files under /dev haven't been ronnied by the move.

Any reason you want the openwrt distro as opposed to, for example, the avr32 buildroot? Buildroot is just much, much easier to get flying!

-S.

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

Hey squidgit ,

I am going to order a new NGW100 an try bulidroot. do you know of any good how-to's on getting started? openWRT is now running on my NGW100 i used the info from this thread:

http://forum.openwrt.org/viewtop...

It works great. I am running tons of new packages on the NGW. you simply run ipkg install. An your done. Everything is pre compiled to work with AVR32. If you give it a try make sure you do a ipkg update. I think theres over 100 prebulit apps on openWRT that work with the AVR32 =)

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

Altrez wrote:
I am going to order a new NGW100 an try bulidroot. do you know of any good how-to's on getting started?
'make atngw100_defconfig, make, extract the tarball to your card, boot. Done :)
Altrez wrote:
It works great. I am running tons of new packages on the NGW. you simply run ipkg install. An your done. Everything is pre compiled to work with AVR32. If you give it a try make sure you do a ipkg update. I think theres over 100 prebulit apps on openWRT that work with the AVR32 =)
Sounds nice! That is actually one thing which is lacking a little in the Atmel-supported distros, good package management. Would be good to get on to that. If it's not done by chrissy maybe I can hide in a bedroom with my lappy while the family fights it out and make it fly ;)

-S.

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

Hey.

I am as noobish as they come to AVR32 programing. I am running Fedora core 6 at home. So lets say I have a vinilia install no updates at all. What would I need to download using yum? So i could compile Buildroot with AVR 32 support? I would like to keep openWRT on the flash an use the SD for bulidroot. That would be sweet.

Thank you for the help. I plan on making how-tos for anyone to use if they need to. Or a Live Linux ISO with everything ready to rock.

'make atngw100_defconfig, make, extract the tarball to your card, boot. Done'

That also will make a .img right? That could be uploaded to the flash of the NGW100.

Ty,
:D

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

Altrez;
(This https://www.avrfreaks.net/wiki/index.php/Documentation:NGW/Firmware_upgrade is a good reference, but not all the details are still up-to-date, or apply directly to buildroot-avr32-v2.1.0-rc11)
If you use http://www.atmel.no/buildroot/, rc11 will build three files for you, one of which you can untar ('tar xf .../binaries/atngw100/rootfs.avr32_nofpu.tar -C /) onto your SDCard. Also, copy rootfs.avr32_nofpu.jffs2-root and rootfs.avr32_nofpu.jffs2-usr to the root of your SDCard.

You can boot from it, but you will want to edit /etc/fstab (on the SDCard) and comment out the line '/dev/mtdblock3 /usr jffs2 defaults 0 0', to prevent the the onboard dataflash from being mounted with a different set of /usr contents.

When I am booting from the SDCard, I do this:

Uboot> set bootargs 'console=ttyS0 root=/dev/mmcblk0p1 rootwait' 
Uboot> mmcinit
Uboot> ext2load mmc 0:1 0x10300000 /boot/uImage
Uboot> bootm 0x10300000

I purposely do not use 'saveenv', so that, once I have written mtd1 and mtd3, all I need to do is reset.

The .img files you asked about are replaced by:

Quote:
rootfs.avr32_nofpu.jffs2-root
and
Quote:
rootfs.avr32_nofpu.jffs2-usr

This leave mtd1 and mtd3 unmounted so that I can replace the contents with:

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

After 'make atngw100_defconfig', you can reconfigure Linux with 'make menuconfig', and configure busybox with 'make busybox-menuconfig'. However, check the files sizes for the -root and -usr files, to make sure they will fit in the different onboard flash chips (mtd1, about 8MB, and mtd3, about 8.4MB). Also, consider upgrading U-Boot to 1.3.0, if you can (it will be built along with everything else).

JimT

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

JimT,

Thank you for the info. I installed bulidroot RC11 on friday. I did not compile the source yet. I used the premade tarball an all went well. I did not however do this:
"
~# flash_eraseall /dev/mtd1
~# dd if=/rootfs.avr32_nofpu.jffs2-root of=/dev/mtd1 bs=1024
~# flash_eraseall /dev/mtd3
~# dd if=/rootfs.avr32_nofpu.jffs2-usr of=/dev/mtd3 bs=1056
"
The NGW is booting off the SD card just fine. I looked at the Bulidroot source an noticed all the great packages. Are they in the .jffs files? If not what is? And why would one want to write them to flash? My NGW100 looks like this:

# ls
bin proc
boot rootfs.avr32_nofpu.jffs2-root
config rootfs.avr32_nofpu.jffs2-usr
dev sbin
etc sys
home tmp
lib usr
linuxrc var
lost+found www
media
#

Should I flash the two jffs file systems onto the board? like the example above?

Thank you so much. :D

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

Altrez;

It is not clear to me what you are trying to do, so I'll just tell you some things to help you make an informed choice:

Quote:
The NGW is booting off the SD card just fine. I looked at the Bulidroot source an noticed all the great packages. Are they in the .jffs files?

The short answer is NO. The files (application, etc.) included in the jffs2 files are determined when you do a 'make menuconfig' (and maybe 'make busybox-menuconfig' and 'make linux26-menuconfig') in your buildroot directory. If you have not done the 'make menuconfig', and you have done a 'make atngw100_defconfig' followed by a 'make', and encountered no errors, you should have default files for the NGW100, which include things like a Samba server, Web server, FTP server, SSH server, DHCP server, DNS server, and Telnet server. You should get to know these before you add new application, unless you hve some specific goal in mind.
Quote:

If not what is? And why would one want to write them to flash?

The NGW100 was designed to be (more or less) a stand-alone router, with a file server designed to 'serve' the files on the SDCard (through Samba). In order to remove and replace the SDCard without reseting the NGW100, the card must be dis-mountable, and therefore cannot have on it any of the files needed by the system (generally found in /sbin, /usr, /bin, and other places). So, the (default) configuration mounts the FLASH devices (mtdblock1 and mtdblock3), leaving the SDCard free to be removed and replaced without reboot. For example, 'ls -la /' on my system shows:

drwxr-xr-x   24 root     root            0 Dec 31  1969 .
drwxr-xr-x   24 root     root            0 Dec 31  1969 ..
-rw-r--r--    1 root     root          105 Dec 11 10:23 .ash_history
drwxrwxrwx    2 root     root            0 Nov 24 15:36 avr32
drwxrwxrwx    2 root     root            0 Nov 24 15:15 bin
drwxr-xr-x    2 root     root            0 Dec  5 11:00 boot
drwxr-xr-x    3 root     root            0 Dec 31  2006 config
drwxr-xr-x    4 root     root          800 Jan  5  1970 dev
drwxr-xr-x    2 root     root            0 Dec  5 11:28 devel
drwxrwxrwx    8 root     root            0 Dec  5 12:37 etc
drwxrwxrwx    5 root     root            0 Dec  5 12:37 home
drwxr-xr-x    3 root     root            0 Dec  5 11:00 lib
lrwxrwxrwx    1 root     root           11 Dec  5 11:00 linuxrc -> bin/busybox
drwx------    2 root     root            0 Dec  5 11:00 lost+found
drwxr-xr-x    3 root     root            0 Dec 31  1969 media
drwxrwxrwx    5 root     root            0 Dec  7 16:07 mnt
drwxrwxrwx    2 root     root            0 Nov 24 15:36 nfs
dr-xr-xr-x   44 root     root            0 Dec 31  2006 proc
drwx------    2 root     root            0 Dec  5 12:25 sbin
drwxr-xr-x   23 root     root         4096 Dec  5 10:21 sd
drwxr-xr-x   10 root     root            0 Dec 31  2006 sys
drwxrwxrwt    3 root     root          100 Jan  5  1970 tmp
drwxr-xr-x    9 root     root            0 Dec 31  1969 usr
drwxr-xr-x    8 root     root            0 Dec  5 11:00 var
drwxr-xr-x    7 root     root            0 Mar  8  2007 www

and 'df' shows:

Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock1            8000      7120       880  89% /
dev                        512         0       512   0% /dev
tmp                      15264        12     15252   0% /tmp
run                      15264        40     15224   0% /var/run
log                      15264      1864     13400  12% /var/log
/dev/mmcblk0p1         1933364     22968   1812184   1% /media/mmcblk0p1
/dev/mtdblock3            8448      7192      1256  85% /usr
/dev/mmcblk0p1         1933364     22968   1812184   1% /sd

that /dev/mtdblock1 is mounted as '/' (my root), and /dev/mdtblock3 is mounted as my '/usr'. '/dev', '/tmp', '/var/log', and '/var/run' are all mounted on temporary (i.e., RAM) file systems, to reduce the wear and tear on the FLASH chips.
and 'mount' shows:

rootfs on / type rootfs (rw)
/dev/root on / type jffs2 (rw)
proc on /proc type proc (rw)
sys on /sys type sysfs (rw)
dev on /dev type tmpfs (rw)
pts on /dev/pts type devpts (rw)
config on /config type configfs (rw)
tmp on /tmp type tmpfs (rw)
run on /var/run type tmpfs (rw)
log on /var/log type tmpfs (rw)
/dev/mmcblk0p1 on /media/mmcblk0p1 type ext2 (rw,sync)
/dev/mtdblock3 on /usr type jffs2 (rw)
/dev/mmcblk0p1 on /sd type ext2 (rw,sync)
avrdev:/avr32 on /avr32 type nfs (rw,vers=3,rsize=32768,wsize=32768,hard,proto=udp,timeo=7,retrans=3,sec=sys,addr=avrdev)
avrdev:/devel on /devel type nfs (rw,vers=3,rsize=32768,wsize=32768,hard,proto=udp,timeo=7,retrans=3,sec=sys,addr=avrdev)
avrdev:/nfs on /nfs type nfs (rw,vers=3,rsize=32768,wsize=32768,hard,proto=udp,timeo=7,retrans=3,sec=sys,addr=avrdev)

Notice that I have the SDCard (/dev/mmcblk0p1) mounted twice, once as '/media/mmcblk0p1' (the default), and again as '/sd' (for easier access). I also have mounted three NFS shares from my development machine.

As far as what is contained in the jffs2 files: The figures from 'df', above show that /dev/mtdblock1 contains 8000 1k blocks (about 8MB), with 7088 (89%) used, and /dev/mtdblock3 contains 8448 1k block (about 8.5MB), with 7192 (85%) used. I'm pretty sure that, in this particular case, the files in the two jffs2 file-systems are the files selected by 'make atngw100_defconfig' and 'make'.

Should I flash the two jffs file systems onto the board? like the example above? 

Again, whether or not you re-write the FLASH depends on what you are trying to do with the board, but if you do decide to to do it, the above method is the way to go.

JimT

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

JimT,

Thanks again for all the help. I have a few more questions. I want to save the commands in uboot so when I reset the NGW it will boot right up. As of now I have to type everything in to make it boot:

Uboot> set bootargs 'console=ttyS0 root=/dev/mmcblk0p1 rootwait'
Uboot> mmcinit
Uboot> ext2load mmc 0:1 0x10300000 /boot/uImage
Uboot> bootm 0x10300000

I did try and use saveenv but it did not work. uboot complains about a bad magic number an refers to 0x10300000.

Thanks!!

-Altrez

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

saveenv is the only way to save the commands, the bad magic number stuff is weird.

Also, are you putting the mmcinit; ext2load ...; bootm stuff in the bootcmd? You can put all those commands in the bootcmd seperated by ';'s and they'll be run on boot (assuming you can get saveenv to work!)

What is the exact saveenv error you're getting?

-S.

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

Hey Squidgit,

Slept for a few hours and all is well. My mind needed a reboot ;)

Thank you,

-Altrez