• Not Answered

OMAP-L138 NFS Boot Issue (U-boot env variable "ipaddr" not set)

OMAPL-138 experimenter kit

 I have followed the directions in the GSG (http://processors.wiki.ti.com/index.php/GSG:_Setting_up_OMAP-L1/AM1x_Target_File_System#Writing_a_Simple_Program_and_Running_it_on_the_EVM) and am having some trouble doing an NFS boot.  It seems that it has something to do with setting / not setting the 'ipaddr' variable in U-boot. I am eventually able to get the board to do the NFS boot by playing with the 'ipaddr' setting, but this is not mentioned anywhere in the GSG.  Can anyone see anything I am doing wrong here? This is my first go-round with U-boot so I may just be making some simple mistake.

(IP address of my board is 192.168.1.116;  IP of the Linux host is 192.168.1.104;  IP of my router is 192.168.1.254)

U-Boot > setenv nfshost 192.168.1.104

U-Boot > setenv rootpath /home/usr/smh/workdir/filesys

U-Boot > setenv serverip 192.168.1.104

U-Boot > setenv bootfile uImage

U-Boot > setenv bootcmd 'dhcp;tftp;bootm'

U-Boot >  setenv bootargs console=ttyS2,115200n8 noinitrd rw ip=dhcp root=/dev/nfs nfsroot=${nfshost}:${rootpath},nolock mem=32M

U-Boot > printenv

bootdelay=3

baudrate=115200

stdin=serial

stdout=serial

stderr=serial

ethaddr=00:08:ee:04:40:46

ethact=

ver=U-Boot 2009.01 (Sep 17 2009 - 17:41:56)

nfshost=192.168.1.104

rootpath=/home/usr/smh/workdir/filesys

serverip=192.168.1.104

bootfile=uImage

bootcmd=dhcp;tftp;bootm

bootargs=console=ttyS2,115200n8 noinitrd rw ip=dhcp root=/dev/nfs nfsroot=192.168.1.104:/home/usr/smh/workdir/filesys,nolock mem=32M

Environment size: 404/65532 bytes

 

U-Boot > boot

BOOTP broadcast 1

DHCP client bound to address 192.168.1.116

Using  device

TFTP from server 192.168.1.254; our IP address is 192.168.1.116

Filename 'uImage'.

Load address: 0xc0700000

Loading: T T T

.......I hit ^c here to abort since I know this always fails........

Abort

*** ERROR: 'ipaddr' not set

Wrong Image Format for bootm command

ERROR: can't get kernel image!

  •  Notice that the TFTP server address above is WRONG. It should end in 104. The 254 is the address of my  router.   ????
  • U-boot complains that 'Ipaddr' is not set. Should I have set this? Doing another printenv still displays as shown above.

So I set ipaddr to address of the Linux host and attempt another boot...

U-Boot > setenv ipaddr 192.168.1.104

U-Boot > boot

BOOTP broadcast 1

DHCP client bound to address 192.168.1.116

Using  device

TFTP from server 192.168.1.254; our IP address is 192.168.1.116

Filename 'uImage'.

Load address: 0xc0700000

Loading: T

 ... I hit ^C here to abort, but notice the TFTP address is still wrong...

 Abort

  ... U-boot automatically attempts again...

 Using  device

TFTP from server 192.168.1.104; our IP address is 192.168.1.104

Filename 'uImage'.

Load address: 0xc0700000

Loading: T

 ... I hit ^c here to abort. Notice that the TFTP address is now correct but the board address is now wrong...

Abort

 Wrong Image Format for bootm command

ERROR: can't get kernel image!

U-Boot >

 Notice that the TFTP and "our" address keep changing. This will happen each time I enter the "boot" cmd. If I play with setting  ipaddr i.e.  setenv ipaddr  <addr> to either the IP of my board  (192.168.1.116)  or to the IP of the TFTP server  (192.168.1.104) I am eventually able to get the kernel to load and boot successfully.

 Help. I am confused as to what is going on here.

 Regards,

    Scott

 

 

 

3 Replies

  • scott:

    ipaddr should be the IP address of the target board.

    setenv ipaddr 192.168.1.116

     

    Regards,

    Michael T

    PS: Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

  • Scott,

    Your bootcmd looks like it is a little redundant since the "dhcp" command does the DHCP to get IP addresses and then transfers the kernel image via TFTP.  So you don't need "dhcp;tftp".  You just need "dhcp".

    The value of serverip should be the IP address of the machine that is running the TFTP server.  In your setup, it looks like this should be 192.168.1.104.  This address (serverip) is the only one that needs to be set explicitly if are using the command "dhcp" in your bootcmd.  The reason for this is that "dhcp" will automatically set the value of ipaddr if the dhcp/tftp is successful.

    Try setting serverip and then run just "dhcp" by itself.  The "dhcp" command will set IP addresses and also transfer the uImage file via TFTP.  Then run printenv and see if the values of the other network settings are correct (like ipaddr).  The value of "ipaddr" is the IP address provide to the target board by the DHCP server.

    The IP address of the router doesn't really play into the process at all.  I am assuming that the router has a DHCP server that gave an IP address to the Linux host.

    Here is an example that I got from my OMAP3 EVM (different from yours, but similar concept).  Notice the difference in the environment variables before and after the "dhcp" command.  Here the IP address of my Linux host with TFTP server is 128.247.106.245 and the DHCP server of my network provided an ipaddr of 128.247.107.76 to the target EVM.

    OMAP3_EVM #
    OMAP3_EVM # pri
    bootdelay=10
    baudrate=115200
    loadaddr=0x82000000
    usbtty=cdc_acm
    mmcargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
    nandargs=setenv bootargs console=${console} root=/dev/mtdblock4 rw rootfstype=jffs2
    loadbootscript=fatload mmc 0 ${loadaddr} boot.scr
    bootscript=echo Running bootscript from mmc ...; source ${loadaddr}
    loaduimage=fatload mmc 0 ${loadaddr} uImage
    mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr}
    nandboot=echo Booting from nand ...; run nandargs; onenand read ${loadaddr} 280000 400000; bootm ${loadaddr}
    dieid#=6cc200040000000004035c141101800a
    ethact=smc911x-0
    bootcmd_original=if mmc init; then if run loadbootscript; then run bootscript; else if run loaduimage; then run mmcboot; else run nandboot; fi; fi; ei
    bootcmd=mmc init;run loaduimage;run mmcargs;bootm
    console=ttyS0,115200n8
    bootfile=uImage
    serverip=128.247.106.245
    stdin=serial
    stdout=serial
    stderr=serial

    Environment size: 958/131068 bytes
    OMAP3_EVM # dhcp
    smc911x: detected LAN9220 controller
    smc911x: phy initialized
    smc911x: MAC 00:50:c2:7e:8f:90
    BOOTP broadcast 1
    *** Unhandled DHCP Option in OFFER/ACK: 44
    *** Unhandled DHCP Option in OFFER/ACK: 46
    *** Unhandled DHCP Option in OFFER/ACK: 150
    *** Unhandled DHCP Option in OFFER/ACK: 44
    *** Unhandled DHCP Option in OFFER/ACK: 46
    *** Unhandled DHCP Option in OFFER/ACK: 150
    DHCP client bound to address 128.247.107.76
    Using smc911x-0 device
    TFTP from server 128.247.106.245; our IP address is 128.247.107.76
    Filename 'uImage'.
    Load address: 0x82000000
    Loading: #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #############################################################
    done
    Bytes transferred = 2308596 (2339f4 hex)
    OMAP3_EVM # pri
    bootdelay=10
    baudrate=115200
    loadaddr=0x82000000
    usbtty=cdc_acm
    mmcargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
    nandargs=setenv bootargs console=${console} root=/dev/mtdblock4 rw rootfstype=jffs2
    loadbootscript=fatload mmc 0 ${loadaddr} boot.scr
    bootscript=echo Running bootscript from mmc ...; source ${loadaddr}
    loaduimage=fatload mmc 0 ${loadaddr} uImage
    mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr}
    nandboot=echo Booting from nand ...; run nandargs; onenand read ${loadaddr} 280000 400000; bootm ${loadaddr}
    dieid#=6cc200040000000004035c141101800a
    ethact=smc911x-0
    bootcmd_original=if mmc init; then if run loadbootscript; then run bootscript; else if run loaduimage; then run mmcboot; else run nandboot; fi; fi; ei
    bootcmd=mmc init;run loaduimage;run mmcargs;bootm
    console=ttyS0,115200n8
    stdin=serial
    stdout=serial
    stderr=serial
    bootfile=uImage
    filesize=2339F4
    fileaddr=82000000
    gatewayip=128.247.106.2
    netmask=255.255.254.0
    ipaddr=128.247.107.76
    serverip=128.247.106.245
    dnsip=128.247.5.10

    Environment size: 1079/131068 bytes
    OMAP3_EVM #

  • In reply to gkturner:

    gkturner

    Scott,

    Your bootcmd looks like it is a little redundant since the "dhcp" command does the DHCP to get IP addresses and then transfers the kernel image via TFTP.  So you don't need "dhcp;tftp".  You just need "dhcp".

    After checking this out a bit I agree with you here. I was just following the instructions in the GSG verbatim. Someone might want to update that doc.

    gkturner

    The value of serverip should be the IP address of the machine that is running the TFTP server.  In your setup, it looks like this should be 192.168.1.104.  This address (serverip) is the only one that needs to be set explicitly if are using the command "dhcp" in your bootcmd.  The reason for this is that "dhcp" will automatically set the value of ipaddr if the dhcp/tftp is successful.

    Try setting serverip and then run just "dhcp" by itself.  The "dhcp" command will set IP addresses and also transfer the uImage file via TFTP.  Then run printenv and see if the values of the other network settings are correct (like ipaddr).  The value of "ipaddr" is the IP address provide to the target board by the DHCP server.

    The IP address of the router doesn't really play into the process at all.  I am assuming that the router has a DHCP server that gave an IP address to the Linux host.

    You are correct that the router/DHCP server( 192.168.1.254) has assigned the ip of the Linux host (192.168.1.104). I agree with you that this shouldn't play in this process.

    I tried your suggestion of just setting the serverip address and entering the "dhcp" command and got some interesting results...

    The "dhcp" command fails although the local ip has correctly been resolved to 192.168.1.116. Notice that the displayed TFTP server address is incorrect. It displays as 192.168.1.254 which is my router / DHCP server.  Next I try an "tftpboot" command and it fails because the ipaddr is not set, presumably because the previous "dhcp" command failed. I then manually set the ipaddr to 192.168.1.116 and re-issue the "tftp" command, which now  works. I have listed this scenario below:  (sorry about the spacing, can't seem to get the extra line feeds out)

    U-Boot > setenv serverip 192.168.1.104

    >U-Boot > dhcp

    BOOTP broadcast 1

    DHCP client bound to address 192.168.1.116

    Using  device

    TFTP from server 192.168.1.254; our IP address is 192.168.1.116

    Filename 'uImage'.

    Load address: 0xc0700000

    Loading: *

    Abort     **************** I hit ^c here ***************************************

    U-Boot > tftp

    *** ERROR: `ipaddr' not set

    U-Boot > setenv ipaddr 192.168.1.116

    U-Boot > tftp

    Using  device

    TFTP from server 192.168.1.104; our IP address is 192.168.1.116

    Filename 'uImage'.

    Load address: 0xc0700000

    Loading: #################################################################

             #################################################################

             #################################################################

       done

    Bytes transferred = 2113744 (2040d0 hex)

    ***************** Notice that the  printenv below now shows the other network addresses (like dnsip) *********************

    U-Boot > pri

    bootargs=mem=32M console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0xc1180000,4M ip=off

    bootcmd=sf probe 0;sf read 0xc0700000 0x80000 0x200000;sf read 0xc1180000 0x280000 0x300000;bootm 0xc0700000

    bootdelay=3

    baudrate=115200

    stdin=serial

    stdout=serial

    stderr=serial

    ethaddr=00:08:ee:04:40:46

    ethact=

    ver=U-Boot 2009.01 (Sep 17 2009 - 17:41:56)

    bootfile=uImage

    filesize=2040D0

    fileaddr=C0700000

    ipaddr=192.168.1.116

    serverip=192.168.1.104

    dnsip=192.168.1.254

    Environment size: 456/65532 bytes

    ******************* DHCP command still fails, still shows wrong TFTP server***********************************************

    U-Boot > dhcp

    BOOTP broadcast 1

    DHCP client bound to address 192.168.1.116

    Using  device

    TFTP from server 192.168.1.254; our IP address is 192.168.1.116

    Filename 'uImage'.

    Load address: 0xc0700000

    Loading: *

    Abort

    U-Boot >

     

    Seems to me that the issue here is the incorrect setting of the TFTP server address displayed in the "dhcp" command. Any thoughts?

    -Scott