This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Booting with NFS about DM8168 failure

I had been  booting my DM8168 evm from  NFS, but it failed. The output form minicom is that:

"

IP-Config: Complete:                                                                                                               
     device=eth0, addr=192.168.2.16, mask=255.255.255.0, gw=192.168.2.1,                                                           
     host=xavier, domain=, nis-domain=(none),                                                                                      
     bootserver=192.168.2.15, rootserver=192.168.2.15, rootpath=                                                                   
PHY: 0:01 - Link is Up - 100/Full                                                                                                  
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              64 mtdblock0  (driver?)                                                                                          
1f02              64 mtdblock2  (driver?)                                                                                          
1f04            2432 mtdblock4  (driver?)                                                                                          
1f05             128 mtdblock5  (driver?)                                                                                          
1f06            4352 mtdblock6  (driver?)                                                                                          
1f07          204928 mtdblock7  (driver?)                                                                                          
1f08           50304 mtdblock8  (driver?)                                                                                          
b300         3887104 mmcblk0  driver: mmcblk                                                                                       
  b301           40131 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1                                                        
  b302         3839535 mmcblk0p2 00000000-0000-0000-0000-000000000mmcblk0p2                                                        
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)                                                     
Backtrace:                                                                                                                         
[<c0046b44>] (dump_backtrace+0x0/0x110) from [<c0364b48>] (dump_stack+0x18/0x1c)                                                   
 r7:c4812000 r6:00000000 r5:c002c014 r4:c04d9110                                                                                   
[<c0364b30>] (dump_stack+0x0/0x1c) from [<c0364bac>] (panic+0x60/0x17c)                                                            
[<c0364b4c>] (panic+0x0/0x17c) from [<c0009254>] (mount_block_root+0x1e0/0x220)                                                    
 r3:00000000 r2:00000000 r1:c4825f58 r0:c041a99c                                                                                   
[<c0009074>] (mount_block_root+0x0/0x220) from [<c0009340>] (mount_root+0xac/0xcc)                                                 
[<c0009294>] (mount_root+0x0/0xcc) from [<c00094d0>] (prepare_namespace+0x170/0x1d4)                                               
 r4:c04d8a24                                                                                                                       
[<c0009360>] (prepare_namespace+0x0/0x1d4) from [<c0008784>] (kernel_init+0x114/0x154)                                             
 r5:c0008670 r4:c04d89c0                                                                                                           
[<c0008670>] (kernel_init+0x0/0x154) from [<c006aeec>] (do_exit+0x0/0x5e4)                                                         
 r5:c0008670 r4:00000000

"

and my env config is

"

TI8168_EVM#print
bootdelay=3
baudrate=115200
verify=yes
ramdisk_file=ramdisk.gz
loadaddr=0x81000000
script_addr=0x80900000
loadbootscript=fatload mmc 1 ${script_addr} boot.scr
bootscript= echo Running bootscript from MMC/SD to set the ENV...; source ${script_addr}
ethaddr=90:d7:eb:96:46:6a
ethact=DaVinci EMAC
autoload=no
nfsserver=192.168.2.15
addip=setenv bootargs ${bootargs} ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off
bootfile=uImage
serverip=192.168.2.15
dnsip=202.188.0.133
dnsip2=202.188.1.5
ipaddr=192.168.2.16
netmask=255.255.255.0
gatewayip=192.168.2.1
hostname=xavier
bootargs=console=ttyO2,115200n8 root=/dev/nfs nfsroot=192.168.2.15:/home/administrator/targetfs,nolock rw mem=128M
rootdelay=4
stdin=serial
stdout=serial
stderr=serial
ver=U-Boot 2010.06 (Oct 27 2011 - 16:20:31)
bootcmd=run addip; tftp 81000000 uImage;bootm

Environment size: 849/8188 bytes

"

which is generated following "DM816x C6A816x AM398x PSP U-Boot.pdf"

i see the post "Problem On Booting with NFS about DM8168",and set rootdelay=4, it does not work ...

