USB_RNDS not working

Hi,

I’m using Colibri VF61 V1.2A Colibri-VF_LXDE-Image 2.7b5

While trying to debug using usb there is no usb configuration (usb0) in ifconfig.

with regards,
sreemadhav

Hi Sreemadhav

Could you provide some details about you application and your issue?

While trying to debug using usb there is no usb configuration (usb0) in ifconfig.
Is this on your host or target (module)?

Hi @jaski.tx

I had connected the module to Host system through USB_RNDS inorder to debug a program. But while connecting via USB_RNDS port, there is no usb configuration(usb0) in ifconfig of target board.
So the program cannot be debugged since there is no connection.

which carrier board are you using? what is the output of your ifconfig?

Hi @jaski.tx

I’m using Colibri Evaluation board V3.2A

Output of ifconfig looks like:

root@colibri-vf:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:2D:2D:4E:FE  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:113 (113.0 B)  TX bytes:8990 (8.7 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1%1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:337 errors:0 dropped:0 overruns:0 frame:0
          TX packets:337 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:24856 (24.2 KiB)  TX bytes:24856 (24.2 KiB)

Hello

I tried the following image: Colibri-VF_LXDE-Image 2.7-20180104. And there I can see the the usb0 in the ifconfig. Could you try this image?

Hi @jaski.tx

But I’m using the image built using bitbake command and added the required layers. Can you please help me to have such configuration in my image.
I had already tried with Colibri-VF_LXDE-Image 2.7-20180104 and it works fine.

Could you try a build without any changes and check if usb0 works? If yes, then you can introduce your changes to the required layers.

Hi @jaski.tx

I had already built three times due to various other issues. Change in layers include adding the following in local.conf.

IMAGE_INSTALL_append = " qtbase qtbase-plugins qtserialbus qtserialport qtdeclarative qtdeclarative-qmlplugins qtdeclarative-plugins qtmultimedia qtconnectivity qtconnectivity-qmlplugins qtwebsockets qtgraphicaleffects qtgraphicaleffects-qmlplugins qtsvg qtsvg-plugins qtimageformats qtquickcontrols qtquickcontrols2 liberation-fonts libsoc tslib qtcharts qtcharts-dev"

PACKAGECONFIG_FONTS_append_pn-qtbase = " fontconfig"

PACKAGECONFIG_append_pn-qtbase = " accessibility tslib"

I had already built three times due to various other issues. Change in layers include adding the following in local.conf.

You need to find out, with which build the usb0 in ifconfig starts to be missing and what changes were done from one to other build?

Could you send the output of dmesg | grep usb and lsusb -t?

One common case which could show the behavior if there is a rootfs/kernel mismatch. Can you check whether the kernel modules get loaded? There should be some kernel modules loaded when using lsmod.

Hi @stefan.tx

lsmod output looks like

root@colibri-vf:/dev# lsmod
Module Size Used by
virtio_rpmsg_bus 11524 0
usb_f_rndis 15546 0
u_ether 11913 1 usb_f_rndis
vf610_rpmsg 4302 0
vf610_cm4_rproc 3243 0
remoteproc 21812 1 vf610_cm4_rproc
virtio 7411 3 remoteproc,virtio_rpmsg_bus,vf610_rpmsg
virtio_ring 10919 3 remoteproc,virtio_rpmsg_bus,vf610_rpmsg
libcomposite 43508 1 usb_f_rndis
configfs 23717 3 usb_f_rndis,libcomposite
root@colibri-vf:/dev#

Hi @jaski.tx

dmesg | grep usb output looks like:

root@colibri-vf:~# dmesg | grep usb
[ 0.140851] usbcore: registered new interface driver usbfs
[ 0.141021] usbcore: registered new interface driver hub
[ 0.141227] usbcore: registered new device driver usb
[ 1.160107] usbcore: registered new interface driver usb-storage
[ 1.174123] usbcore: registered new interface driver usbserial
[ 1.187586] usbcore: registered new interface driver usbserial_generic
[ 1.201452] usbserial: USB Serial support registered for generic
[ 1.214802] usbcore: registered new interface driver ftdi_sio
[ 1.227811] usbserial: USB Serial support registered for FTDI USB Serial Devie
[ 1.249429] usbcore: registered new interface driver pl2303
[ 1.262412] usbserial: USB Serial support registered for pl2303
[ 1.278081] 40034000.usb supply vbus not found, using dummy regulator
[ 1.567125] usbcore: registered new interface driver usbhid
[ 1.581484] usbhid: USB HID core driver
[ 1.943230] 40034000.usb supply vbus not found, using dummy regulator
[ 2.464019] usb 2-1: new high-speed USB device number 2 using ci_hdrc
root@colibri-vf:~#

also lsusb -t output as:

root@colibri-vf:~# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ci_hdrc/1p, 480M
|__ Port 1: Dev 2, If 0, Class=, Driver=hub/4p, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ci_hdrc/1p, 480M

The output looks indeed good, the necessary kernel modules have been loaded successfully.

In general, the USB RNDIS configuration is loaded through an utility called gadget-import. The configuration is stored in /etc/usbg/g1.schema which is loaded by the usbg.service.

Can you check the status/log of this service?

systemctl status usbg.service
journalctl -u usbg.service

The log for the above mentioned service shown as:

root@colibri-vf:~#  systemctl status usbg.service                                                                                                                                           
��● usbg.service - Load default USB gadget schema g1.schema
 Loaded: loaded (/lib/systemd/system/usbg.service; enabled; vendor preset: ena 
Active: failed (Result: exit-code) since Fri 2018-04-20 05:16:15 UTC; 3 days 
      Process: 140 ExecStart=/usr/bin/gadget-import g1 /etc/usbg/g1.schema (code=exi
 Main PID: 140 (code=exited, status=234/MAKE_STARTER)

Apr 20 05:16:13 colibri-vf systemd[1]: Starting Load default USB gadget schema g
Apr 20 05:16:13 colibri-vf gadget-import[140]: Error on import gadget
Apr 20 05:16:13 colibri-vf gadget-import[140]: Error: USBG_ERROR_INVALID_TYPE : 
Apr 20 05:16:15 colibri-vf systemd[1]: usbg.service: Main process exited, code=e
Apr 20 05:16:15 colibri-vf systemd[1]: Failed to start Load default USB gadget s
Apr 20 05:16:15 colibri-vf systemd[1]: usbg.service: Unit entered failed state.
Apr 20 05:16:15 colibri-vf systemd[1]: usbg.service: Failed with result 'exit-co

root@colibri-vf:~#  journalctl -u usbg.service
-- Logs begin at Fri 2018-04-20 05:16:09 UTC, end at Mon 2018-04-23 09:16:16 UTC
Apr 20 05:16:12 colibri-vf systemd[1]: Starting Load default USB gadget schema g
-- Reboot --
Apr 20 05:16:13 colibri-vf systemd[1]: Starting Load default USB gadget schema g
-- Reboot --
Apr 20 05:16:13 colibri-vf systemd[1]: Starting Load default USB gadget schema g
-- Reboot --
Apr 20 05:16:13 colibri-vf systemd[1]: Starting Load default USB gadget schema g
-- Reboot --
Apr 20 05:16:13 colibri-vf gadget-import[155]: Error on import gadget
Apr 20 05:16:13 colibri-vf gadget-import[155]: Error: USBG_ERROR_INVALID_TYPE : 
-- Reboot --
Apr 20 05:16:13 colibri-vf gadget-import[147]: Error on import gadget
Apr 20 05:16:13 colibri-vf gadget-import[147]: Error: USBG_ERROR_INVALID_TYPE : 
-- Reboot --
Apr 20 05:16:14 colibri-vf gadget-import[152]: Error on import gadget
Apr 20 05:16:14 colibri-vf gadget-import[152]: Error: USBG_ERROR_INVALID_TYPE : 
-- Reboot --
Apr 20 05:16:14 colibri-vf gadget-import[146]: Error on import gadget
Apr 20 05:16:14 colibri-vf gadget-import[146]: Error: USBG_ERROR_INVALID_TYPE : 
-- Reboot --
Apr 20 05:16:14 colibri-vf systemd[1]: Starting Load default USB gadget schema g
-- Reboot --
Apr 20 05:16:14 colibri-vf systemd[1]: Starting Load default USB gadget schema g
-- Reboot --
Apr 20 05:16:15 colibri-vf systemd[1]: usbg.service: Main process exited, code=e
Apr 20 05:16:15 colibri-vf systemd[1]: Failed to start Load default USB gadget s
Apr 20 05:16:15 colibri-vf systemd[1]: usbg.service: Unit entered failed state.
Apr 20 05:16:15 colibri-vf systemd[1]: usbg.service: Failed with result 'exit-co
-- Reboot --
Apr 23 06:42:00 colibri-vf gadget-import[187]: Error on import gadget
Apr 23 06:42:00 colibri-vf gadget-import[187]: Error: USBG_ERROR_INVALID_TYPE : 
-- Reboot --
Apr 23 06:42:00 colibri-vf gadget-import[195]: Error on import gadget
Apr 23 06:42:00 colibri-vf gadget-import[195]: Error: USBG_ERROR_INVALID_TYPE : 
-- Reboot --
Apr 23 06:42:00 colibri-vf systemd[1]: usbg.service: Main process exited, code=e
-- Reboot --
Apr 23 06:42:00 colibri-vf systemd[1]: usbg.service: Main process exited, code=e
Apr 23 06:42:00 colibri-vf systemd[1]: Failed to start Load default USB gadget s
-- Reboot --
Apr 23 06:42:00 colibri-vf systemd[1]: Failed to start Load default USB gadget s
Apr 23 06:42:00 colibri-vf systemd[1]: usbg.service: Unit entered failed state.
Apr 23 06:42:00 colibri-vf systemd[1]: usbg.service: Failed with result 'exit-co
-- Reboot --
Apr 23 06:42:00 colibri-vf systemd[1]: usbg.service: Unit entered failed state.
Apr 23 06:42:00 colibri-vf systemd[1]: usbg.service: Failed with result 'exit-co
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Main process exited, code=e
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Main process exited, code=e
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: Starting Load default USB gadget schema g
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: Failed to start Load default USB gadget s
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: Failed to start Load default USB gadget s
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Main process exited, code=e
Apr 23 06:42:01 colibri-vf systemd[1]: Failed to start Load default USB gadget s
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Unit entered failed state.
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Failed with result 'exit-co
-- Reboot --
Apr 20 05:16:13 colibri-vf systemd[1]: Starting Load default USB gadget schema g
Apr 20 05:16:13 colibri-vf gadget-import[140]: Error on import gadget
Apr 20 05:16:13 colibri-vf gadget-import[140]: Error: USBG_ERROR_INVALID_TYPE : 
Apr 20 05:16:15 colibri-vf systemd[1]: usbg.service: Main process exited, code=e
Apr 20 05:16:15 colibri-vf systemd[1]: Failed to start Load default USB gadget s
Apr 20 05:16:15 colibri-vf systemd[1]: usbg.service: Unit entered failed state.
Apr 20 05:16:15 colibri-vf systemd[1]: usbg.service: Failed with result 'exit-co
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Unit entered failed state.
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Failed with result 'exit-co
-- Reboot --
Apr 20 05:16:13 colibri-vf systemd[1]: Starting Load default USB gadget schema g
Apr 20 05:16:13 colibri-vf gadget-import[152]: Error on import gadget
Apr 20 05:16:13 colibri-vf gadget-import[152]: Error: USBG_ERROR_INVALID_TYPE : 
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Main process exited, code=e
Apr 23 06:42:01 colibri-vf systemd[1]: Failed to start Load default USB gadget s
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Unit entered failed state.
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Unit entered failed state.
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Failed with result 'exit-co
-- Reboot --
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Failed with result 'exit-co
-- Reboot --
Apr 23 06:42:01 colibri-vf gadget-import[213]: Error on import gadget
Apr 23 06:42:01 colibri-vf gadget-import[213]: Error: USBG_ERROR_INVALID_TYPE : 
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Main process exited, code=e
Apr 23 06:42:01 colibri-vf systemd[1]: Failed to start Load default USB gadget s
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Unit entered failed state.
Apr 23 06:42:01 colibri-vf systemd[1]: usbg.service: Failed with result 'exit-co

root@colibri-vf:~#

Hm, it seems that the gadget configuration is corrupted or does not work for some reason.

We did some changes in libusbgx recently, do you have all the latest changes from meta-toradex-bsp-common?
http://git.toradex.com/cgit/meta-toradex-bsp-common.git/log/?h=morty

Can you check the content of the /etc/usbg/g1.schema configuration file?

hi @Sreemadhav

Stefan is right. You just need to update to the latest commit from morty branch.

One way to do this is the following:

  1. Go to the oe-core2_7/layers/meta-toradex-bsp-common folder
  2. Then type git fetch repo
  3. then type git checkout morty
  4. Then type git pull

After this you can start again the openembedded build.

hi @jaski.tx

On executing above mentioned commands, following error occurred. Please find me a solution.

madhav@madhav-HP-15-Notebook-PC:~/oe-core1/layers/meta-toradex-bsp-common$ git fetch repo
From http://git.toradex.com/meta-toradex-bsp-common

  • 2aae320…ec56ca1 rocko-next → repo/rocko-next (forced update)

madhav@madhav-HP-15-Notebook-PC:~/oe-core1/layers/meta-toradex-bsp-common$ git pull
fatal: No remote repository specified. Please, specify either a URL or a
remote name from which new revisions should be fetched.

hi sreemadhav,
i updated my last commit. I forgot that you have to switch to morty git branch first.