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.

DM388: TFTP Boot with NFS

Part Number: DM388

I'm trying to know more about tftp boot in DM388 csk device. I'm reading, by tftp we can load Linux images directly into the board. Does that mean we can eliminate flashing and loading files using SD card if we are using boot through tftp?

  • Hi Nithin,

    I haven't tried TFTP booting. However if you are looking for a method to flash images directly when the board is up and running, then you can use netcat commands.

    At PC side first:
    nc -l 1234 < filename

    On DM388 board:
    #mount the boot partition of SD card
    mdkir /mnt/boot
    mount -t auto /dev/mmcblk0p1 /mnt/boot
    #copy the image to the device
    nc <pc_ip_addr> 1234 > filename

    #copy file to mounted SD card partition
    cp filename /mnt/boot/filename
    sync

    The above can copy the required files from PC to SD card without removing SD card.

    Regards,
    Nishal
  • Thank you Nishal for the help.
    It worked.

    I was able to get data into my SD card. I see the data is stored in root/home directory in the SD card. Does the modifications I did in code take effect when I reboot the board? As the uImage, etc are in boot directory of SD card.

    Regards,
    Nithin

  • Hi Nithin,

    booting kernel is possible or even nandboot is possible. you can even use tftpboot(for kernel) with NFS (filesystem). u-boot as command tftpboot (tftpboot $addr $file) , address should be respective load address . you need to modify your boot command(bootcmd) for the same. Since Without interruption at u-boot bootcmd runs on reset.


  • Thank you for the input, Vishwanath.
    Can you assist me with steps to tftp boot with NFS.

    Like..finding the load address, boot command modification, setting the boodargs, etc..

    Reagrds
  • Hi Nithin,

    It is good if you can check current bootcmd , and trace back mmcboot and mmcargs inturn to understand.
    Please refer this thread which as more details for the same,

    e2e.ti.com/.../2299199
  • Thank you Vishwanath

    As you have mentioned in;

    e2e.ti.com/.../2299199

    I will modify the environmet variables and try.

    #setenv serverip 192.168.1.1

    #setenv rootpath '/home/vishwanath.patil/dm38x/Source/ipnc_rdk/target/filesys'

    #setenv nfsargs 'console=${console} root=/dev/nfs rw mem=${mem} nfsroot=$serverip:$rootpath ip=dhcp vram=${vram} ${optargs}'

    #setenv nfsboot 'run nfsargs;run loaduimage ; run loaddtbimage; bootm ${loadaddr} - ${loaddtbaddr};'

    #setenv bootcmd 'csk_ff_init 1;run nfsboot;run mmcboot;run nandboot;'

    Few Questions;
    1. My serverip should be my host ip address right?
    2. Do I need to set bootargs or nfsargs will do the job?
    3. What should be my load address, loaddtbaddr,etc..can I use the same as givien below or to what I should change that?


    Following are my u-boot result

    arch=arm
    baudrate=115200
    board=dm38x
    board_name=dm38x
    bootcmd=csk_ff_init 1;run mmcboot;run nandboot;
    bootdelay=1
    bootfile=uImage
    console=ttyS0,115200n8
    cpu=armv7
    ethact=cpsw
    ethaddr=7c:66:9d:f9:0e:ca
    fdt_high=0x84500000
    fdtcontroladdr=bfe7fc98
    fdtfile=dm38x-csk.dtb
    loadaddr=0x82000000
    loaddtbaddr=0x84000000
    loaddtbimage=fatload mmc ${mmcdev} ${loaddtbaddr} ${fdtfile}
    loaduimage=fatload mmc ${mmcdev} ${loadaddr} ${bootfile}
    mem=80M
    mmcargs=setenv bootargs console=${console} root=${mmcroot} mem=${mem} vram=${vram} ${optargs}
    mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};echo Booting from mmc ...; run mmcargs; if run l;
    mmcdev=0
    mmcroot=/dev/mmcblk0p2 rootwait rw
    optargs=cmemk.phys_start=0x85000000 cmemk.phys_end=0x89000000 cmemk.allowOverlap=1 notifyk.vpssm3_sva=0xBFD00000 earlyprintk
    soc=am33xx
    stderr=serial
    stdin=serial
    stdout=serial
    vendor=ti
    ver=U-Boot 2016.05 (Sep 22 2017 - 12:03:55 +0530)
    vram=4M


    Regards
  • 1. My serverip should be my host ip address right ?
    serverip will be host ip
    2) Do I need to set bootargs or nfsargs will do the job?
    tweeking nfsargs is ok
    3) What should be my load address, loaddtbaddr,etc..can I use the same as givien below or to what I should change that?
    they will be same just that you have to load using tftpboot - uImage and DTB to those locations
  • Thank you Vishwanath,

    based on my u-boot print result, can you help me in framing the tftpboot command to load uImage and DTB.

    Reagrds
  • I modified my u-boot like this;

    DM38x-CSK# print
    arch=arm
    baudrate=115200
    board=dm38x
    board_name=dm38x
    bootcmd=csk_ff_init 1;run nfsboot;run mmcboot;run nandboot;
    bootdelay=1
    bootfile=uImage
    console=ttyS0,115200n8
    cpu=armv7
    ethact=cpsw
    ethaddr=7c:66:9d:f9:0e:ca
    fdt_high=0x84500000
    fdtcontroladdr=bfe7fc98
    fdtfile=dm38x-csk.dtb
    ipaddr=192.168.1.50
    loadaddr=0x82000000
    loaddtbaddr=0x84000000
    loaddtbimage=fatload mmc ${mmcdev} ${loaddtbaddr} ${fdtfile}
    loaduimage=fatload mmc ${mmcdev} ${loadaddr} ${bootfile}
    mem=80M
    mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};echo Booting from mmc ...; run mmcargs; if run l;
    mmcdev=0
    mmcroot=/dev/mmcblk0p2 rootwait rw
    nfsargs=console=${console} root=/dev/nfs rw mem=${mem} nfsroot=$serverip:$rootpath ip=dhcp vram=${vram} ${optargs}
    nfsboot=run nfsargs;run loaduimage ; run loaddtbimage; bootm ${loadaddr} - ${loaddtbaddr};
    optargs=cmemk.phys_start=0x85000000 cmemk.phys_end=0x89000000 cmemk.allowOverlap=1 notifyk.vpssm3_sva=0xBFD00000 earlyprintk
    rootpath=/home/test/ti/ipnc_rdk-3.9.0/Source/ipnc_rdk/target/filesys
    serverip=192.168.1.15
    soc=am33xx
    stderr=serial
    stdin=serial
    stdout=serial
    vendor=ti
    ver=U-Boot 2016.05 (Sep 22 2017 - 12:03:55 +0530)
    vram=4M

    after saving, gave this command

    tftpboot 0x82000000 192.168.1.15:uImage

    DM38x-CSK# tftpboot 0x82000000 192.168.1.15:uImage
    link up on port 0, speed 100, full duplex
    Using cpsw device
    TFTP from server 192.168.1.15; our IP address is 192.168.1.50
    Filename 'uImage'.
    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

    Where I'm wrong?

    Regards.

  • Hi Nithin,

    What have you configured your gateway ? I am not able to see gateway set in the uboot print.

    # setenv gateway 192.168.1.0
  • Hi Nithin,

    It is gatewayip and not just gateway. Change it. Also set netmask as 255.255.255.0 and check.
  • Hi Dwarakesh
    Pasting here the updated uboot print;

    DM38x-CSK# print
    arch=arm
    baudrate=115200
    board=dm38x
    board_name=dm38x
    bootcmd=csk_ff_init 1;run nfsboot;run mmcboot;run nandboot;
    bootdelay=1
    bootfile=uImage
    console=ttyS0,115200n8
    cpu=armv7
    ethact=cpsw
    ethaddr=7c:66:9d:f9:0e:ca
    fdt_high=0x84500000
    fdtcontroladdr=bfe7fc98
    fdtfile=dm38x-csk.dtb
    gatewayip=192.168.1.1
    ipaddr=192.168.1.50
    loadaddr=0x82000000
    loaddtbaddr=0x84000000
    loaddtbimage=fatload mmc ${mmcdev} ${loaddtbaddr} ${fdtfile}
    loaduimage=fatload mmc ${mmcdev} ${loadaddr} ${bootfile}
    mem=80M
    mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};echo Booting from mmc ...; run mmcargs; if run l;
    mmcdev=0
    mmcroot=/dev/mmcblk0p2 rootwait rw
    netmask=255.255.255.0
    nfsargs=console=${console} root=/dev/nfs rw mem=${mem} nfsroot=$serverip:$rootpath ip=dhcp vram=${vram} ${optargs}
    nfsboot=run nfsargs;run loaduimage ; run loaddtbimage; bootm ${loadaddr} - ${loaddtbaddr};
    optargs=cmemk.phys_start=0x85000000 cmemk.phys_end=0x89000000 cmemk.allowOverlap=1 notifyk.vpssm3_sva=0xBFD00000 earlyprintk
    rootpath=/home/test/ti/ipnc_rdk-3.9.0/Source/ipnc_rdk/target/filesys
    serverip=192.168.1.15
    soc=am33xx
    stderr=serial
    stdin=serial
    stdout=serial
    vendor=ti
    ver=U-Boot 2016.05 (Sep 22 2017 - 12:03:55 +0530)
    vram=4M

    Regards
  • Hi Dwarakesh,

    I'm getting same results with updated uboot. Is the loadaddress what I'm giving is correct?

    Thank you
    Regards
  • Hi Nithin,

    Can you try if you are able to ping Host or from Host if you are able to ping board ?
  • Hi Dwarakesh,

    I'm able to ping

    DM38x-CSK# ping 192.168.1.15
    link up on port 0, speed 100, full duplex
    Using cpsw device
    host 192.168.1.15 is alive
    DM38x-CSK#


    test@test-test:~$ ping 192.168.1.50
    PING 192.168.1.50 (192.168.1.50) 56(84) bytes of data.
    64 bytes from 192.168.1.50: icmp_seq=1 ttl=128 time=1.36 ms
    64 bytes from 192.168.1.50: icmp_seq=2 ttl=128 time=0.719 ms
    64 bytes from 192.168.1.50: icmp_seq=3 ttl=128 time=0.900 ms
    64 bytes from 192.168.1.50: icmp_seq=4 ttl=128 time=0.926 ms
    64 bytes from 192.168.1.50: icmp_seq=5 ttl=128 time=0.960 ms
    64 bytes from 192.168.1.50: icmp_seq=6 ttl=128 time=0.938 ms
    64 bytes from 192.168.1.50: icmp_seq=7 ttl=128 time=0.953 ms

    Regards
  • Hi Nithin.

    It is to do with tftp config or command

    Can you try, without IP as below
    tftpboot 0x82000000 uImage
  • Hi Dwarakesh,

    I tried that..

    DM38x-CSK# tftpboot 0x82000000 uImage
    link up on port 0, speed 100, full duplex
    Using cpsw device
    TFTP from server 192.168.1.15; our IP address is 192.168.1.50
    Filename 'uImage'.
    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
    DM38x-CSK#

    Regards
  • Hi Nithin,

    Yeah, I missed to note this command log before. It should not make difference. What have done at the host PC side to configure TFTP server ?
  • Hi Nithin,

    Please make sure ubuntu side you have done as suggested in the following wiki : processors.wiki.ti.com/.../Setting_Up_a_TFTP_Server
  • HI Dwarakesh,
    I'm trying to use TFTP boot from some time...I started trying with installing TFTP server, moving image files to tftp boot based on some documents. I might have done something wrong.

    Can you please guide me with proper steps from installing.

    Thank you,
    Reagrds

  • Hi Nithin,

    I have shared a link above. Please make sure you try that. Also make sure you have uninstalled any other thing other than in the above link. Also check in ps if any other tftp daemon is running.