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.

Linux/AM3358: TFTP boot fails

Part Number: AM3358

Tool/software: Linux

Hello,

Just starting with TI Processor SDK with the following system Setup:

  • TI SDK     : linux-am335x-evm-04.02.00.09-Linux-x86
  • Machine    : Ubuntu 16.04 (native 64-bit)  @ IP: 192.168.1.86 (DHCP)
  • Dev Board  : BeableBone Black, Rev C.      @ IP: 192.168.1.68  (DHCP)
  • Gateway    :                               @ IP: 192.168.1.1

Following the on line instructions setup by step:

  1. Configured the Linux Host,including all the required packages, and  the linaro-6.2.1 tool chain.
  2. Installed the SDK
  3. Created a SD Card using the SDK Create SD Card Scrip
  4. Configured the development environment (USB Mini, FTDI Serial, Ehthernet)
  5. Used the SD Card to boot the target board (deleted the BBBlack eMMC)
  6. Run the Setup Script
  7. Rebuilt the sources using the top-level makefile in the SDK root directory.
  8. Verified that the TFTP Server is running and accessible from the LAN (using Windows 7 TFTP Client)   

I suspect the issue is in having wrong boot arguments passed to U-Boot on the SD.

  1. I'm not sure if the uEnv.txt was ever created, and
  2. why TFTP from server 192.168.1.1 (the Gateway) instead of 192.168.1.86 (the Ubuntu Machine)

On the minicom console I get the following output:

Welcome to minicom 2.7

OPTIONS: I18n
Compiled on Feb  7 2016, 13:37:27.
Port /dev/ttyUSB0, 12:38:00

Press CTRL-A Z for help on special keys


U-Boot SPL 2017.01-g340fb36f04 (Dec 23 2017 - 10:20:13)
Trying to boot from MMC1
reading uboot.env
reading u-boot.img
reading u-boot.img
reading u-boot.img
reading u-boot.img


U-Boot 2017.01-g340fb36f04 (Dec 23 2017 - 10:20:13 -0500)

CPU  : AM335X-GP rev 2.1
Model: TI AM335x BeagleBone Black
DRAM:  512 MiB
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
reading uboot.env
Net:   cpsw, usb_ether
Hit any key to stop autoboot:  0
reading uEnv.txt
** Unable to read file uEnv.txt **
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
DHCP client bound to address 192.168.1.68 (5 ms)
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.1; our IP address is 192.168.1.68
Filename 'am335x-boneblack.dtb'.
Load address: 0x82000000
Loading: T T T T T T T T T T T T T T T T T T T T
Retry count exceeded; starting again
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.1; our IP address is 192.168.1.68
Filename 'am335x-boneblack.dtb'.
Load address: 0x88000000
Loading: T T T T T T T T T T T T T T T T T T T T
Retry count exceeded; starting again

 

Thank you in advance,

