Use USB Ethernet (RNDIS host) in iMX8 MEK with Android P(9.0)

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

Use USB Ethernet (RNDIS host) in iMX8 MEK with Android P(9.0)

3,760 Views
Jinho-Nam
Contributor I

Hello,

I have been trying to connect Android 9(master, host) in iMX8QuadXPlus MEK board with the Ubuntu board (sub, device) throught the usb port.
To use ethernet function on USB, I rebuilt the Adroid kernel with the configuration CONFIG_USB_NET_RNDIS_HOST.
The Ubuntu board have been installed USB RNDIS gadget driver for usb ethernet.
I already checked to operate the Ubuntu board (other board) successfully to connect the HOST PC. (Windows and Ubuntu both)

When I connected USB between two boards, I saw the debug messages on iMX8 Android machine as below.

[ 7938.107680] usb 1-1.4: new high-speed USB device number 5 using cdns-usb3
[ 7938.212464] usb 1-1.4: New USB device found, idVendor=18d1, idProduct=4ee2
[ 7938.219383] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7938.226738] usb 1-1.4: Product: RNDIS Ethernet Data
[ 7938.231652] usb 1-1.4: Manufacturer: RNDIS Communications Control
[ 7938.237789] usb 1-1.4: SerialNumber: RNDIS
[ 7938.258632] rndis_host 1-1.4:1.0 usb1: register 'rndis_host' at usb-xhci-cdns3-1.4, RNDIS device, 3a:86:80:db:1f:cc


# ifconfig -a
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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0

...

usb1 Link encap:Ethernet HWaddr 3a:86:80:db:1f:cc Driver rndis_host
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0


I confirmed the new interface was created as usb1 and set the ip address information as below.

# ifconfig usb1 192.168.5.12 netmask 255.255.255.0 broadcast 192.168.5.255 up
# ifconfig
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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0

eth0 Link encap:Ethernet HWaddr 00:04:9f:05:c8:84 Driver fec
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:0

usb1 Link encap:Ethernet HWaddr 3a:86:80:db:1f:cc Driver rndis_host
inet addr:192.168.5.12 Bcast:192.168.5.255 Mask:255.255.255.0
inet6 addr: fe80::3886:80ff:fedb:1fcc/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 TX bytes:1122

The Ubuntu machine has an ip address 192.168.5.5 so I try to ping
ping 192.168.5.5
connect: Network is unreachable


I met the message "connect: Network is unreachable"
I don't know why it happens and What I will do more.
I hope anyone help me.

Thanks in advance.

0 Kudos
4 Replies

3,741 Views
IvanRuiz
NXP Employee
NXP Employee

Hello,

 

This i.MX product does not support USB on the go, reason why the USB module may not be working properly.

 

BR,

Ivan.

0 Kudos

1,333 Views
chadA
Contributor III

Hi Ivan,

I think you made a mistake.

According to@Jinho-Nam's description, looks like he wants to use a USB-Ethernet first, then connect the 2 board with Ethernet, not USB.

If he want to use USB to connect them directly, OTG is needed. But for ethernet, I think there is no need to consider the USB's OTG function. So now the @Jinho-Nam 's problem should be the USB-Ethernet, it does not work well. For the USB-Ethernet, I think OTG is not the necessary.

Now I meet the same problem with Jinho-Nam, I tried to use a USB-Ethernet on iMX8MM EVK with Android9.0, same result like @Jinho-Nam , ping always prompt "Network is unreachable" . And I am looking for a issue now.

Thanks

Chad

0 Kudos

3,704 Views
Jinho-Nam
Contributor I

Thanks for your reply.

Could you recommend what solution can I use with the USB on the go instead of iMX8?

0 Kudos

3,696 Views
IvanRuiz
NXP Employee
NXP Employee

Hi,

 

You may refer to the i.MX 8 products in the following link depending on the features you need from the processor: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-proces...

 

In order to check the OTG feature, please go to the datasheet, e.g., for the i.MX 8M, OTG is supported according to datasheet: https://www.nxp.com/docs/en/data-sheet/IMX8MDQLQIEC.pdf

 

Hope it helps!

 

BR,

Ivan.

0 Kudos