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/PROCESSOR-SDK-AM57X: Dual Ethernet ports (1 static, 1 DHCP)

Part Number: PROCESSOR-SDK-AM57X

Tool/software: Linux

Hi,

I'm using the TI AM572x evaluation module and having a lot of trouble using the two Ethernet ports simultaneously.  I'm able to boot off using TFTP/NFS on eth0 using a static IP, but when I try to bring up eth1 to get Internet access via a company DHCP server, I'm unable to ping google.com and the like, whether via domain name or by specifying an IP address.

It's also probably worth mentioning that at times I've had trouble even getting an IP address--after "ifup eth1" ethtool will still report 10 MB/s and half-duplex.  However, I seem to be having good luck drawing an IP by using "ifconfig eth1 up", waiting 12-15 seconds for the link to become ready, and then running "udhcpc -i eth1" separately.

I've tried using the same wall port and cable to get a DHCP address on the sole RJ-45 connector of a Beaglebone Black, and I'm quickly able to ping the outside world.

I'm using a static IP on eth0 because my development PC is on a local network and installing a DHCP server on it seemed like the less elegant solution.  Relative to the configuration the U-Boot configuration the minicom script provided, I made the following changes:

setenv static_ip 192.168.254.3:192.168.254.2:192.168.254.2:255.255.255.0::eth0:off

setenv bootargs "console=ttyO2,115200n8 root=/dev/nfs nfsroot=192.168.254.2:/home/irad/ti-processor-sdk-linux-am57xx-evm-03.02.00.05/targetNFS,nolock,v3,tcp,rsize=4096,wsize=4096 rw ip=${static_ip}"

setenv bootcmd "run findfdt; run getuenv; setenv autoload no; tftp ${loadaddr} zImage-am57xx-evm.bin; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}"

setenv netboot "echo Booting from network ...; setenv autoload no; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}"

setenv netargs "setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=${static_ip}"

setenv ipaddr 192.168.254.3

The SDK version is 3.02.00.05.  It seems like "dual EMAC" mode is the default, and it seems like the limitations of this were okay, but I haven't tried making any device tree or kernel changes yet.  Any suggestions?  Thanks!

