Tiny Core Base > Raspberry Pi
USB gadget kernel module with RPi zero
patrikg:
USB uart adapter connected to gpio pins.
Add console to cmdline.
johannkraus:
--- Quote from: Linkan on December 15, 2016, 02:57:39 PM ---Sorry but I just can't figure it out. I have enabled the `dwc2` overlay in config.txt and I created a tcz package with the following modules added:
--- End quote ---
This happened to me when I added dtoverlay=dwc2 to the last line of config.txt. As some lines above there is a [RPI3] statement your overlay will not be loaded on a RPI0.
So either move this some lines up to the [ALL] section or better add a [RPI0] statement before this line.
--- Quote ---I also put `modules-load=dwc2,g_ether` after `rootwait` in cmdline.txt and then I reboot my rpi. It doesn't show up as a usb device on my machine. Is there something I forgot to do?
--- End quote ---
As far as I can tell adding modules-load to cmdline.txt will not work with Tiny Core Linux. This is a feature only available in Raspbian. So please add modprobe to /opt/bootlocal.sh.
As soon as g_multi is in lsmod you can setup usb0 via ifconfig. Your keyboard will still work after modprobing dwc2, g_multi, ... (until you unplug ;) ).
Linkan:
Alright, have not had much time to work on this project lately but I successfully added the modules and it seems like dwc2 module is loaded on boot now. Here is the output of lsmod:
--- Code: ---usb_f_rndis 17023 0
u_ether 14023 1 usb_f_rndis
libcomposite 49319 1 usb_f_rndis
dwc2 109939 0
udc_core 12750 2 libcomposite,dwc2
squashfs 32160 62
i2c_bcm2708 5740 0
spi_bcm2835 7424 0
bcm2835_gpiomem 3823 0
bcm2835_wdt 4133 0
zram 22461 1
uio_pdrv_genirq 3718 0
zsmalloc 14329 1 zram
lz4_compress 3289 1 zram
uio 10230 1 uio_pdrv_genirq
--- End code ---
My problem now is that g_ether fails to load properly, here is the output of dmesg:
--- Code: ---[ 22.042841] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[ 22.573179] dwc2 20980000.usb: DWC OTG Controller
[ 22.573255] dwc2 20980000.usb: new USB bus registered, assigned bus number 1
[ 22.573318] dwc2 20980000.usb: irq 33, io mem 0x00000000
[ 22.573590] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 22.573609] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 22.573622] usb usb1: Product: DWC OTG Controller
[ 22.573634] usb usb1: Manufacturer: Linux 4.4.20-piCore+ dwc2_hsotg
[ 22.573645] usb usb1: SerialNumber: 20980000.usb
[ 22.577937] hub 1-0:1.0: USB hub found
[ 22.578019] hub 1-0:1.0: 1 port detected
[ 27.653659] g_ether 20980000.usb: failed to start g_ether: -2
--- End code ---
This is the output I get from trying to manually do: sudo modprobe g_ether
--- Code: ---modprobe: can't load module g_ether (kernel/drivers/usb/gadget/legacy/g_ether.ko): unknown symbol in module, or unknown parameter
--- End code ---
bmarkus:
Check the kernel module dependencies. You have a missing module.
Linkan:
@bmarkus
I checked the modules.dep file and it reported the following dependencies (same out as running modprobe --show-depends g_ether):
--- Code: ---kernel/drivers/usb/gadget/function/usb_f_rndis.ko
kernel/drivers/usb/gadget/libcomposite.ko
kernel/drivers/usb/gadget/udc/udc-core.ko
kernel/drivers/usb/gadget/function/u_ether.ko
--- End code ---
Here is the files I have in my package:
--- Code: ---`-- lib
`-- modules
`-- 4.4.39-piCore+
|-- kernel
| `-- drivers
| `-- usb
| |-- dwc2
| | `-- dwc2.ko
| `-- gadget
| |-- function
| | |-- u_ether.ko
| | `-- usb_f_rndis.ko
| |-- legacy
| | `-- g_ether.ko
| |-- libcomposite.ko
| `-- udc
| `-- udc-core.ko
`-- modules.dep
--- End code ---
I couldn't find any other dependencies in modules.dep that g_ether requires or any of its dependencies.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version