Can't ping host from uboot, cant do NFS

bluscape
I'm trying to setup a NFS server for my Mini2440. But before I go that far
I first want to be able to establish communications via the ping command.
But ALL my attempts to ping any computer from the Mini2440 FAIL. When the
Mini2440 is in ping mode I'm able to ping it from the computer but the
Mini2440 gets no response from the computer.
When I use a router setup I can at least ping the router from the Mini2440.
I will explain all the details and setups now.

Software:

Host PC: Windows 7 64bit Pro (firewall disabled), Static IP: 192.168.1.40
NFS Server (Guest PC): Ubuntu 10.04.2 Virtual Machine (VMWare), Static IP:
192.168.1.42
Mini2440: u-bot binary from
http://bill.station51.net/index.php?post/2010/04/27/Binary-Links-to-U-Boot

Hardware:

Mini2440: Mini2440v2 from www.developmentboard.net AND Mini2440 from
www.thaieasyelec.net
Router: Linksys Cisco WAG320N, Router IP: 192.168.1.1 therfore the
GatewayIP = 192.168.1.1
Switch: Linksys EZX16W

u-boot settings:

bootdelay=3
ethaddr=08:08:11:18:12:27
serverip=192.168.1.42
netmask=255.255.255.0
usbtty=cdc_acm
mini2440=mini2440=0tb
bootargs_base=console=ttySAC0,115200 noinitrd
bootargs_init=init=/sbin/init
root_nand=root=/dev/mtdblock3 rootfstype=jffs2
root_mmc=root=/dev/mmcblk0p2 rootdelay=2
root_nfs=/mnt/nfs
set_root_nfs=setenv root_nfs root=/dev/nfs rw
nfsroot=${serverip}:${root_nfs}
ifconfig_static=run setenv ifconfig
ip=${ipaddr}:${serverip}::${netmask}:mini2440:eth0
ifconfig_dhcp=run setenv ifconfig ip=dhcp
ifconfig=ip=dhcp
set_bootargs_mmc=setenv bootargs ${bootargs_base} ${bootargs_init}
${mini2440} ${root_mmc}
set_bootargs_nand=setenv bootargs ${bootargs_base} ${bootargs_init}
${mini2440} ${root_nand}
set_bootargs_nfs=run set_root_nfs; setenv bootargs ${bootargs_base}
${bootargs_init} ${mini2440} ${root_nfs} ${ifconfig}
mtdids=nand0=mini2440-nand
mtdparts=mtdparts=mini2440-nand:0x00040000(u-boot),0x00020000(u-boot_env),0x0050
0000(kernel),0x07aa0000(rootfs)
ipaddr=192.168.1.45
gatewayip=192.168.1.1
bootcmd=nfs 0x31000000 192.168.1.42:/home/jdoe/nfs/kernel/uImage ; bootm
bootargs=console=ttySAC0,115200 root=/dev/nfs
nfsroot=192.168.1.42:/home/jdoe/nfs/fs rw ip=192.168.1.45 mini2440=0tb
partition=nand0,0
mtddevnum=0
mtddevname=u-boot

Setups I have tried:

1.) Mini2440 (uboot settings, Gateway: None) <--ETH Crossover--> PC (Static
IP: 192.168.1.40/42, Netmask: 255.255.255.0, Gateway: None)
Mini2440# ping 192.168.1.40 (host pc) : ping failed; host 192.168.1.40 is
not alive
Mini2440# ping 192.168.1.42 (guest pc/nfs server) : ping failed; host
192.168.1.42 is not alive

2.) Mini2440 (uboot settings, Gateway: 192.168.1.1) <--ETH Crossover-->
ROUTER <--ETH Crossover--> PC (Static IP: 192.168.1.40/42, Netmask:
255.255.255.0, Gateway: 192.168.1.1)
Mini2440# ping 192.168.1.40 (host pc) : ping failed; host 192.168.1.40 is
not alive
Mini2440# ping 192.168.1.42 (guest pc/nfs server) : ping failed; host
192.168.1.42 is not alive
Mini2440# ping 192.168.1.1 (router) : host 192.168.1.1 is alive

