eth0 not working on SABRE-SD

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

eth0 not working on SABRE-SD

Jump to solution
7,480 Views
almarto
Contributor IV

Dear all,

I can not communicate via ethernet with the iMX6 SABRE for Smart Devices. I have been working with some other iMX6 boards before and I am following the same procedure:

In my laptop running ubuntu 14.04 I have a static IP address 192.168.0.50

and the /etc/network/interfaces file in the iMX6 board is:

root@imx6qsabresd:~# cat /etc/network/interfaces

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface

auto lo

iface lo inet loopback

# Wireless interfaces

#iface wlan0 inet dhcp

#       wireless_mode managed

#       wireless_essid any

#       wpa-driver wext

#       wpa-conf /etc/wpa_supplicant.conf

#iface atml0 inet dhcp

# Wired or wireless interfaces

auto eth0

iface eth0 inet static

        address 192.168.0.30

        netmask 255.255.255.0

        gateway 192.168.0.1

#iface eth1 inet dhcp

# Ethernet/RNDIS gadget (g_ether)

# ... or on host side, usbnet and random hwaddr

#iface usb0 inet static

#       address 192.168.7.2

#       netmask 255.255.255.0

#       network 192.168.7.0

#       gateway 192.168.7.1

# Bluetooth networking

#iface bnep0 inet dhcp

As you can see, I have disabled everything except for the eth0 configuration, just to be sure there are no additional conflicts.However, after rebooting, the ifconfig config doesn't recognize the eth0 setting in /etc/network/interfaces:

root@imx6qsabresd:~# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:04:9F:03:9F:FD

          inet addr:169.254.193.228  Bcast:169.254.255.255  Mask:255.255.0.0

          inet6 addr: fe80::204:9fff:fe03:9ffd/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:39 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:9835 (9.6 KiB)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:10 errors:0 dropped:0 overruns:0 frame:0

          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:700 (700.0 B)  TX bytes:700 (700.0 B)

If I do configure it manually, eth0 link is not working properly:

root@imx6qsabresd:~# ifconfig eth0 down

root@imx6qsabresd:~# IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

root@imx6qsabresd:~# ifconfig eth0 192.168.0.30 netmask 255.255.255.0 up

fec 2188000.ethernet eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=2188000.ethernet:01, irq=-1)

root@imx6qsabresd:~# IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

libphy: 2188000.ethernet:01 - Link is Up - 1000/Full

IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

root@imx6qsabresd:~# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:04:9F:03:9F:FD

          inet addr:192.168.0.30  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::204:9fff:fe03:9ffd/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:71 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:21095 (20.6 KiB)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:10 errors:0 dropped:0 overruns:0 frame:0

          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:700 (700.0 B)  TX bytes:700 (700.0 B)

Any suggestion? It is really weird for me (I am not a linux expert at all!)

I don't know what I am missing ....

Thank you very much for your feedback!

Mensaje editado por: Alvaro Martinez

Labels (3)
0 Kudos
1 Solution
3,513 Views
almarto
Contributor IV

For those who may help ... this is what was happening:

There are two network services executing on SABRESD

The one service is Linux network service(/etc/init.d/networking).

The another service is connman (/etc/init.d/connman).

First, static ip was set by Linux network service.

And then, ip address override by connman service.

So, static ip was invalidated by connman.

I'd like to set ip address in simple way.

So, I removed connman service from init.d .

chmod -x /etc/init.d/connman

now it's only reading configuration from /etc/networking/interfaces

View solution in original post

7 Replies
3,514 Views
almarto
Contributor IV

For those who may help ... this is what was happening:

There are two network services executing on SABRESD

The one service is Linux network service(/etc/init.d/networking).

The another service is connman (/etc/init.d/connman).

First, static ip was set by Linux network service.

And then, ip address override by connman service.

So, static ip was invalidated by connman.

I'd like to set ip address in simple way.

So, I removed connman service from init.d .

chmod -x /etc/init.d/connman

now it's only reading configuration from /etc/networking/interfaces

3,513 Views
yooliang
Contributor II

Hi Alvaro Martinez

I can't find /etc/init.d/connman

or /etc/init.d/comman

The release of mine is 3.14.52 for sabre-ai

Regards!

0 Kudos
3,513 Views
hanseunglee
Contributor III

Hi yoo Liang.

I also same kernel. 3.14.52 & imx6 sabresd board.

I also not work ethernet to my PC.

Do you solve problem?

0 Kudos
3,513 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

Have you tried to set the ip from u-boot bootargs?

ip=192.168.0.30 instead of ip=dhcp

/Alejandro

