Tiny Core Base > Raspberry Pi

USB gadget kernel module with RPi zero

<< < (2/18) > >>

bmarkus:

--- Quote from: johannkraus on September 09, 2016, 06:33:11 AM ---
@bmarkus -> I would be interested in having the usb modules builtin the image. They're less than 1MB in size and really provide a benefit for Pi zero users. Any more Pi zero users here?
If the modules could be builtin - Is there a way to modprobe dwc2 and g_multi and setting up usb0 ethernet automatically iff dtoverlay=dwc2 was added to config.txt? This would make an out-of-the-box pi zero gadget with serial or ethernet via usb.


--- End quote ---

gadget is not an essential functionality, it will not go to the base. However it can be useful to have when no ethernet is available. What we can do to make  kernel modules and support programs if any as tcz, test and add to the repo. If it works fine, we can decide to preinstall same way as openssh.

@johannkraus

Can you provide list of kernel modules and user space programs, files needed?

johannkraus:

--- Quote from: bmarkus on September 10, 2016, 05:43:52 AM ---gadget is not an essential functionality, it will not go to the base.

--- End quote ---
Okay -  g_ether and g_mass_storage are not. But you currently support a serial connection via ACM0 or S0. Having gadget mode in PiZero one can have a serial connection without any additional hardware or cable (despite a power usb cable connected to the usb port, which is needed anyway for power). To me this seems more essential than connecting GPIO pins and sharing ACM0  ;) But I understand your point - ACM0 is available anyway ;D

@Paul_123 My point is that gadget is built into PiZero, therefore no need to buy any additional hardware nor to make software configurations. All PiZero users get this for free.


--- Quote from: bmarkus on September 10, 2016, 05:43:52 AM ---However it can be useful to have when no ethernet is available. What we can do to make  kernel modules and support programs if any as tcz, test and add to the repo. If it works fine, we can decide to preinstall same way as openssh.
@johannkraus
Can you provide list of kernel modules and user space programs, files needed?

--- End quote ---
That would be fine. I'll have a look at the the minimal set of kernel modules needed for serial/ether/storage configurations and come back to you.
For now I can only tell what lsmod tells me
usb_f_acm               6023  1
u_serial               11369  1 usb_f_acm
usb_f_rndis            17023  1
g_multi                 5631  0
usb_f_mass_storage     39135  2 g_multi
libcomposite           49319  4 usb_f_acm,usb_f_rndis,g_multi,usb_f_mass_storage
u_ether                14023  2 usb_f_rndis,g_multi
dwc2                  109939  0
udc_core               12750  2 libcomposite,dwc2

Being lazy for serialtty I have:
Having cmdline0.txt (like cmdline3.txt) as
console=ttyGS0,115200 ...
my change to /usr/sbin/startserialtty is at line7
elif [ "${model:0:17}" = "Raspberry Pi Zero" ]; then
    port=ttyGS0
However, this does not work if dwc2, libcomposite, usb_f_acm and u_serial are not available and modprobed before. And it should only be made iff the dwc2 overlay is used. I don't find infos about used overlays in /proc/device-tree otherwise I would just add this to the elif condition above.

And being even more lazy - for ether and mass storage I have in /opt/bootlocal.sh
# ------ Put other system startup commands below this line
/sbin/modprobe dwc2 # <- but this is too late for /usr/sbin/startserialtty and had to be moved to line 2
/bin/sleep 5 # <- and this is killing performance if moved to line 2 :) Currently searching a way to avoid it.
/sbin/modprobe g_multi file=/home/tc/piusb.bin stall=0
/sbin/ifconfig usb0 192.168.100.2 up

Linkan:
Any updates on this? Is there a tcz package available to setup u_ether? I'm using a pi zero and I haven't got a USB ethernet adapter so I'd really like to use this feature.

bmarkus:

--- Quote from: Linkan on November 29, 2016, 04:36:13 PM ---Any updates on this? Is there a tcz package available to setup u_ether? I'm using a pi zero and I haven't got a USB ethernet adapter so I'd really like to use this feature.

--- End quote ---

What are you missing?

Linkan:
Not sure where I get the dwc2 overlay and how to set it up. Running modprobe dwc2 gives me "modprobe: module dwc2 not found in modules.dep". Do I need to download the linux modules package (http://tinycorelinux.net/8.x/armv6/releases/RPi/src/kernel/4.4.20-piCore+_modules.tar.xz)?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version