Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: Izeau on February 16, 2018, 07:10:45 AM

Title: Raspberry Pi Zero W and gadget mode
Post by: Izeau on February 16, 2018, 07:10:45 AM
Hello!

I’m trying to use my Raspberry Pi Zero W as gadget USB device but getting stuck. Here's what I did so far:


Now dwc2 loads just fine but I can't get g_ether, g_multi or any other module to load. Dependencies load fine (e.g. for g_ether I can see libcomposite, u_ether, usb_f_rndis in lsmod) but not the modules themselves.

Included modules:
Code: [Select]
lib
└── modules
    └── 4.9.22-piCore
        └── kernel
            └── drivers
                ├── media
                │   ├── media.ko
                │   └── v4l2-core
                │       ├── videobuf2-core.ko
                │       ├── videobuf2-memops.ko
                │       ├── videobuf2-v4l2.ko
                │       ├── videobuf2-vmalloc.ko
                │       └── videodev.ko
                └── usb
                    ├── dwc2
                    │   └── dwc2.ko
                    ├── gadget
                    │   ├── function
                    │   │   ├── u_ether.ko
                    │   │   ├── usb_f_hid.ko
                    │   │   ├── usb_f_mass_storage.ko
                    │   │   ├── usb_f_rndis.ko
                    │   │   └── usb_f_uvc.ko
                    │   ├── legacy
                    │   │   ├── g_acm_ms.ko
                    │   │   ├── g_audio.ko
                    │   │   ├── g_cdc.ko
                    │   │   ├── g_ether.ko
                    │   │   ├── g_hid.ko
                    │   │   ├── g_mass_storage.ko
                    │   │   ├── g_midi.ko
                    │   │   ├── g_multi.ko
                    │   │   ├── g_printer.ko
                    │   │   ├── g_serial.ko
                    │   │   ├── g_webcam.ko
                    │   │   └── g_zero.ko
                    │   ├── libcomposite.ko
                    │   └── udc
                    │       └── udc-core.ko
                    └── usbip
                        ├── usbip-core.ko
                        ├── usbip-host.ko
                        └── vhci-hcd.ko

The error unknown symbol in module, or unknown parameter pops up, and dmesg gives the error code -2 (ENOENT?)

I’ve tried about everything from these three threads, to no avail:


Can anyone point me in the right direction? Many thanks
Title: Re: Raspberry Pi Zero W and gadget mode
Post by: Juanito on February 16, 2018, 07:46:02 AM
What does "modinfo g_ether" give?
Title: Re: Raspberry Pi Zero W and gadget mode
Post by: Izeau on February 16, 2018, 08:34:31 AM
I'm in my dev VM right now, so don't mind the filename (which is /lib/modules/4.9.22-piCore/kernel/drivers/usb/gadget/legacy/g_ether.ko on the Pi)

Code: [Select]
filename:       /tmp/4.9.22-piCore-usb-gadgets/lib/modules/4.9.22-piCore/kernel/drivers/usb/gadget/legacy/./g_ether.ko
license:        GPL
author:         David Brownell, Benedikt Spanger
description:    RNDIS/Ethernet Gadget
srcversion:     E982E948F6BC8C5A476FB72
depends:        libcomposite,u_ether,usb_f_rndis
intree:         Y
vermagic:       4.9.22-piCore mod_unload modversions ARMv6 p2v8
parm:           idVendor:USB Vendor ID (ushort)
parm:           idProduct:USB Product ID (ushort)
parm:           bcdDevice:USB Device version (BCD) (ushort)
parm:           iSerialNumber:SerialNumber string (charp)
parm:           iManufacturer:USB Manufacturer string (charp)
parm:           iProduct:USB Product string (charp)
parm:           qmult:queue length multiplier at high/super speed (uint)
parm:           dev_addr:Device Ethernet Address (charp)
parm:           host_addr:Host Ethernet Address (charp)
parm:           use_eem:use CDC EEM mode (bool)

(I tried setting all the parameters but the result is the same)
Title: Re: Raspberry Pi Zero W and gadget mode
Post by: Juanito on February 16, 2018, 09:29:52 AM
Are all the modules on the “depends” line (recursively) present?
Title: Re: Raspberry Pi Zero W and gadget mode
Post by: Izeau on February 16, 2018, 09:39:14 AM
Yes they are (and their dependencies too). I can even see them listed in lsmod.
Title: Re: Raspberry Pi Zero W and gadget mode
Post by: Izeau on March 29, 2018, 03:02:26 AM
Hey, still no success. Does anyone have a working config?
Title: Re: Raspberry Pi Zero W and gadget mode
Post by: patrikg on March 29, 2018, 08:25:42 AM
Take a look at this thread

http://forum.tinycorelinux.net/index.php/topic,20195.0.html
Title: Re: Raspberry Pi Zero W and gadget mode
Post by: patrikg on March 29, 2018, 10:11:52 AM
And found this youtube tut.

https://www.youtube.com/watch?v=aL1pWI2K60w