How can I solve it ,please help me .Thanks.

  • Hi Xavier,

    Make sure that static ip what you provide is assined to your board and check whether nfs server is running or not?

    Or else you try with tftp boot (dynamic ip)

    Steps as follows:-

    1. Clear variables
      1. set dnsip
      2. set dnsip2
      3. set ipaddr
      4. set gatewayip
    2. Set below variables
      1. set bootargs "console=ttyO2,115200n8 mem=128M noinitrd rw root=/dev/nfs nfsroot=192.168.2.15:/home/administrator/targetfs,nolock ip=dhcp rootdelay=3"
      2. set bootcmd "dhcp;tftp 81000000 uImage;bootm"
      3. set serverip 192.168.2.15

    Regards

    AnilKumar

    --------------------------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    ---------------------------------------------------------------------------------------------------------------------------

     

  • Hi Xavier,

    Check your target file system is exported

    host $ vim /etc/exports
    /home/administrator/targetfs *(rw,no_root_squash,no_all_squash,sync)


    NFS server is up and running
    host $ /usr/sbin/exportfs -av
    host $ /sbin/service nfs restart

    Verify that the server firewall is turned off:

    host $ /etc/init.d/iptables status
    If the firewall is running, disable it:

    host $ /etc/init.d/iptables stop

    Once u-boot is up, try ping command to ping your host IP.

    Thanks!!

    Regards
    Sathish

  • Thank you for your reply!

    I test my nfs by "mount localhost:home/administrator/targetfs /mnt",

    "ls /mnt", it runs well. Dose this verfiies that NFS works normal?

    and I do not open the firewall at all.

    No iptables file in /etc

  • Hi AnilKumar

       Thank your for your answer. I tried your two steps.And the result is the same ,

    IP-Config: Complete:
         device=eth0, addr=192.168.2.16, mask=255.255.255.0, gw=192.168.2.2,
         host=xavier, domain=, nis-domain=(none),
         bootserver=192.168.2.15, rootserver=192.168.2.15, rootpath=
    Waiting 4sec before mounting root device...
    PHY: 0:01 - Link is Up - 100/Full
    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             256 mtdblock0  (driver?)
    1f01               8 mtdblock1  (driver?)
    1f02            2560 mtdblock2  (driver?)
    1f03            1272 mtdblock3  (driver?)
    1f04            2432 mtdblock4  (driver?)
    1f05             128 mtdblock5  (driver?)
    1f06            4352 mtdblock6  (driver?)
    1f07          204928 mtdblock7  (driver?)
    1f08           50304 mtdblock8  (driver?)
    b300         3887104 mmcblk0  driver: mmcblk
      b301           40131 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1
      b302         3839535 mmcblk0p2 00000000-0000-0000-0000-000000000mmcblk0p2
    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
    Backtrace:
    [<c0046b44>] (dump_backtrace+0x0/0x110) from [<c0364b48>] (dump_stack+0x18/0x1c)
     r7:c4812000 r6:00000000 r5:c002c014 r4:c04d9110
    [<c0364b30>] (dump_stack+0x0/0x1c) from [<c0364bac>] (panic+0x60/0x17c)
    [<c0364b4c>] (panic+0x0/0x17c) from [<c0009254>] (mount_block_root+0x1e0/0x220)
     r3:00000000 r2:00000000 r1:c4825f58 r0:c041a99c
    [<c0009074>] (mount_block_root+0x0/0x220) from [<c0009340>] (mount_root+0xac/0xcc)
    [<c0009294>] (mount_root+0x0/0xcc) from [<c00094d0>] (prepare_namespace+0x170/0x1d4)
     r4:c04d8a24
    [<c0009360>] (prepare_namespace+0x0/0x1d4) from [<c0008784>] (kernel_init+0x114/0x154)
     r5:c0008670 r4:c04d89c0
    [<c0008670>] (kernel_init+0x0/0x154) from [<c006aeec>] (do_exit+0x0/0x5e4)
     r5:c0008670 r4:00000000

    I guess Is there any problem with the nfs sever?  How can i know that nfs server is running or not?

    Before i used the follow cmd to test my nfs server:

    sudo mount localhost:/mydir /mmt

    sudo ls /mmt

    mydir will mount in mnt folder.

  • Hi Xavier,

    Follow this wiki page and make sure that NFS is working.

    http://processors.wiki.ti.com/index.php/GSG:_OMAP35x_DVEVM_Software_Setup#Exporting_a_Shared_File_System_for_Target_Access

    Regards

    AnilKumar

    --------------------------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    ---------------------------------------------------------------------------------------------------------------------------

  • Xavier,

    If your host is ubuntu then please follow these steps to disable iptables.
    https://help.ubuntu.com/community/IptablesHowTo#Disabling_the_firewall

    Thanks!!

    Regards
    Sathish

  • I closed the firewall refered by the website "https://help.ubuntu.com/community/IptablesHowTo#Disabling_the_firewall"

    however it does not work. I think if i have to rebuild the uImage by myself, the uImage in EZSDK5.02 /pre-built images can not be used in the NFS boot?

     

     

     

     

  • Hi Xavier,

    The pre-built image can be used for NFS boot. Did you try ping command from u-boot??
    Try to ping your linux host machine IP from u-boot, let me know the results.

    Thanks!!

    Regards
    Sathish

  • Sathish,

    I ‘ve tried ping command from u-boot, it's ok. The tftp server and the NFS server have the same ip address in my development environment

    I found this post in the forum “http://e2e.ti.com/support/dsp/integra_dsparm/f/625/p/107894/381157.aspx#381157”, very similar problem,

    and i tried their solutions,however it still doesn't works...

    Thanks!!

    Regards
    xavier

  • Is there any other ideas?

  • Hi Xavier,

    If you are able to ping host PC from u-boot then there is no network issue.
    I had seen similar issue with other customer, who are not having DHCP server.

    When you used setup.sh, it internally calls the setup-uboot-env.sh, in which ip=dhcp for NFS boot.
    When ip=dhcp is set then DHCP server should be running inside the router to obtain IP address dynamically.

    Thanks!!

    Regards
    Sathish

  • Hi Sathish,

    Thank you for your reply. I have both the static ip and the dynamical IP for EVM board. When i use DHCP , I connect my EVM board and PC through a router,so DHCP server is running. Actually ,the EVM board get ip address.I also used dhcp command in environment  various “bootcmd”

    setenv  bootcmd “run addip; tftp 81000000 uImage;bootm ”

    I google this problem "

    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: "

    most situation is that 

    1)the network issue

    2)NFS config error

    3)firewall

    I have check for many times。

    ping cmd tells network issue is unexit。

    i use ”mount localhost:/targetfs /mnt “together with “netstat -a|grep nfs”  to check if NFS run normal 

    the firewall you said , i close the iptable,

     

    when static ip is used ,my environment various set like follows:

    TI8168_EVM#print 
    bootdelay=3 
    baudrate=115200 
    verify=yes 
    ramdisk_file=ramdisk.gz 
    loadaddr=0x81000000 
    script_addr=0x80900000 
    loadbootscript=fatload mmc 1 ${script_addr} boot.scr 
    bootscript= echo Running bootscript from MMC/SD to set the ENV...; source ${script_addr} 
    ethaddr=90:d7:eb:96:46:6a 
    ethact=DaVinci EMAC 
    autoload=no 
    nfsserver=192.168.2.15 
    addip=setenv bootargs ${bootargs} ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off 
    bootfile=uImage 
    serverip=192.168.2.15 
    ipaddr=192.168.2.16 
    netmask=255.255.255.0 
    hostname=xavier 

    rootdelay=4 
    bootcmd=run addip; tftp 81000000 uImage;bootm 
    gatewayip=192.168.2.2 
    rootpath=/home/administrator/targetfs 
    bootargs=console=ttyO2,115200n8 root=/dev/nfs nfsroot=${nfsserver}:${rootpath},nolock rw mem=128M rootdelay=4 

    stdin=serial 
    stdout=serial 
    stderr=serial 
    ver=U-Boot 2010.06 (Oct 27 2011 - 16:20:31) 

    I see something interesting,in DM816x_AM389x_PSP_User_Guide

    http://processors.wiki.ti.com/index.php/DM816x_AM389x_PSP_User_Guide#Updating_the_DHCP_Script

    maybe i can  try later.

    when i see 

    http://processors.wiki.ti.com/index.php/DM816x_AM389x_PSP_User_Guide#Boot_over_Network_.28Ethernet.29

    i have a question that should i set the kernerl ip address which i think is different form u-boot address?

    best regards

    xavier

  • Hi Xavier,

    Please note, your EVM should have an IP address to communicate with TFTP server to get Kernel Image. You can get that in two ways

    Use DHCP
    U-Boot> setenv autoload no
    U-Boot> dhcp

    Use static IP address
    U-Boot> setenv ipaddr <static ip address>

    In your case, static IP is set.
    For kernel, (bootargs) we use "ip=xxx" this parameter tells the kernel how to configure IP addresses of devices and also how to set up the IP routing table.
    In your case ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off 
    The most common way to use this is "ip=dhcp".

    So as Anil mentioned earlier 

    1. Clear variables
      1. set dnsip
      2. set dnsip2
      3. set ipaddr
      4. set gatewayip
    2. Set below variables
      1. setenv serverip <tftp-server-ip>
      2. setenv nfsserver <nfs-server-ip>
      3. setenv rootpath  /home/administrator/targetfs
      4. set bootcmd "dhcp;tftp 81000000 uImage;bootm"
      5. set bootargs "console=ttyO2,115200n8 mem=128M noinitrd rw root=/dev/nfs nfsroot=${nfsserver}:${rootpath}, nolock  ip=dhcp rootdelay=3" 

    Thanks!!

    Regards
    Sathish

     

  • Hi Sathish,

    I have made a mistake that 

    "addip=setenv bootargs ${bootargs} "and "ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off " are two parts of addip,

    actually, they are  on the same line.

    addip=setenv bootargs ${bootargs} ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off ,

     

    I learn the environment various setting form "DM816x_AM389x_PSP_U-Boot"

    http://processors.wiki.ti.com/index.php/DM816x_AM389x_PSP_U-Boot#U-Boot_Network_configuration 

    it use dhcp to get ip address,

    1.In case you want to have the kernel use the same ip as that assigned to U-Boot

    TI8168_EVM# print ethaddr                          									<-- Check if MAC address is assigned and is unique
    TI8168_EVM# setenv ethaddr <unique-MAC-address>    						<-- Set only if not present already, format uv:yy:zz:aa:bb:cc
    TI8168_EVM# setenv bootcmd 'dhcp;run addip; tftp 81000000 uImage;bootm'
    TI8168_EVM# setenv hostname <unique-hostname>
    TI8168_EVM# setenv addip 'setenv bootargs ${bootargs} ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off'
    TI8168_EVM# setenv autoload no
    TI8168_EVM# setenv nfsserver <NFS server-ip>         						<-- Make sure the same NFS server IP is used below
    TI8168_EVM# setenv bootargs 'console=ttyO2,115200n8 root=/dev/nfs nfsroot=<NFS server-ip>:<NFS share>,nolock rw mem=128M'      
    TI8168_EVM# setenv serverip <tftp-server-ip>
    

    2.In case you want to use dhcp for getting an IP when the kernel boots up

    TI8168_EVM# print ethaddr                          									<-- Check if MAC address is assigned and is unique
    TI8168_EVM# setenv ethaddr <unique-MAC-address>    						<-- Set only if not present already, format uv:yy:zz:aa:bb:cc
    TI8168_EVM# setenv bootcmd 'dhcp;tftp 81000000 uImage;bootm'
    TI8168_EVM# setenv autoload no
    TI8168_EVM# setenv nfsserver <NFS server-ip>         						<-- Make sure the same NFS server IP is used below
    TI8168_EVM# setenv bootargs 'console=ttyO2,115200n8 root=/dev/nfs nfsroot=<NFS server-ip>:<NFS share>,nolock rw mem=128M ip=dhcp'      
    TI8168_EVM# setenv serverip <tftp-server-ip>

    And i choose  the first method to configure environment various, and it coms the result that the uImage download well, except the NFS filesystem unable to mount, minicom print :

    VFS: Unable to mount root fs via NFS, trying floppy.                                                                                

    VFS: Cannot open root device "nfs" or unknown-block(2,0)                      

    so i use static ip ,just like you  see in my  environment various. Just                       

    TI8168_EVM# setenv bootcmd 'dhcp;run addip; tftp 81000000 uImage;bootm' becomes
    TI8168_EVM# setenv bootcmd 'run addip; tftp 81000000 uImage;bootm'  without dhcp
    Also bootargs=console=ttyO2,115200n8 root=/dev/nfs nfsroot=${nfsserver}:${rootpath},nolock rw mem=128M rootdelay=4 changed a little.
    Mybe i can try the second way you referred before.Can you find any problem with the first way?
    
    
    Regards
    Xavier

  • Hi all guys,

    Thank you for your help! Finally i found the problem how the NFS cann't mount file system.

    The reason is that ${nfsserver}:${rootpath} can not replaced with 192.168.2.15:/home/administrator/targetfs in the env various bootargs


    bootargs=console=ttyO2,115200n8 root=/dev/nfs nfsroot=${nfsserver}:${rootpath},nolock rw

     

    I don't kown why ${nfsserver}:${rootpath} does not works? I think maybe the uboot can not support this script

    Actually , the Evm board do have two ip address, one is used by u-boot, the other is used by kernel.

    The ip addresses can be either   the same or different.

    when static ip used

    you have to set u-boot ip address by mannul,

    like

    setenv ipaddr 192.168.1.109

    setenv netmask 255.255.255.0

    setenv ipaddr 192.168.1.109

    setenv netmask 255.255.255.0

    setenv gatewayip 192.168.1.1

    setenv gatewayip 192.168.1.1

    and no dhcp used any longer...

    the key point is that do remember to set kernel ip, at the end of bootargs

    set bootargs "console=ttyO2,115200n8 mem=128M  rw root=/dev/nfs nfsroot=${nfsserver}:${rootpath}, nolock  ip=192.168.1.123"

    the whole form to set ip is

    ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
    eg:
    ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off,

    off means :don't use autoconfiguration (do static IP assignment instead)

    of course you can use dhcp
    eg:

    set bootargs "console=ttyO2,115200n8 mem=128M  rw root=/dev/nfs nfsroot=${nfsserver}:${rootpath}, nolock  ip=dhcp" to set kernel ip

    In my env various, addip and run addip is used to set kernel ip.

    setenv addip 'setenv bootargs ${bootargs} ip=${ipaddr}:${nfsserver}:${gatewayip}:${netmask}:${hostname}:eth0:off'

    bootcmd = run addip; tftp 81000000 uImage; bootm

    if dhcp is us used for u-boot ,this can be set like


    bootcmd =dhcp; run addip; tftp 81000000 uImage; bootmhttp://processors.wiki.ti.com/index.php/DM816x_AM389x_PSP_User_Guide

    in http://processors.wiki.ti.com/index.php/DM816x_AM389x_PSP_User_Guide

    Thank you again!

    Regards
    xavier






  • Hi Xavier

    VFS: Unable to mount root fs via NFS, trying floppy.      

    THis means It can't find the path to your NFS folder                                                                         

    VFS: Cannot open root device "nfs" or unknown-block(2,0

    Your problem could be a few issues so check the following:

    1. Your nfs Path usualy  is nfsroot=xxx.xxx.xxx.xxx:/home/(username)/targetfs , where the xxx.xxx.xxx.xxx is the IP address of the host nfs server. make sure your root path above has a "/" forward slash in front  and that the full path matches the settings you used in ./setup.sh in the SDK folder. start with dhcp bootup , I don't know if you can use $(KEYPATHS) in U-Boot.

    2. the setting for DHCP sould be setup as ip=dhcp but should not be there if you are using static

    3. the rootdelay above should be bootdelay, unless I'm mistaken this should nott affect anything

    Robin