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.

host dhcp config for usb0 boot

I have a beagle bone board and I have been trying to boot from usb0. My host pc is based on Ubuntu 12.04. I have not succeeded to configure my host to transfer even a single file. The first file I am tryin to transfer is "u-boot-spl.bin". My tftp server works well. I think the problem is in the way I configure the DHCP server. I have examined what happens with Wireshark, and see BOOTP messages coming from the BB and DHCP messages coming from my PC. I would really appreciate some help in the configuration of the DHCP server, and also with the Interface configuration. If someone has this setup working, having both the "dhcp.conf" file and the "interfaces" file would really help me.

Thank you,

Vincent

  • BB uses am335x PG1.0 which has a silicon bug causing usb boot failing to transfer files. The bug has been fixed in PG2.x.

  • I am sorry that I did not specifie the BB version. I have a Beagle Bone Black Rev A5C and the part on it says:

    XAM3359AZCZ100

    And according to document "sprz360e.pdf" the A following the number means it is a silicon revison 2.0. So my problem lies somewhere else.

    Thank you

  • Great, your issue is something else then.

    Here is my entire setup, it uses subnet 192.168.3.0:

    1. first have a udev rule to detect the USB0 network interface:

    lb@ub:~$ cat /etc/udev/rules.d/71-usb-boot.rules
    ACTION=="add", SUBSYSTEM=="net", KERNEL=="usb*", RUN+="/home/lb/bin/usbboot-dhcpd start %n"
    ACTION=="remove", SUBSYSTEM=="net", KERNEL=="usb*", RUN+="/home/lb/bin/usbboot-dhcpd stop"

    2. the rule above calls the following script to assign static IP to usb0 and re-start dhcpd:

    lb@ub:~$ cat ~/bin/usbboot-dhcpd

    #!/bin/bash
    LOCKFILE=/tmp/usb-dhcpd.lock
    INTERVAL=0.5	# retry interval
    TIMEOUT=20	# ~10sec
    SUBNET=3	# should match dhcpd.conf
    
    cnt=0
    # ensure only one instance is running
    while :; do
    	! mkdir "$LOCKFILE" || break
    
    	: $((cnt += 1))
    	[ $cnt -le $TIMEOUT ] || exit 1
    
    	sleep $INTERVAL
    done
    
    # del lockfile on exit
    trap 'rm -rf "$LOCKFILE"' 0
    
    if [ "$1" = "start" ]; then
    	_ip=$(($2 + $SUBNET))
    	ifconfig usb${2} 192.168.${_ip}.1 || exit 2
    
    	stop isc-dhcp-server
    	start isc-dhcp-server
    elif [ "$1" = "stop" ]; then
    	ifconfig | grep usb
    	# do not stop dhcpd until all I/F are gone
    	[ $? = 0 ] || stop isc-dhcp-server
    fi
    

    3. add usb0 to dhcp server interface

    lb@ub:~$ cat /etc/default/isc-dhcp-server

    INTERFACES="usb0"

    4. add the following to /etc/dhcp/dhcpd.conf:

    subnet 192.168.3.0 netmask 255.255.255.0 {
      range dynamic-bootp 192.168.3.100 192.168.3.200;
    
      if substring (option vendor-class-identifier, 0, 10) = "AM335x ROM" {
        filename "u-boot-spl.bin";
      } elsif substring (option vendor-class-identifier, 0, 17) = "AM335x U-Boot SPL" {
        filename "u-boot.img";
      } else {
        filename "uImage-am335x";
      } 
    }
    
  • Thank you Liu for your help. I was not able to make it work with what you sent me. I will have a modification made at the office so that I can try an ethernet Boot. I will also try on a newly installed system. I will get you posted on the results I get.

  • Vincent,

    For tftp server, I use atftpd. The nice thing about atftpd is that by default it puts all the logs into syslog. So with all the log about atftpd and dhcpd in syslog, you can easily figure out where the problem is.

  • Not sure if this is still open but  just got working using Bin's files/methods and atftpd was key!

     Based on some advice from Googling, my /etc/default/atftpd looks like this:

    USE_INETD=false OPTIONS="--tftpd-timeout 300 --retry-timeout 5 --bind-address=192.168.3.1 --maxthread 100 --verbose=7 /srv/tftp --logfile /var/log/atftpd.log"

    1. Binded my Ubuntu 12.04 usb0 address instead of using multicast

    2. Used /srv/tftp as the tftp source directory (not /tftboot) to differentiate from my "tftp tftpd xinetd" mess

    3. Tried to make a separate logfile, but got some kind of error.  Messages showed up in /var/log/syslog.

    After starting/restarting with

    sudo invoke-rc.d atftpd start sudo /etc/init.d/atftpd restart

    you can then follow the tftpserver messages with:

    grep atftpd /var/log/syslog

    so here is a working log serving up to IP address .100 (ROM bootloader) and .101 (SPL) from .1 (the Ubuntu 12.04 Host):

    Mar 11 16:09:12 root1-Latitude-E6410 atftpd[10289]: Creating new socket: 192.168.3.1:35943 Mar 11 16:09:12 root1-Latitude-E6410 atftpd[10289]: Serving u-boot-spl.bin to 192.168.3.100:1234 Mar 11 16:09:13 root1-Latitude-E6410 atftpd[10289]: End of transfer Mar 11 16:09:13 root1-Latitude-E6410 atftpd[10289]: Server thread exiting Mar 11 16:09:16 root1-Latitude-E6410 atftpd[10289]: socket may listen on any address, including broadcast Mar 11 16:09:16 root1-Latitude-E6410 atftpd[10289]: Creating new socket: 192.168.3.1:44390 Mar 11 16:09:16 root1-Latitude-E6410 atftpd[10289]: Serving u-boot.img to 192.168.3.101:1508

    Also don't forget that you need to build and use the correct uboot files in your  /srv/tftp as documented here:

    http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User%27s_Guide#Booting_U-Boot_from_the_network

    My build command line was:

    make O=am335x_evm_usbspl CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm am335x_evm /board-support/u-boot-2013.01.01-psp06.00.00.00/am335x/spl

    and I used the spl files that were generated in /board-support/u-boot-2012.10-psp05.06.00.00/am335x/spl

    and the uboot.img from /board-support/u-boot-2012.10-psp05.06.00.00/am335x

  • Sorry, had to fix a typo in the above post:

    and I used the spl files that were generated in /board-support/u-boot-2013.01.01-psp06.00.00.00/am335x_evm_usbspl/spl

    and the uboot.img from /board-support/u-boot-2013.01.01-psp06.00.00.00/am335x_evm_usbspl

  • I had to create the udev files and such you have above but the connection at USB0 does not get a IP address automatically do i have to install a dhcp server?

  • Yes, we both used isc-dhcp-server that got invoked by the udev rules.

  • I got that installed now but i had to manually set the network interface should this happen with the udev script ?

    I got the spl.bin loaded now the port advertises as U-boot RNDIS/Ethernet Gadget will this not allow the right file to be sent?

  • ok i just had to update the network manager for the new connection as 192.168.3.1 and it downloaded the .img

    One thing to note is you must edit the config file for u-boot to build the #define CONFIG_SPL_USBETH_SUPPORT.

  • ok i just had to update the network manager for the new connection as 192.168.3.1 and it downloaded the .img

    One thing to note is you must edit the config file for u-boot to build the #define CONFIG_SPL_USBETH_SUPPORT.

  • You should not have to modify any files if you use the make target am335x_evm_usbspl instead of am335x_evm. Take a look at boards.cfg and you can see what #defines are added for different make targets.

    Steve K.

  • Makes sense I will do that instead. 

    How do I get the Kernel down the first time. My eMMC is blank and I modified the kernel from sdk 6.0 just to have the basic items.

    Thanks