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.

USB error when linux start on AM6234

when I start linux by SD card,there are some errs  like below

[ 7.598476] dwc3: Unknown symbol usb_role_switch_unregister (err -2)
[ 7.598525] dwc3: Unknown symbol usb_add_gadget (err -2)
[ 7.598533] dwc3: Unknown symbol usb_role_switch_get_drvdata (err -2)
[ 7.598544] dwc3: Unknown symbol usb_get_dr_mode (err -2)
[ OK ] Listening on Load/Save RF …itch S[ 7.598553] dwc3: Unknown symbol usb_get_role_switch_default_mode (err -2)
[ 7.598565] dwc3: Unknown symbol usb_ep_set_maxpacket_limit (err -2)
[ 7.598613] dwc3: Unknown symbol usb_get_maximum_speed (err -2)
[ 7.598630] dwc3: Unknown symbol usb_get_maximum_ssp_rate (err -2)
tatus /dev/rfkill Watch.
[ 7.598722] dwc3: Unknown symbol usb_gadget_udc_reset (err -2)
[ 7.598739] dwc3: Unknown symbol usb_role_switch_register (err -2)
[ 7.598749] dwc3: Unknown symbol usb_gadget_set_state (err -2)
[ 7.598788] dwc3: Unknown symbol usb_del_gadget (err -2)
[ 7.598801] dwc3: Unknown symbol usb_initialize_gadget (err -2)
[ 7.598825] dwc3: Unknown symbol usb_gadget_giveback_request (err -2)
[ 7.598861] dwc3: Unknown symbol usb_debug_root (err -2)
[ 7.598884] dwc3: Unknown symbol usb_gadget_map_request_by_dev (err -2)
[ 7.598904] dwc3: Unknown symbol usb_gadget_unmap_request_by_dev (err -2)
[ 7.679117] dwc3: Unknown symbol usb_role_switch_unregister (err -2)
[ 7.679181] dwc3: Unknown symbol usb_add_gadget (err -2)
[ 7.679916] dwc3: Unknown symbol usb_role_switch_get_drvdata (err -2)
[ 7.679951] dwc3: Unknown symbol usb_get_dr_mode (err -2)
[ 7.679965] dwc3: Unknown symbol usb_get_role_switch_default_mode (err -2)
[ 7.679981] dwc3: Unknown symbol usb_ep_set_maxpacket_limit (err -2)
[ 7.680037] dwc3: Unknown symbol usb_get_maximum_speed (err -2)
[ 7.680059] dwc3: Unknown symbol usb_get_maximum_ssp_rate (err -2)
[ 7.680921] dwc3: Unknown symbol usb_gadget_udc_reset (err -2)
[ 7.680965] dwc3: Unknown symbol usb_role_switch_register (err -2)
[ 7.680976] dwc3: Unknown symbol usb_gadget_set_state (err -2)
[ 7.682000] dwc3: Unknown symbol usb_del_gadget (err -2)
[ 7.682028] dwc3: Unknown symbol usb_initialize_gadget (err -2)
[ 7.682066] dwc3: Unknown symbol usb_gadget_giveback_request (err -2)
[ 7.682131] dwc3: Unknown symbol usb_debug_root (err -2)
[ 7.682163] dwc3: Unknown symbol usb_gadget_map_request_by_dev (err -2)
[ 7.682196] dwc3: Unknown symbol usb_gadget_unmap_request_by_dev (err -2)

