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.

how to configure uEnv.txt in SD card to boot from nfs filesystem after powered on?

Hi,everyone!

     I want to modify the uEnv.txt in sd card to boot my beaglebone from sd card and mount nfs filesystem?

    I modified uEnv.txt as follow:

   bootargs=console=ttyo0,115200n8 root=/dev/nfs 

nfsroot=192.168.1.27:/opt/ti-sdk-am335x-evm/targetNFS rw noinitrd ip=192.168.1.100:192.168.1.27:192.168.1.1:255.255.255.0

ipaddr=192.168.1.100

serverip=192.168.1.27

netmask=255.255.255.0

ethaddr=00:08:ee:05:4d:7e

autoload=no

bootdelay=3

bootcmd=tftp 0x81000000 uImage-am335x;bootm 0x81000000

then, I powered my board on, it will boot from sd card and mount filesystem in mmc  not the nfs nfs filesystem .

so ,I have to manually do something in u-boot:

#mmc rescan

#fatload mmc 0 0x81000000 uEnv.txt

#env import -t 0x81000000 $filesize

#boot

then, I can now mount nfs filesystem.

why the uEnv.txt in sdcard don't function? What's the right uEnv.txt to mount nfs filesystem?

  • when I run the script setup-uboot-env.sh,and get the uEnv.txt as follows:
    serverip=192.168.1.27
    rootpath=/opt/ti-sdk-am335x-evm/targetNFS
    bootfile=uImage-am335x-evm.bin
    ip_method=dhcp
    tftp_nfs_boot=echo Booting from network...; dhcp ${loadaddr} ${bootfile}; run net_args; bootm ${loadaddr}
    uenvcmd=run tftp_nfs_boot But , after powered on my beaglebone, the uboot cann't read uImage-am335x-evm.bin
    U-Boot 2011.09 (Nov 04 2011 - 21:39:19)

    I2C: ready
    DRAM: 256 MiB
    WARNING: Caches not enabled
    No daughter card present
    NAND: HW ECC Hamming Code selected
    nand_get_flash_type: unknown NAND device: Manufacturer ID: 0x11, Chip ID: 0x11
    No NAND device found!!!
    0 MiB
    MMC: OMAP SD/MMC: 0
    *** Warning - readenv() failed, using default environment

    Net: cpsw
    Hit any key to stop autoboot: 0
    SD/MMC found on device 0
    reading uEnv.txt

    250 bytes read
    Loaded environment from uEnv.txt
    Importing environment from mmc ...
    Running uenvcmd ...
    " not definedtp_nfs_boot
    reading uImage-am335x-evm.bin

    " from mmc 0:1 ** "uImage-am335x-evm.bin
    Booting from nand ...

    no devices available
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    U-Boot#
  • It seems like the Image is corrupted.

    Conform that the uimage is loading to $loadaddress (in am335x Evm it is 0x82000000) and booting from the same address.

  • Some guesses as I've been lucky to have env vars in NAND or SPI flash on all my platforms. Never had to use uEnv.txt or boot.scr myself.

    In the first case where you defined your own uEnv.txt, I believe bootcmd is effectively read-only. I think that is because bootcmd itself is being executed to read uEnv.txt. Odds are the default version of bootcmd will eventually do something like "run mmcboot" and overwrite your uEnv.txt values. It will also "run uenvcmd". You need to define the uenvcmd to short circuit and override the rest of the bootcmd logic. Your uEnv.txt file would be:

    bootargs=console=ttyo0,115200n8 root=/dev/nfs nfsroot=192.168.1.27:/opt/ti-sdk-am335x-evm/targetNFS rw noinitrd ip=192.168.1.100:192.168.1.27:192.168.1.1:255.255.255.0
    ipaddr=192.168.1.100
    serverip=192.168.1.27
    netmask=255.255.255.0
    ethaddr=00:08:ee:05:4d:7e
    autoload=no
    bootdelay=3
    uenvcmd=tftp 0x81000000 uImage-am335x;bootm 0x81000000

    In the second case with setup-uboot-env.sh, I am guessing that the script is not generating the correct uEnv.txt for your boot scenario of static IP, TFTP and boot. The error message looks to be truncated by your terminal program. I am guessing some symbol required by "run netarg" has not been defined int the uEnv.txt.