3,513 Views
almarto
Contributor IV

Hi Alejandro,

Thank you for your feedback!

Yes, I had tried it before and it didn't work.

In u-boot I have set ipaddr=192.168.0.30 and netmask=255.255.255.0 and, even serverip=192.168.0.50 (my PC)

Where should I add this ip parameter that you mention?

These are my u-boot parameters:

=> printenv

baudrate=115200

boot_fdt=try

bootcmd=mmc dev ${mmcdev};if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi

bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};

bootdelay=2

ootscript=echo Running bootscript from mmc ...; source

console=ttymxc0

ethact=FEC

ethaddr=00:04:9f:03:9f:fd

ethprime=FEC

fdt_addr=0x18000000

fdt_file=imx6q-sabresd.dtb

fdt_high=0xffffffff

image=zImage

initrd_addr=0x12C00000

initrd_high=0xffffffff

ip_dyn=yes

ipaddr=192.168.0.30

loadaddr=0x12000000

loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};

loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}

loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}

mfgtool_args=setenv bootargs console=ttymxc0,115200 rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" enable_wait_mode=off

mmcargs=setenv bootargs console=${console},${baudrate} ${smp} root=${mmcroot}

mmcautodetect=yes

mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;

mmcdev=1

mmcpart=1

mmcroot=/dev/mmcblk2p2 rootwait rw

netargs=setenv bootargs console=${console},${baudrate} ${smp} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp

netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;

netmask=255.255.255.0

script=boot.scr

serverip=192.168.0.50

update_sd_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; if mmc dev ${mmcdev}; then if ${get_cmd} ${update_sd_firmware_filename}; then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} + 1; mmc write ${loadaddr} 0x2 ${fw_sz}; fi; fi

To follow with my explanation, this is what I get immediatly after boot:

root@imx6qsabresd:~# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:04:9F:03:9F:FD

          inet addr:169.254.193.228  Bcast:169.254.255.255  Mask:255.255.0.0

          inet6 addr: fe80::204:9fff:fe03:9ffd/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:39 errors:0 dropped:0 overruns:0 frame:0

          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:2648 (2.5 KiB)  TX bytes:9965 (9.7 KiB)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:10 errors:0 dropped:0 overruns:0 frame:0

          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:700 (700.0 B)  TX bytes:700 (700.0 B)

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

but my /etc/network/interfaces is:

root@imx6qsabresd:~# cat /etc/network/interfaces

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface

auto lo

iface lo inet loopback

# Wireless interfaces

#iface wlan0 inet dhcp

#       wireless_mode managed

#       wireless_essid any

#       wpa-driver wext

#       wpa-conf /etc/wpa_supplicant.conf

#iface atml0 inet dhcp

# Wired or wireless interfaces

auto eth0

iface eth0 inet static

        address 192.168.0.30

        netmask 255.255.255.0

        gateway 192.168.0.1

#iface eth1 inet dhcp

# Ethernet/RNDIS gadget (g_ether)

# ... or on host side, usbnet and random hwaddr

#iface usb0 inet static

#       address 192.168.7.2

#       netmask 255.255.255.0

#       network 192.168.7.0

#       gateway 192.168.7.1

# Bluetooth networking

#iface bnep0 inet dhcp

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

if then, I execute /etc/init.d/networking restart, then it works!

root@imx6qsabresd:~# /etc/init.d/networking restart

Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces

Reconfiguring network interfaces...

fec 2188000.ethernet eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=2188000.ethernet:01, irq=-1)

done.

root@imx6qsabresd:~# IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

libphy: 2188000.ethernet:01 - Link is Up - 1000/Full

IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

root@imx6qsabresd:~# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:04:9F:03:9F:FD

          inet addr:192.168.0.30  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::204:9fff:fe03:9ffd/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:156 errors:0 dropped:0 overruns:0 frame:0

          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:11200 (10.9 KiB)  TX bytes:21125 (20.6 KiB)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:10 errors:0 dropped:0 overruns:0 frame:0

          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:700 (700.0 B)  TX bytes:700 (700.0 B)

Any idea?

Thank you for your time and help!

alvaro

3,513 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

If you want the script interfaces to take effect I would try with

>ifdown eth0

>ifup eth0

An "ifconfig up eth0" activates eth0 but does not setup IP addresses.

Best Regards,

Alejandro

3,513 Views
almarto
Contributor IV

Thank you for your answer!

If after boot process, I execute what you have suggested or /etc/init.d/networking restart

it works ....

What could I do not to be forced to do it each time I power up the sabresd?

Regards,

alvaro

0 Kudos