ZGy

  • Sounds if you stop the booting in U-Boot console and enter => setenv serverip 192.168.1.86 your board will boot.

  • Hi Kemal,

    it does not boot!

    The U-Boot responds to a ping commands, so the network connection must be fine.

    I have already tried stopping at the U-Boot console and sending all the commands listed below)
    (from the setup auto-generated "../bin/setupBoard.minicom" file )

    setenv serverip 192.168.1.86
    setenv ipaddr 192.168.1.68
    setenv rootpath '/home/ZGy/Projects/beaglebone-r--.--/linux-sdk-04.02/targetNFS'
    setenv bootfile am335x-boneblack.dtb
    setenv nfsopts 'nolock,v3,tcp,rsize=4096,wsize=4096'
    setenv getuenv 'if mmc rescan; then if run loadbootenv; then run importbootenv; fi; fi;'
    setenv bootcmd 'run findfdt; run getuenv; setenv autoload no;dhcp ;tftp ${loadaddr} am335x-boneblack.dtb; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}'
    saveenv
    boot

    I'm not sure if the uEnv.txt file was at all created (assuming contains the boot arguments). If it was, do you know where it gets saved?

    ZGy

  • Has the TFTP from server 192.168.1.1 message changed to TFTP from server 192.168.1.86?
    Please, read this post regarding uEnv.txt creation and this regarding how and where it gets saved.

  • Nothing changes, it still does the same thing and prints the same message "TFTP from server 192.168.1.1".

    Now I know for sure that the uEnv.txt file does not get created - so I stopped looking for it.
  • Yes, see this messages "reading uboot.env" and this "reading uEnv.txt ** Unable to read file uEnv.txt **". You have uboot.env and no uEnv.txt.
    Can you copy the attached

    serverip=192.168.1.86
    ipaddr=192.168.1.68
    
    to your SD card's boot partition rename it to uEnv.txt and see what will happen?

  • I could see the messages, but was not sure why the file uEnv.txt, as per the on-line in instructions, was not there.
    The "uboot.env" file gets created only when I issue a "saveenv" command from the console. It did not exist before then.
    I copied the file "7776.uEnv.txt" to the SD, renamed it to "uEnv.txt". U-Boot finds and reads it, but there is no change in the behavior.

  • Can you post all your U-Boot environment variables (=> printenv)? Seems there is a condition which overrides serverip.

  • arch=arm
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUI
    D=${uuid} rw rootfstype=${mmcrootfstype}
    baudrate=115200
    board=am335x
    board_name=A335BNLT
    board_rev=00C0
    board_serial=3917BBBK1439
    boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefi
    x}${script}; source ${scriptaddr}
    boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ef
    i/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${f
    dt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
    boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr}
    ${prefix}extlinux/extlinux.conf
    boot_fdt=try
    boot_fit=0
    boot_net_usb_start=usb start
    boot_prefixes=/ /boot/
    boot_script_dhcp=boot.scr.uimg
    boot_scripts=boot.scr.uimg boot.scr
    boot_targets=mmc0 legacy_mmc0 mmc1 legacy_mmc1 nand0 pxe dhcp
    bootcmd=run findfdt; run getuenv; setenv autoload no;dhcp ;tftp ${loadaddr} am33
    5x-boneblack.dtb; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - $
    {fdtaddr}
    bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp};
    then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfi
    le}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi;
    setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_
    vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr
    _r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; t
    hen bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtc
    ontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_ar
    ch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
    bootcmd_legacy_mmc0=setenv mmcdev 0; setenv bootpart 0:2 ; run mmcboot
    bootcmd_legacy_mmc1=setenv mmcdev 1; setenv bootpart 1:2 ; run mmcboot
    bootcmd_mmc0=setenv devnum 0; run mmc_boot
    bootcmd_mmc1=setenv devnum 1; run mmc_boot
    bootcmd_nand=run nandboot
    bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
    bootcount=14
    bootdelay=2
    bootdir=/boot
    bootenvfile=uEnv.txt
    bootfile=am335x-boneblack.dtb
    bootm_size=0x10000000
    bootpart=0:2
    bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
    console=ttyO0,115200n8
    cpu=armv7
    dfu_alt_info_emmc=rawemmc raw 0 3751936
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x1
    00;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw ra
    w 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;spl-os-args fat 0 1;spl-os-ima
    ge fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
    dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.bac
    kup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part
    0 9
    dfu_alt_info_ram=kernel ram 0x80200000 0x4000000;fdt ram 0x80f80000 0x80000;ramd
    isk ram 0x81000000 0x4000000
    distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
    efi_dtb_prefixes=/ /dtb/ /dtb/current/
    envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmc
    dev};if run loadbootscript; then run bootscript;else if run loadbootenv; then ec
    ho Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then
    echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;
    eth1addr=38:d2:69:3e:b3:69
    ethact=cpsw
    ethaddr=38:d2:69:3e:b3:67
    fdt_addr_r=0x88000000
    fdtaddr=0x88000000
    fdtcontroladdr=9df294f8
    fdtfile=undefined
    findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi;
    if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; i
    f test $board_name = BBG1; then setenv fdtfile am335x-bonegreen.dtb; fi; if test
    $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_
    name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $board_name =
    A335_ICE; then setenv fdtfile am335x-icev2.dtb; fi; if test $fdtfile = undefine
    d; then echo WARNING: Could not determine device tree to use; fi;
    finduuid=part uuid mmc ${bootpart} uuid
    fit_bootfile=fitImage
    fit_loadaddr=0x87000000
    getuenv=if mmc rescan; then if run loadbootenv; then run importbootenv; fi; fi;
    importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${
    loadaddr} ${filesize}
    init_console=if test $board_name = A335_ICE; then setenv console ttyO3,115200n8;
    else setenv console ttyO0,115200n8;fi;
    ipaddr=192.168.1.68
    kernel_addr_r=0x82000000
    load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix
    }${efi_fdtfile}
    loadaddr=0x82000000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
    loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadfit=run args_mmc; bootm ${loadaddr}#${fdtfile};
    loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
    mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_pa
    rt; fi
    mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; if mmc r
    escan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then if test
    ${boot_fit} -eq 1; then run loadfit; else run mmcloados;fi;fi;fi;
    mmcdev=0
    mmcloados=run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; the
    n if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt}
    = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    mmcrootfstype=ext4 rootwait
    mtdids=nand0=nand.0
    mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.bac
    kup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.
    u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfsty
    pe=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-b
    oot-spl-os; nand read ${loadaddr} NAND.kernel; bootz ${loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
    nandrootfstype=ubifs rootwait=1
    netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${se
    rverip}:${rootpath},${nfsopts} rw ip=dhcp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; run netloadimag
    e; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}
    netloadfdt=tftp ${fdtaddr} ${fdtfile}
    netloadimage=tftp ${loadaddr} ${bootfile}
    nfsopts=nolock,v3,tcp,rsize=4096,wsize=4096
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_
    gpt_rootfs}
    pxefile_addr_r=0x80100000
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype
    =${ramrootfstype}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr}
    ${fdtaddr}
    ramdisk_addr_r=0x88080000
    ramroot=/dev/ram0 rw
    ramrootfstype=ext2
    rdaddr=0x88080000
    rootpath=/home/a000001/Projects/beaglebone-r--.--/linux-sdk-04.02/targetNFS
    scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for
    prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scrip
    ts; done;run scan_dev_for_efi;
    scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env ex
    ists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fs
    type ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_b
    oot; fi; done
    scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "$
    {soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix i
    n ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${p
    refix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${dev
    num}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable medi
    a binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: contin
    uing...; fi; setenv efi_fdtfile
    scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefi
    x}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run b
    oot_extlinux; echo SCRIPT FAILED: continuing...; fi
    scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${d
    evnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${pr
    efix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
    scriptaddr=0x80000000
    serverip=192.168.1.86
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype
    =${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read
    ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial@44e09000
    stdin=serial@44e09000
    stdout=serial@44e09000
    update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}
    usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_
    for_boot_part; fi
    usbnet_devaddr=38:d2:69:3e:b3:67
    vendor=ti
  • Are you holding S2 switch button pressed while booting?
  • I mentioned in the first post, I deleted the BBBlack eMMC. There is no need to hold the S2 after you delete the eMMC. If Idon't put the SD card in place then it will print "CCCCC" on the console.

  • Have you also deleted the /dev/mmcblk0boot0 and /dev/mmcblk0boot1 partitions? You probably have the old environment saved on /dev/mmcblk0boot1.

  • Not sure how to delete the /dev/mmcblk0boot0 and /dev/mmcblk0boot1 partitions?

  • Just erase the contents with the dd command. Something like

    dd if=/dev/zero of=/dev/mmcblk0boot0

    And then again for boot1.

    Steve K.

  • Can you firs hexdum the partitions and see if the 192.168.1.1 IP is saved there before formatting them?

    Boot from SD card, without using TFTP. See the instructions in <Processo SDK>/board-support/linux-<version>/Documentation/mmc/mmc-dev-parts.txt

    # check if the 192.168.1.1 is there
    hexdump -C /dev/mmcblk0boot0
    hexdump -C /dev/mmcblk0boot1

    # make the partition writeable
    echo 0 > /sys/block/mmcblkXbootY/force_ro

    # to delete or formatting zero the partition
    dd if=/dev/zero of=/dev/mmcblkXbootY bs=512

  • Cannot boot  form the BBBlack eMMC anymore.

    It will not boot without the the SD and behavior when booting from the SD is the default behavior - I did not change anything. I created the SD using the ../bin/create-sdcard.sh script,  and using the pre-built images.

    Examining the content of the SD on the host:

    mmcblk1                 179:0    0  14.6G  0 disk  

    ├─mmcblk1p1             179:1    0    70M  0 part  /media/ZGy/boot    <<=>> contains the MLO and the u-boot.img

    └─mmcblk1p2             179:2    0  14.6G  0 part                     <<=>> Not sure what this one is? Can I mount it on the host?

    To my understanding, the script copies  the "MLO" and the "u-boot.img" files only.  And in order to boot and run from the SD, we need to copy the Linux kernel ans well as the filesystem.  

    Not sure if by default the script copies the files system and the Linux kernel to the SD, does it? Or should  it? 

  • create-sdcard.sh does everything, formats the SD card, creates the partitions, makes the fat and ext3 filesystems, toggles the bootable flag to first partition copies the MLO and u-boot.img to it, extracts the rootfs on second partition. Just run the create-sdcard.sh script, follow the instructions and choose to flash the preserved prebuilt images from the Processor SDK, then put it on your board and hold down S2 switch button while powering the device on.

  • If you have a look at my original post you will notice that it is what exactly I have done from the beginning.

    I could verify that the boot partition is a primary FAT23 partition, it is created properly, and it contains the MLO and the  and the u-boot.img, and they are working properly.

    I'm not sure about the rootfs and whether or not it was created properly. I believer it is supposed to be a Linux ext3 partition, but my host was not able to detect it.

    At this point I'm quite sure there is an issue with minicom script that configures the target  and/or the rootfs partition which  allows runing from the SD directly - but I don't know the issue yet.  

    Meanwhile, the following commands work when issued form the u-boot console:

    => env default -f -a

    => saveenv

    => reset

    => setenv serverip 192.168.1.86

    => setenv ipaddr 192.168.1.68  

    => saveenv

    => reset

    => tftpboot ${kloadaddr} am335x-boneblack.dtb

    link up on port 0, speed 100, full duplex                                                                                

    Using cpsw device                                                                                                        

    TFTP from server 192.168.1.86; our IP address is192.168.1..68                                                            

    Filename 'am335x-boneblack.dtb'.                                                                                        

    Load address: 0x82000000                                                                                                

    Loading: ###                                                                                                            

            351.6 KiB/s                                                                                                    

    done                                                                                                                    

    Bytes transferred = 37853 (93dd hex)    

    =>

    Now, if I issue a dhcp command it defaults back to the gateway IP (192.168.1.1). I' think bu defaults it assumes that the NFS server is the same as the gateway.                                                                                                      

    => dhcp                                                                                                                  
    link up on port 0, speed 100, full duplex                                                                                
    BOOTP broadcast 1                                                                                                        
    DHCP client bound to address 192.168.1.68 (5 ms)                                                                         
    Using cpsw device                                                                                                        
    TFTP from server 192.168.1.1; our IP address is 192.168.1.68                                                             
    Filename 'am335x-boneblack.dtb'.                                                                                         
    Load address: 0x82000000                                                                                                 
    Loading: T T T T T T T T T T T T T T T T T T T T                                                                         
    Retry count exceeded; starting again                                                                                     
    =>


  • There is an issue with the setup-uboot-env.sh script in ti-processor-sdk-linux-am335x-evm-04.02.00.09, you need to change the "\"abort autoboot\"" string to "\"stop autoboot\"" also in setupBoard.minicom if it has already generated. Are you powering your BBB with the USB cable connected to your host machine? Can you power it from external 5V power source without connecting it to any USB?