3.) Mini2440 (uboot settings, Gateway: None) <--ETH Crossover--> SWITCH
<--ETH Crossover--> PC (Static IP: 192.168.1.40/42, Netmask: 255.255.255.0,
Gateway: None)
Mini2440# ping 192.168.1.40 (host pc) : ping failed; host 192.168.1.40 is
not alive
Mini2440# ping 192.168.1.42 (guest pc/nfs server) : ping failed; host
192.168.1.42 is not alive

When the mini2440 is in ping mode and I send a ping from the host pc to
192.168.1.45 (Mini2440 ipaddr) I get a reply.
Also, when the mini2440 is in ping mode and I send a ping from the guest pc
to 192.168.1.45 (Mini2440 ipaddr) I get a reply.
To verify that its not fooling me, I also try and ping the mini2440 when
its not in ping mode and I do not get a reply, as it should be

So what the hell is going on, I honestly don't know.

Any advice will be appreciated

Thank you

davef
What do you mean by ping mode?

CU tomorrow.

bluscape
When I say ping mode it means when I've entered the ping command in uboot
(Mini2440# ping ipaddress).
Meaning that it brings up the ethernet interface for a short while, the
period in which it tries to ping.

davef
Mini2440 (uboot settings, Gateway: None) <--ETH Crossover--> SWITCH
<--ETH Crossover--> PC (Static IP: 192.168.1.40/42

I don't use cross-over cables for this situation.

I am running barebox, which is a later version of u-boot.

The mini2440 can ping the host, but the I can't ping the mini2440 from the
host or another PC.  My understanding that while in barebox bootloader mode
that this is normal.

Good luck

bluscape
Would you mind sharing your compiled binary for barebox?

Yes, that is what I'm trying to say when I referring to ping mode.
You can't ping the mini2440 in bootloader mode because the ethernet
interface is down. The only time the ethernet interface is up (in
bootloader mode) is when the mini itself is trying to ping something else.
Only then I can ping the mini, as it should be.

davef
It is from here:

http://www.oselas.org/oselas/bsp/pengutronix/mini2440_bsp_en.html

and compiled for the 64M.

If that is adequate I am sure I could send it in about 3 hours . . . going
out right now.

dave

davef
Will it meet your requirements?

bluscape
Hi dave,

Uhmmm, I wish you had a pre-compiled binary for the 128M. I don't have much
time to compile another bootloader myself.

But if you can't help it leaves me with no other choice. I've started
downloadinf the config scripts and toolchains from Oselas and is busy
reading the Quickstart PDF.

But if you could help me I will really appreciate it.

To be honest, I'm still a bit new to all the embedded linux stuff but is
slowly getting some ground beneath my feet.

I'm not sure if barebox will solve my ethernet problems, but I will still
be great if I have the latest and greatest bootloader.

Thanks

davef
Well, this BSP is the best thing since "sliced cheese".  Although, I
imagine that if I hadn't been through a lot of pain over the last year I
wouldn't really appreciate what a professional tool can provide.  And what
is really going on behind a build development tool.

Most of the guys use OE, at work, but still there is a lot of hard work
going into that to streamline our ARM development work.

I am trying to get Qt (Arora) going at the moment.  I have cross-compiled
(or should I say ticked the right boxes!) for iptables, tcpdump and thttpd.

Help will be there.

Dave

Dave Festing
I am running NFS on this system.  Here's a guide to getting NFS going.

Rename it as a .doc
 
Dave

bluscape
Cool!, I will definitely have look at all of this then.
Thanks for your help!

How is Qt Arora different from the standard Qt (4.6.2)?
Is your standard Qt at least running on PTX?

Dave Festing
Arora is a web browser that uses Qt, in this case (the supplied BSP) Qt
4.6.3

It's compiling at the moment. However, it is after midnight and I have work
tomorrow.

BFN,
dave

lzk90s
The same case i had meet with you ,when the u-boot is in ping mode and I
can send ping message from host pc to it, but when the u-boot is not in
ping mode , i can't send any ping message to it,  there is a explain about
why we must make the u-boot into ping mode , a function eth_halt( ) in
u-boot source codes, it shows each time when u-boot ping achieves, the
ethernet will be halt until next ping starts, so if you want to ping
mini2440 from, you must comfirm the u-boot is in ping mode or change the
source codes of ping , what's more , you can use nfs and tftp service even
though the ping module is not so good . I am a senior studnet in china ,
maybe my english is not so good, I hope you can get my main idea.

bluscape
Awesomeness!!! barebox solved this problem. I can ping the host and load
the kernel over nfs.

Thanks Dave

Juergen Beisert
bluescape,

if you really need only one component from the BSP (like the kernel or the
bootloader), you also can build only this one component instead of the
whole BSP (which may takes very long). For example to build the Barebox
bootloader only:

$ ptxdist targetinstall barebox

Or the kernel only

$ ptxdist targetinstall kernel

instead of the "ptxdist go". Hope it helps.

bluscape
Thanks Juergen,

I'll definitely keep that in mind.
What would I use to compile the rootfs (ptx) only?

Keep up the good work guys, this ptx/oselas distro is looking good and very
promising.

Juergen, may I ask what is your position at ptx/oselas?

MC

Juergen Beisert
bluscape,

as the root filesystem is "everything" there is only the "ptxdist go"
command. Nothing to short the build time here, sorry.

I'm one of the developers at PTX.

bluscape
I can boot my kernel over nfs but not my rootfs. 

If my /env/config settings is:

# can be either 'jffs2' or 'ubifs'
rootfs_type=jffs2
rootfsimage=root.${rootfs_type}

nfsroot="${eth0.serverip}:/home/jdoe/local/OSELAS.BSP-Pengutronix-Mini2440/
platform-mini2440/images

What is the bootloader trying to load for the rootfs,
root.jffs2 or is it looking for a root directory with all the rootfs
directories?

Just remember, I can boot my kernel over nfs but not my rootfs.

I export the following path on the server:

/home/jdoe/local/OSELAS.BSP-Pengutronix-Mini2440/platform-mini2440/images

The images directory contains:
-barebox-image
-linuximage
-root.jffs2
-root.tgz

I get the following error when trying to load the rootfs over nfs:

VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available
partitions:
1f00             512 mtdblock0  (driver?)
1f01             384 mtdblock1  (driver?)
1f02            2048 mtdblock2  (driver?)
1f03          128128 mtdblock3  (driver?)
b300         1931264 mmcblk0  driver: mmcblk
  b301           72261 mmcblk0p1
00000000-0000-0000-0000-000000000000mmcblk0p1
  b302          915705 mmcblk0p2
00000000-0000-0000-0000-000000000000mmcblk0p2
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(2,0)
Function entered at [<c002ab24>] from [<c02bbb4c>]
Function entered at [<c02bbb4c>] from [<c0008e8c>]
Function entered at [<c0008e8c>] from [<c0008f6c>]
Function entered at [<c0008f6c>] from [<c00090a8>]
Function entered at [<c00090a8>] from [<c0008ae8>]
Function entered at [<c0008ae8>] from [<c0026a1c>]

Juergen Beisert
bluscape.

replace your
"nfsroot="${eth0.serverip}:/home/jdoe/local/OSELAS.BSP-Pengutronix-Mini2440/
platform-mini2440/images"

by

"nfsroot="${eth0.serverip}:/home/jdoe/local/OSELAS.BSP-Pengutronix-Mini2440/
platform-mini2440/root"

and you are done.

The content of "images/" is intended to be written onto a SD card
(root.tgz) or into the onboard NAND (root.jffs2)

bluscape
What should the server export?

"nfsroot="${eth0.serverip}:/home/jdoe/local/OSELAS.BSP-Pengutronix-Mini2440/
platform-mini2440/images"

OR

"nfsroot="${eth0.serverip}:/home/jdoe/local/OSELAS.BSP-Pengutronix-Mini2440/
platform-mini2440/root"

davef
They have to be the same.

davef
Just a minute here . . . on the server you need:

in /etc/exports

/home/jdoe/local/OSELAS.BSP-Pengutronix-Mini2440/platform-mini2440/root
*(rw,no_root_squash,sync,no_subtree_check)

For the * you can put in a statically assigned address of the mini2440, if
you want.

I attached the doc way up the list.

davef
Any comments on the doc would be helpful.
Dave

bluscape
I've been following the doc but had no success with loading the rootfs over
nfs. Only mistake in the doc thus far is you typed:

/etc/export which should be /etc/exports

bluscape
To be honest, I've not been able to boot anything using using the
nfs-kernel-server. The only method with which I could at least boot the
kernel was this:

http://www.davidsudjiman.info/2006/03/27/installing-and-setting-tftpd-in...

davef
export/exports, that's a hoot!  Juergen said export I told him it should be
exports and then I write export!

If you do <netstat -uap> can you see the server running.  I was a
moderately painful process getting NFS running, but boy is it worth it.

Which desktop distro are you running?

bluscape
Ok, solved my problem.

Used the method in this link:

http://www.davidsudjiman.info/2006/03/27/installing-and-setting-tftpd-in...

Then I did the following:

1. Go to Synaptic Package Manager (Ubuntu)
2. Search for atftp
3. uncheck (uninstall) tftpd and check atftpd and atftp
4. then click on Apply button to install
5. sudo /etc/init.d/xinetd stop
6. sudo /etc/init.d/xinetd start
7. sudo /etc/init.d/xinetd restart

And its working!! Now I can load my rootfs over nfs.

davef
Great, now re-write the HowTo based on your installation!

Never read anything about atftp.  The other option to nfs-kernel-server is
nfs-user-server, but that wouldn't work for me.

What size mini2440 have you got?  Did you manage to get Arora working?

davef
"Hang on a minute".  I don't see any mention of NFS in atftp or do you mean
you couldn't get tftp to work, not NFS.

tftp loads the kernel and NFS loads the rootfs.

davef
Incorrect, not "loads the rootfs", but allows access to your root files on
the host.

bluscape
Exactly as you say. Didn't know the difference, but reading it makes sense.

kernel -> tftp was working
rootfs -> nfs was not working

I guess I could have solved it quicker if I realized the differences
earlier.
Now I can just see the advantages of running the rootfs over nfs, update
programs without having to reboot or having to copy them to some portable
media such as a SD card. Yipppeee.

Dave, my Qt is now working on ptx. I initially ticked the boxes for arora
but after a few compiles I disabled it because it took to long having to
compile all the webkit stuff which is not what I need right now. But I sure
will try to compile arora at some stage.

I even tried the qt transformed stuff which now enables me to run a Qt app
in landscape orientation on the standard 3.5" portrait LCD (T35) from
FriendlyARM.

davef
What size mini2440 do you have?

bluscape
I've got two 128M NAND, 3.5" display mini's, if that is what you are
asking.

One from FriendlyARM and another from Hiteg.

I'll soon get a 1G mini.

How is the SD card stuff going?
You must tell me how you configure barebox to load the kernel from SD.

davef
I have done it using u-boot, so it shouldn't be too much of a drama. I have
a script that will partition the SD card, now all I need are the magic
words in /env/config instead of <net> or <nand>.  I'll tell you when I get
it going.

OK, you would probably have no problems running Arora on a 128M machine, if
you ever wanted to.

That will be a 1G mini6410?

Dave

bluscape
No, 1G mini2440:

http://www.thaieasyelec.net/index.php/SBC-/-Embedded-OS/mini2440-TFT-3-5...

davef
Just for my information, why not the 6410? Or do you see it as another
potentially big learning curve.  

Trying to make up my own mind.

Thanks,
Dave

You can email dave underscore festing at hotmail dot com if you prefer to
discuss these off-forum.

Juergen Beisert
Barebox is prepared to work with an SD card. Plug it in, power your system
and enter "mci0.probe=1". This will detect the SD card and creates disk0.*
devices (according to the partition table on this SD card) in "dev/" to
have access to the data on it.
You can now download a kernel (for example) to write it to the SD card (if
not already done): "tftp my_own_kernel /dev/disk0.1". This will load the
"my_own_kernel" from your defined TFTP server and store it into the
_second_ partition of the SD card (if more than one partition exists on
your card). After that you can start this kernel with "bootm /dev/disk0.1".
The default Barebox's environment needs some adaptions to support automatic
boot from SD card instead of the NAND. Maybe I will add this into one of
the next BSP releases if I had time for it.

vijaya
Hi,

   I am also facing same problem with my board(P3041DS). Since last two
days it stopped pinging from my board to host. Anyone can help me. I have
looked all environment variables, all are fine. Is there any new cause for
ping fail.

Thanks,
Vijaya.