-David

  • Hi,

    How are the two ports connected? Please note that in Dual EMAC mode the two ports must be connected to different subnets.
  • Eth0 is connected to a local unmanaged switch, which in turn is connected to an Ubuntu 16.04 development PC.  The subnet for this local network is 192.168.254.*--the development PC is 192.168.254.2 and eth0 on the target board is 192.168.254.3.  Eth1 (DHCP) on the target has a straight connection to company network infrastructure.  The DHCP address it draws is on a company-specific subnet.

  • I'd like to get some assistance with this.  I just tried again with the 03.03.00.04 SDK and got the same issue.  Here is a complete log of my steps:

    ----------------------------------------

    sudo chmod +x ./ti-processor-sdk-linux-am57xx-evm-03.03.00.04-linux-x86-Install.bin

    ./ti-processor-sdk-linux-am57xx-evm-03.03.00.04-linux-x86-Install.bin

    cd ti-processor-sdk-linux-am57xx-evm-03.02.00.05/bin

    sudo ./create-sdcard.sh

    (Create two partitions, use pre-built image from SDK, and any other settings left at default value)

    cd ..
    sudo ./setup.sh

    (IP specified as 192.168.254.2, serial connection is /dev/ttyUSB0, and do not run the minicom script; otherwise, defaults used.)

    Edited bin/setupBoard.minicom to delete the final lines that send the "boot" command and exit minicom.

    Moved SD card to target.

    sudo minicom –w –S ./bin/setupBoard.minicom

    After script is successful, used below commands to setup static IP for boot:

    setenv static_ip 192.168.254.3:192.168.254.2:192.168.254.2:255.255.255.0::eth0:off

    setenv bootargs "console=ttyO2,115200n8 root=/dev/nfs nfsroot=192.168.254.2:/home/irad/ti-processor-sdk-linux-am57xx-evm-03.02.00.05/targetNFS,nolock,v3,tcp,rsize=4096,wsize=4096 rw ip=${static_ip}"

    setenv fdtfile am57xx-evm-reva3.dtb

    setenv bootcmd "run findfdt; run getuenv; setenv autoload no; tftp ${loadaddr} zImage-am57xx-evm.bin; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} - ${fdtaddr}"

    setenv netboot "echo Booting from network ...; setenv autoload no; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}"

    setenv netargs "setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=${static_ip}"

    setenv ipaddr 192.168.254.3

    saveenv

    boot

    Login.

    ifconfig eth1 up

    (Long wait, there is no system message beyond "IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready".)

    udhcpc -i eth1

    (Ctrl-C to stop requests after awhile.)

    ifconfig eth1 down

    ifconfig eth1 up

    (This time, get "IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready".)

    udhcpc -i eth1

    This succeeds:

    udhcpc (v1.24.1) started
    Sending discover...
    Sending select for x.x.x.x...
    Lease of x.x.x.x obtained, lease time 1800
    /etc/udhcpc.d/50default: Adding DNS x.x.x.x
    /etc/udhcpc.d/50default: Adding DNS x.x.x.x

    But...

    ping google.com

    ...returns "ping: bad address 'google.com'".

    Thanks.

    -David

  • Sorry for this delay. I am checking what happened with the software team. They should respond here soon.
  • Part Number: PROCESSOR-SDK-AM57X

    Tool/software: Linux

    Board: TI AM572x EVM
    SDK: 03.03.00.04

    This issue is a branch off of my original issue (here: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/588689/2172204) involving configuring both ethernet ports after booting using TFTP and NFS.  My question this time is after just booting off of the SD card using the default image.  In this scenario, I am able to get eth0 working with a static IP and eth1 with DHCP, or vice-versa.  But I haven't been able to figure out how to have these settings take affect at startup, without having to manually set them up using, e.g., "ifconfig eth0 192.168.254.3" or "ifconfig eth1 up".

    I've done the four commands shown here...
    http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User%27s_Guide#Manual_network_configuration
    ...followed by 'saveenv' and 'boot'.  No change is readily noticeable.

    I've tried changing the "ip=" parameter in the U-Boot bootargs environment variable in a few ways, e.g.:

    setenv netargs "setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=192.168.254.3::192.168.254.2:255.255.255.0::eth0:off"

    And though it seems like the key is in the U-Boot environment variables and not /etc/network/interfaces, but here is the modified portion of one variation of /etc/network/interfaces I've tried:

    auto eth0
    iface eth0 inet static
            address 192.168.254.3
            netmask 255.255.255.0
            network 192.168.254.0
            broadcast 192.168.254.255
            gateway 192.168.254.2

    auto eth1
    iface eth1 inet dhcp
            pre-up /bin/grep -v -e "ip=[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" /proc/cmd
            udhcpc_opts -R -b

    It seems like this should be very basic.  What am I missing?  Thanks.

    -David

  • So if I just boot off of the SD card and don't use NFS, I see that I can use eth0 for DHCP--successfully able to ping google.com--and then I'm able to manually configure eth1 at the command-line to use a static IP (albeit after using the down/up commands and/or possibly just a really long wait).  However, (1) I'd like to be able to use the recommended NFS setup, and (2) if using this configuration, I basically need to be able to configure the static IP automatically at boot.  As this is a bit of a different issue, I've created a new post here:

    https://e2e.ti.com/support/arm/sitara_arm/f/791/t/591518

  • So with the SD card setup, I see I should have been using single quotes instead of double quotes with the setenv command, and additionally, it's args_mmc I needed to modify, not netargs.  With those fixes, I see what looks good on startup:

    [    6.424816] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

    [    6.438391] IP-Config: Complete:

    [    6.441637]      device=eth0, hwaddr=fc:0f:4b:8c:10:52, ipaddr=192.168.254.3,mask=255.255.255.0, gw=192.168.254.2

    [    6.452128]      host=192.168.254.3, domain=, nis-domain=(none)

    [    6.458075]      bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=

    Does /etc/network/interfaces matter?  Does anything else interfere?  But I still don't see my static IP after logging in and running ifconfig.  Almost there, I think.

    -David

  • Further observations:
    I can get the 192.168.254.3 static IP on eth0 (with the SD card boot) at this point with a simple "ifup eth0" after bootup. (But it still needs to be automated, and preferably the correct way.) For what it's worth, repeating "ifconfig eth0 down" and "ifconfig eth0 up" never (?) works.

    Drawing a DHCP address on eth1 is also inconsistent. If I add "ip=:::::eth1:dhcp" to args_mmc in addition to the eth0 parameter, bootup is delayed by a couple minutes as DHCP fails. Either way, I can still get a DHCP address, but only via a variable number of "ifconfig eth1 down"/"ifconfig eth1 up" combos ("ifup eth1" does not work here).
  • Any initial thoughts on this?  Thanks.

  • Concerning not being able to ping google.com is most likely because the board does not have network proxies setup to cross your corporate firewall.

    When I try the setup you mentioned (eth0 static, eth1 udhcpc) I get the same bad address you do. If I ping ti.com I get a response since I am inside the firewall.  You will have to work with your IT department to resolve this issue.

    The user space is Systemd which has a network daemon running, systemd-networkd. The ifup command does not work in this environment. It is possible to get eth1 to come up automatically on a boot with SystemD. You will have to use the sysctl command to tell Systemd-networkd to bring up that interface and get an ip adress. I do not have a ready example at the moment that shows exact steps, you might be able to find one on the web before I can post one here.

  • Thanks for the help.

    Could you expound upon the network proxies a bit more?  That I am able to ping google.com sometimes if I raise or lower the interface or that I'm able to from a Beaglebone Black--and in neither case is there special configuration that I'm aware of--seems to suggest it's not much related to corporate IT.

    Thanks a lot for the systemd tip.  At the moment I have a /etc/systemd/network/09-eth1.network:

    [Match]
    Name=eth1

    [Network]
    DHCP=ipv4

    ...and a /etc/systemd/network/10-eth0.network:

    [Match]
    Name=eth0

    [Network]
    Address=192.168.254.3
    Gateway=192.168.254.2

    The static IP shows up, but the DHCP address does not.