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.

AM3352: USB-ETH boot fails

Part Number: AM3352

Hi,

I am not able to download u-boot.img via usb-ethernet in AM3352 custom board.

I am using u-boot v2019.07 and configured tftp and kept MLO, u-boot.img and u-boot-spl.bin in the tftp folder.

My board is able to download u-boot-spl.bin file but it is not able to proceed further.

Kindly refer the following log from the device's serial terminal,

U-Boot SPL 2019.07-dirty (Sep 02 2019 - 18:38:34 +0530)
Trying to boot from USB eth

Warning: usb_ether using MAC address from ROM
eth0: usb_ether
Warning: usb_ether using MAC address from ROM
, eth1: usb_ether
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
stops here and then my windows machine says USB device not recognized/malfunctioned.

Also the log from the host,

Sep 02 13:18:31 apertis kernel: usb 2-2: new full-speed USB device number 28 using ohci-pci
Sep 02 13:18:32 apertis kernel: usb 2-2: not running at top speed; connect to a high speed hub
Sep 02 13:18:32 apertis kernel: usb 2-2: New USB device found, idVendor=0451, idProduct=6141
Sep 02 13:18:32 apertis kernel: usb 2-2: New USB device strings: Mfr=33, Product=37, SerialNumber=0
Sep 02 13:18:32 apertis kernel: usb 2-2: Product: AM335x USB
Sep 02 13:18:32 apertis kernel: usb 2-2: Manufacturer: Texas Instruments
Sep 02 13:18:32 apertis connmand[437]: usb0 {create} index 64 type 1 <ETHER>
Sep 02 13:18:32 apertis kernel: rndis_host 2-2:1.0 usb0: register 'rndis_host' at usb-0000:00:06.0-2, RNDIS device, 86:89:88:bb:eb:b0
Sep 02 13:18:32 apertis connmand[437]: usb0 {update} flags 4098 <DOWN>
Sep 02 13:18:32 apertis connmand[437]: usb0 {newlink} index 64 address 86:89:88:BB:EB:B0 mtu 1500
Sep 02 13:18:32 apertis connmand[437]: usb0 {newlink} index 64 operstate 2 <DOWN>
Sep 02 13:18:32 apertis connmand[437]: usb0 {newlink} index 64 address 7A:EA:E6:0D:CC:71 mtu 1500
Sep 02 13:18:32 apertis connmand[437]: usb0 {newlink} index 64 operstate 2 <DOWN>
Sep 02 13:18:32 apertis connmand[437]: usb0 {add} address 172.17.0.1/16 label usb0 family 2
Sep 02 13:18:32 apertis connmand[437]: usb0 {update} flags 69699 <UP,RUNNING,LOWER_UP>
Sep 02 13:18:32 apertis connmand[437]: usb0 {newlink} index 64 address 7A:EA:E6:0D:CC:71 mtu 1500
Sep 02 13:18:32 apertis connmand[437]: usb0 {newlink} index 64 operstate 0 <UNKNOWN>
Sep 02 13:18:32 apertis avahi-daemon[441]: Joining mDNS multicast group on interface usb0.IPv4 with address 172.17.0.1.
Sep 02 13:18:32 apertis connmand[437]: usb0 {add} route 172.17.0.0 gw 0.0.0.0 scope 253 <LINK>
Sep 02 13:18:32 apertis connmand[437]: usb0 {add} route fe80:: gw :: scope 0 <UNIVERSE>
Sep 02 13:18:32 apertis avahi-daemon[441]: New relevant interface usb0.IPv4 for mDNS.
Sep 02 13:18:32 apertis avahi-daemon[441]: Registering new address record for 172.17.0.1 on usb0.IPv4.
Sep 02 13:18:32 apertis systemd[1]: Stopping ISC DHCP IPv4 server...
Sep 02 13:18:32 apertis systemd[1]: Stopped ISC DHCP IPv4 server.
Sep 02 13:18:32 apertis audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=isc-dhcp-server comm="systemd" exe="/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Sep 02 13:18:32 apertis systemd[1]: Started ISC DHCP IPv4 server.
Sep 02 13:18:32 apertis audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=isc-dhcp-server comm="systemd" exe="/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Sep 02 13:18:32 apertis dhcpd[13386]: Internet Systems Consortium DHCP Server 4.3.3
Sep 02 13:18:32 apertis sh[13386]: Internet Systems Consortium DHCP Server 4.3.3
Sep 02 13:18:32 apertis sh[13386]: Copyright 2004-2015 Internet Systems Consortium.
Sep 02 13:18:32 apertis sh[13386]: All rights reserved.
Sep 02 13:18:32 apertis sh[13386]: For info, please visit www.isc.org/.../
Sep 02 13:18:32 apertis dhcpd[13386]: Copyright 2004-2015 Internet Systems Consortium.
Sep 02 13:18:32 apertis dhcpd[13386]: All rights reserved.
Sep 02 13:18:32 apertis dhcpd[13386]: For info, please visit www.isc.org/.../
Sep 02 13:18:32 apertis dhcpd[13386]: Config file: /etc/dhcp/dhcpd.conf
Sep 02 13:18:32 apertis sh[13386]: Config file: /etc/dhcp/dhcpd.conf
Sep 02 13:18:32 apertis dhcpd[13386]: Database file: /var/lib/dhcp/dhcpd.leases
Sep 02 13:18:32 apertis sh[13386]: Database file: /var/lib/dhcp/dhcpd.leases
Sep 02 13:18:32 apertis dhcpd[13386]: PID file: /run/dhcp-server/dhcpd.pid
Sep 02 13:18:32 apertis sh[13386]: PID file: /run/dhcp-server/dhcpd.pid
Sep 02 13:18:32 apertis dhcpd[13386]: Internet Systems Consortium DHCP Server 4.3.3
Sep 02 13:18:32 apertis dhcpd[13386]: Copyright 2004-2015 Internet Systems Consortium.
Sep 02 13:18:32 apertis sh[13386]: Wrote 0 leases to leases file.
Sep 02 13:18:32 apertis dhcpd[13386]: All rights reserved.
Sep 02 13:18:32 apertis dhcpd[13386]: For info, please visit www.isc.org/.../
Sep 02 13:18:32 apertis dhcpd[13386]: Wrote 0 leases to leases file.
Sep 02 13:18:32 apertis dhcpd[13386]: Listening on LPF/usb0/7a:ea:e6:0d:cc:71/172.17.0.0/24
Sep 02 13:18:32 apertis sh[13386]: Listening on LPF/usb0/7a:ea:e6:0d:cc:71/172.17.0.0/24
Sep 02 13:18:32 apertis sh[13386]: Sending on   LPF/usb0/7a:ea:e6:0d:cc:71/172.17.0.0/24
Sep 02 13:18:32 apertis sh[13386]: Sending on   Socket/fallback/fallback-net
Sep 02 13:18:32 apertis dhcpd[13386]: Sending on   LPF/usb0/7a:ea:e6:0d:cc:71/172.17.0.0/24
Sep 02 13:18:32 apertis dhcpd[13386]: Sending on   Socket/fallback/fallback-net
Sep 02 13:18:32 apertis dhcpd[13386]: Server starting service.
Sep 02 13:18:34 apertis avahi-daemon[441]: Joining mDNS multicast group on interface usb0.IPv6 with address fe80::78ea:e6ff:fe0d:cc71.
Sep 02 13:18:34 apertis avahi-daemon[441]: New relevant interface usb0.IPv6 for mDNS.
Sep 02 13:18:34 apertis avahi-daemon[441]: Registering new address record for fe80::78ea:e6ff:fe0d:cc71 on usb0.*.
Sep 02 13:18:36 apertis dhcpd[13386]: BOOTREQUEST from f8:36:9b:11:d8:53 via usb0
Sep 02 13:18:36 apertis dhcpd[13386]: ns1.example.org: no A record associated with address
Sep 02 13:18:36 apertis dhcpd[13386]: ns2.example.org: no A record associated with address
Sep 02 13:18:36 apertis dhcpd[13386]: BOOTREPLY on 172.17.0.2 to f8:36:9b:11:d8:53 via usb0
Sep 02 13:18:37 apertis dnsmasq-tftp[500]: sent /opt/eldev/tftp/u-boot-spl.bin to 172.17.0.2
Sep 02 13:18:38 apertis kernel: usb 2-2: USB disconnect, device number 28
Sep 02 13:18:38 apertis connmand[437]: (null) {RX} 166 packets 6047 bytes
Sep 02 13:18:38 apertis connmand[437]: (null) {TX} 192 packets 102556 bytes
Sep 02 13:18:38 apertis connmand[437]: (null) {update} flags 4098 <DOWN>
Sep 02 13:18:38 apertis kernel: rndis_host 2-2:1.0 usb0: unregister 'rndis_host' usb-0000:00:06.0-2, RNDIS device
Sep 02 13:18:38 apertis connmand[437]: usb0 {newlink} index 64 address 7A:EA:E6:0D:CC:71 mtu 1500
Sep 02 13:18:38 apertis connmand[437]: usb0 {newlink} index 64 operstate 2 <DOWN>
Sep 02 13:18:38 apertis connmand[437]: (null) {del} route fe80:: gw :: scope 0 <UNIVERSE>
Sep 02 13:18:38 apertis avahi-daemon[441]: Interface usb0.IPv6 no longer relevant for mDNS.
Sep 02 13:18:38 apertis avahi-daemon[441]: Leaving mDNS multicast group on interface usb0.IPv6 with address fe80::78ea:e6ff:fe0d:cc71.
Sep 02 13:18:38 apertis dhcpd[13386]: receive_packet failed on usb0: Network is down
Sep 02 13:18:38 apertis avahi-daemon[441]: Interface usb0.IPv4 no longer relevant for mDNS.
Sep 02 13:18:38 apertis avahi-daemon[441]: Leaving mDNS multicast group on interface usb0.IPv4 with address 172.17.0.1.
Sep 02 13:18:38 apertis avahi-daemon[441]: Withdrawing address record for fe80::78ea:e6ff:fe0d:cc71 on usb0.
Sep 02 13:18:38 apertis avahi-daemon[441]: Withdrawing address record for 172.17.0.1 on usb0.
Sep 02 13:18:38 apertis connmand[437]: (null) {del} address 172.17.0.1/16 label usb0
Sep 02 13:18:38 apertis connmand[437]: usb0 {dellink} index 64 operstate 2 <DOWN>
Sep 02 13:18:38 apertis connmand[437]: (null) {RX} 166 packets 6047 bytes
Sep 02 13:18:38 apertis connmand[437]: (null) {TX} 192 packets 102556 bytes
Sep 02 13:18:38 apertis connmand[437]: (null) {remove} index 64

  • Hi,

    Moses Christopher said:
    I am using u-boot v2019.07 and configured tftp and kept MLO, u-boot.img and u-boot-spl.bin in the tftp folder.

    The U-Boot tag 'v2019.07' doesn't look familiar, which Processor SDK version do you use?

    Moses Christopher said:

    stops here and then my windows machine says USB device not recognized/malfunctioned.

    Also the log from the host,

    Sep 02 13:18:31 apertis kernel: usb 2-2: new full-speed USB device number 28 using ohci-pci
    Sep 02 13:18:32 apertis kernel: usb 2-2: not running at top speed; connect to a high speed hub
    Sep 02 13:18:32 apertis kernel: usb 2-2: New USB device found, idVendor=0451, idProduct=6141

    The message mentions about Windows PC, then shows Linux host logs. Do you use Windows host or Linux host in this test?

  • I use linux host in virtual box running on windows machine.

    Virtual box usb settings are configured to take control of the target attached via USB

    In u-boot v2019.07,

    U-Boot SPL 2019.07-dirty (Sep 03 2019 - 13:58:41 +0530)

    usb_ether_init:

    ti_musb_peripheral_ofdata_to_platdata :

    ti_musb_ofdata_to_platdata :

    ti_musb_get_usb_index :

    ti_musb_peripheral_probe :

    ti_musb_set_phy_power :

    Trying to boot from USB eth

    usb_ether_init:

    usb_eth_probe:

    Warning: usb_ether using MAC address from ROM

    eth0: usb_etherusb_eth_probe:

    Warning: usb_ether using MAC address from ROM

    , eth1: usb_ether

    usb_eth_start:

    _usb_eth_init:

    is_eth_addr_valid:

    is_eth_addr_valid:

    eth_bind:

    using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in

    MAC de:ad:be:ef:00:01

    HOST MAC de:ad:be:ef:00:00

    RNDIS ready

    Stops here……

     


    But in v2018.03, 

     

    U-Boot SPL 2018.03-03204-g32e3a60-dirty (Sep 03 2019 - 15:05:54 +0530)

    usb_ether_init:

    ti_musb_peripheral_ofdata_to_platdata :

    ti_musb_ofdata_to_platdata :

    ti_musb_get_usb_index :

    ti_musb_peripheral_usb_probe :

    ti_musb_set_phy_power :

    Trying to boot from USB eth

    usb_eth_probe:

     

     

    Warning: usb_ether using MAC address from ROM

    eth0: usb_ether

     

    usb_eth_start:

    _usb_eth_init:

    _usb_eth_init: CONFIG_DM_USB

    is_eth_addr_valid:

    is_eth_addr_valid:

    usb_gadget_register_driver :

    eth_bind:

    using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in

    MAC de:ad:be:ef:00:01

    HOST MAC de:ad:be:ef:00:00/usb_probe

    RNDIS ready

    _usb_eth_init:

    musb-hdrc: peripheral reset irq lost!

    eth_set_config:

    eth_reset_config:

    set_ether_config:

    alloc_requests:

    eth_start:

    high speed config #2: 2 mA, Ethernet Gadget, using RNDIS

    USB RNDIS network up!

    BOOTP broadcast 1

    BOOTP broadcast 2

    BOOTP broadcast 3

    DHCP client bound to address 172.17.0.2 (1286 ms)

    Using usb_ether device

    TFTP from server 172.17.0.1; our IP address is 172.17.0.2

    Filename 'u-boot.img'.

    Load address: 0x82000000

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

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

             222.7 KiB/s

    done

    Bytes transferred = 576048 (8ca30 hex)

    eth_stop:

    _usb_eth_halt:

    usb_gadget_unregister_driver :

    eth_disconnect :

    eth_reset_config:

    eth_unbind:

     

     

    U-Boot 2018.03-03204-g32e3a60-dirty (Sep 03 2019 - 15:05:54 +0530)

     

    CPU : AM335X-GP rev 2.1

    It works...

     

    P.S: Things work pretty well in u-boot v2018.03

    Also, two usb devices are getting enumerated in v2019.07, eventhough the dts entries for usb are same and the defconifig is changed due to the changes made to the config because of Driver Model Migration.

  • Bin Liu said:

    Hi,

    The U-Boot tag 'v2019.07' doesn't look familiar, which Processor SDK version do you use?

    I am using mainline u-boot from denx (das u-boot)

  • Moses,

    I'm sorry, we don't support mainline U-Boot. We only support the versions provided in the Processor SDKs. 

    It sounds like things are working in 2018.03. We shipped 2018.01 in our PLSDK 5.x version, so it is close to what we validated. 2019.01 is include in our latest SDK, v6.0. 

    If you have problems getting things working in one of these validated versions as provided with the SDK, please let us know.

    Thank you.

  • Hi RonB,

    Can you kindly let me know, where can I find the u-boot version 2019.01 provided by the TI ?

    So that I can verify the same over there.

  • You can download the SDK v6.0 from ti.com:

    http://software-dl.ti.com/processor-sdk-linux/esd/AM335X/latest/index_FDS.html

    I typically just download the kerne/u-boot source package, which is smaller for download.

    software-dl.ti.com/.../am335x-evm-linux-sdk-src-06.00.00.07.tar.xz

  • Hi RonB,

    Found the reason,
    In SPL stage, the usb-ethernet is getting reinitialized in common/spl/spl_net.c
    That is creating an other ethernet interface in SPL and it was not working.
    By commenting out the second initialization, it works

  • Thanks for letting us know. 

  • Kindly let me know, if you've something more to add or if you would like to check the same on other boards, using usb ethernet.

    FYI, the patch that was causing this reinitialization of usb-eth in SPL is,

  • Hello,

    As I mentioned earlier, we don't work directly with mainline U-Boot other than for development purposes. As you've stated, our released version seems to work fine which I would expect as it has been tested and validated.

    If you feel you've found a problem in mainline U-Boot, please feel free to interact directly with the U-Boot community to report the issue.

    Thank you.

  • Hi RonB,

    Sorry, if I forgot to mention the u-boot release in which this change was present. It was in 2019.01, also seen in TI u-boot.

    Earlier tested in 2018.03, But the latest TI u-boot is 2019.01

    So, in TI u-boot 2019.01 this issue is present.

  • Hi Moses Christopher,

    First off, I want to thank you for being so diligent in trying the different releases.

    However, I was NOT able to replicate your results using a Beaglebone Black and the pre-built images from SDK 6.0. I was able to boot fine and even copy the kernel image over. Here is my log:

    U-Boot SPL 2019.01-g8b90adfb16 (Jul 07 2019 - 10:08:45 +0000)
    Trying to boot from USB eth

    Warning: eth_cpsw using MAC address from ROM
    eth0: eth_cpsw
    Warning: usb_ether using MAC address from ROM
    , eth1: usb_ether
    using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
    MAC de:ad:be:ef:00:01
    HOST MAC de:ad:be:ef:00:00
    RNDIS ready
    musb-hdrc: peripheral reset irq lost!
    high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
    USB RNDIS network up!
    BOOTP broadcast 1
    BOOTP broadcast 2
    BOOTP broadcast 3
    DHCP client bound to address 192.168.10.4 (1275 ms)
    Using usb_ether device
    TFTP from server 192.168.10.1; our IP address is 192.168.10.4
    Filename 'u-boot-restore.img'.
    Load address: 0x82000000
    Loading: #################################################################
    #################################################################
    ##########################
    1.9 MiB/s
    done
    Bytes transferred = 794368 (c1f00 hex)


    U-Boot 2019.01-g8b90adfb16 (Jul 07 2019 - 10:08:45 +0000)

    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
    Loading Environment from FAT... <ethaddr> not set. Validating first E-fuse MAC
    Net: eth0: ethernet@4a100000
    Warning: usb_ether MAC addresses don't match:
    Address in ROM is de:ad:be:ef:00:01
    Address in environment is 38:d2:69:62:73:e4
    , eth1: usb_ether
    Hit any key to stop autoboot: 0
    => tftp

    Did you pull your 2019.01 from TI, or directly from Denx?

    Thanks.

  • Interesting, and thanks for providing the log.

    I got the source from TI only. But, I only checked with my custom board but not with beaglebone black.

    I guess, I might have to replicate the same on beaglebone black in that case, and if that works well, I am doing something wrong with the configuration of my custom board and most probably I'd be able to figure it out, where I was wrong.

    Thanks again for your time and patience, It'd be great if you could confirm, which defconfig was used for the pre-built binary that you fetched.

  • We use the am335x_evm_defconfig to build the prebuilts.

    Please let us know your results when you have a chance to check a Beaglebone Black and if you are still having trouble, we will be happy to help.

    Thank you.

  • Hi RonB,

    USB-ETH works fine on BBB,
    I have observed that BBB uses OF_SEPARATE / OF_BOARD_SETUP  which calls a function at line 630 in boards/ti/am335x/board.c, when CPSW is enabled
    In my case I am not using CPSW or the OF_SEPARATE / OF_BOARD_SETUP. Hence, I bumped into this issue.

    Thanks for your support.

  • Thanks for letting us know the root cause in detail.

  • RonB,

    My device configuration is not proper, I've used SPL_OF_CONTROL instead of SPL_OF_LIBFDT
    And I've missed USB mode configuration in my header file.

    Now, with this change it works fine and I guess this is how it was running on BBB as well.