I copy modules using follow command,I do not know if it is correct.

 sudo cp -rf ./drivers/usb/* /media/lzq/rootfs/lib/modules/6.1.33-rt11-g685e771524/kernel/drivers/usb/

another question, how to set PID,VID,Endpoint of USB ? how to set about USB in device tree?

  • Yes, but the problem has not been resolved!So,I Want to know what I do if is correct ,I know how to copy kernel,but I do not kow copying modules if is correct. "sudo cp -rf ./drivers/usb/* /media/lzq/rootfs/lib/modules/6.1.33-rt11-g685e771524/kernel/drivers/usb/" ,this is my copy modules command.I hope you can give me the right dts and deconfigs about usb,and copy modules form where to where, then I will try again ,thank you !

  • After run "insmod g_ether.ko",As shown in the above figure,Has USB0 been successfully virtualized into an Ethernet port?Now,I  want to know why is USB0 not USB1?How to decide which USB port is virtual as a network port? In addition, after virtual networking, which USB driver should be installed on window10 x64 to successfully recognize and communicate?Thank you, looking forward to your complete reply!

  • Glad you made progress.

    Now,I  want to know why is USB0 not USB1?

    This "usb0" listed in ifconfig has nothing to do with USB0 or USB1 port. Similar to "eth0" or "eth1", this "usb0" is just the name of the network interface, started with index '0'.

    How to decide which USB port is virtual as a network port?

    USB gadget drivers are not relevant to USB host port. Likely your board design should have one USB port in host-only mode, the other port is is peripheral-only mode or dual-role mode. The g_ether should be on the peripheral-only or dual-role port.

    which USB driver should be installed on window10 x64 to successfully recognize and communicate?

    I don't use Windows and don't know if a USB driver is needed on Windows10. Does Windows recognize the network interface when you connect the AM62x USB port to Windows?

  • First,thank you ! I also have some question.

    1.how to set the VID,PID,Manufacture,product of USB devices in the kernel  source code ?when the kernel is started,how to view them?

    2. USB configfs Gadgets,  Is this step(for example follow) must to do?
    # init
    lsmod | grep libcomposite || modprobe libcomposite
    mount | grep configfs || mount -t configfs none /sys/kernel/config/usb_gadget
    mkdir /sys/kernel/config/usb_gadget/g1
    cd /sys/kernel/config/usb_gadget/g1
    
    # set gadget parameters
    ehco "0x1d6d" > idVendor
    ehco "0x0104" > idProduct
    mkdir strings/0x409
    echo "0123456789" > strings/0x409/serialnumber
    echo "Foo Inc" > strings/0x409/manufacturer
    echo "Bar gadget" > strings/0x409/product

    3.As shown in the above figure,My Win10 computer cannot recognize virtual USB ports.
    Can you help me try it out and tell me the correct usb driver and operating steps to used?I have test many
    kinds of usb drivers,all are not ok!

    4.In the linux system of ubuntun 22.04,how to make ubuntun recognize virtual USB ports?
  • 1.how to set the VID,PID,Manufacture,product of USB devices in the kernel  source code ?when the kernel is started,how to view them?

    I will look into the kernel code and get back to you.

    2. USB configfs Gadgets,  Is this step(for example follow) must to do?

    Yes if you use USB configfs gadget.

    3.As shown in the above figure,My Win10 computer cannot recognize virtual USB ports.
    Can you help me try it out and tell me the correct usb driver and operating steps to used?I have test many
    kinds of usb drivers,all are not ok!

    I think it is the USB gadget VID:PID issue. You might search on internet to see what VID:PID is expected by Windows 10 RNDIS driver.


    4.In the linux system of ubuntun 22.04,how to make ubuntun recognize virtual USB ports?

    Ubuntu should be able to recognize it automatically. "ifconfig" command on Ubuntu should show the USB network interface.

  • I do not think so ,Because I saw the following content in the windows driver and kernel code

    [LinuxDevices.NTx86]
    %LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_1d6b&PID_0102&MI_00

    ; Decoration for x64 architecture
    [LinuxDevices.NTamd64]
    %LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_1d6b&PID_0102&MI_00

    ; Decoration for ia64 architecture
    [LinuxDevices.NTia64]
    %LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2, USB\VID_1d6b&PID_0102&MI_00

    ablove is in window driver.

    /* Thanks to NetChip Technologies for donating this product ID.
    * It's for devices with only CDC Ethernet configurations.
    */
    #define CDC_VENDOR_NUM 0x0525 /* NetChip */
    #define CDC_PRODUCT_NUM 0xa4a1 /* Linux-USB Ethernet Gadget */

    /* For hardware that can't talk CDC, we use the same vendor ID that
    * ARM Linux has used for ethernet-over-usb, both with sa1100 and
    * with pxa250. We're protocol-compatible, if the host-side drivers
    * use the endpoint descriptors. bcdDevice (version) is nonzero, so
    * drivers that need to hard-wire endpoint numbers have a hook.
    *
    * The protocol is a minimal subset of CDC Ether, which works on any bulk
    * hardware that's not deeply broken ... even on hardware that can't talk
    * RNDIS (like SA-1100, with no interrupt endpoint, or anything that
    * doesn't handle control-OUT).
    */
    #define SIMPLE_VENDOR_NUM 0x049f
    #define SIMPLE_PRODUCT_NUM 0x505a

    /* For hardware that can talk RNDIS and either of the above protocols,
    * use this ID ... the windows INF files will know it. Unless it's
    * used with CDC Ethernet, Linux 2.4 hosts will need updates to choose
    * the non-RNDIS configuration.
    */
    #define RNDIS_VENDOR_NUM 0x0525 /* NetChip */
    #define RNDIS_PRODUCT_NUM 0xa4a2 /* Ethernet/RNDIS Gadget */

    /* For EEM gadgets */
    #define EEM_VENDOR_NUM 0x1d6b /* Linux Foundation */
    #define EEM_PRODUCT_NUM 0x0102 /* EEM Gadget */

    above is in ether.c

    currently,my ubuntu is runing in VMware,"ifconfig"command  does not show usb network interface ,I do not konw why.

  • Hello, my virtual network port has been successful. Now I would like to know how to drive USB into a standard CDC communication device and  how to change its VID 、PID、Full-Speed mode / High-Speed mode etc  in the kernel source code?thank you !

    like this 

  • Hi,

    Do you use g_ether driver or a custom USB gadget driver? Please note that if you use g_ther and modify its VID:PID, the USB host likely won't be able to recognize it.

  • What I'm asking now is another question that has nothing to do with g_ether, I don't know if it is a cunstom usb gadget driver.After plugging it in, what you see on the PC is like the following picture,then can send and receive data by PC。The PC driver is also developed by ourselves, so we need to set our own PID ,VID and mode.

  • Hi,

    What I'm asking now is another question that has nothing to do with g_ether,

    Please create a new e2e thread for the question if it is not relevant to the original g_ether question.