Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: pic0refan on November 19, 2018, 08:42:33 AM
-
I was able to setup RPi Zero in OTG mode with Ethernet on, and now i'm trying to enable HID module ( emulate keyboard ).
Module Size Used by Not tainted
dm9601 7137 0
usb_f_ecm 7416 1
g_ether 5005 0
usb_f_rndis 17035 2 g_ether
libcomposite 50185 3 usb_f_ecm,g_ether,usb_f_rndis
u_ether 13511 3 usb_f_ecm,g_ether,usb_f_rndis
i2c_dev 6802 0
sr9700 6190 0
dwc2 122591 0
udc_core 40439 5 usb_f_ecm,usb_f_rndis,libcomposite,u_ether,dwc2
squashfs 33444 17
zram 20761 1
zsmalloc 17097 1 zram
i2c_bcm2835 6337 0
spi_bcm2835 7468 0
bcm2835_gpiomem 3751 0
fixed 3029 0
uio_pdrv_genirq 3718 0
uio 10281 1 uio_pdrv_genirq
and still modprobe complains about no such device
sudo modprobe g_hid
modprobe: can't load module g_hid (kernel.tclocal/drivers/usb/gadget/legacy/g_hid.ko): No such device
modinfo:
modinfo g_hid
filename: /lib/modules/4.9.22-piCore/kernel.tclocal/drivers/usb/gadget/legacy/g_hid.ko
author: Fabien Chouteau, Peter Korsgaard
description: HID Gadget
license: GPL
parm: iProduct:USB Product string
parm: iManufacturer:USB Manufacturer string
parm: iSerialNumber:SerialNumber string
parm: bcdDevice:USB Device version (BCD)
parm: idProduct:USB Product ID
parm: idVendor:USB Vendor ID
srcversion: B2AEAA7314C9326B59C1974
depends: libcomposite
intree: Y
vermagic: 4.9.22-piCore mod_unload modversions ARMv6 p2v8
and the kernel version itself:
uname -a
Linux box 4.9.22-piCore #1 Sat Apr 15 15:30:03 UTC 2017 armv6l GNU/Linux
What am I missing here?
Thank you!
-
does this link help:
http://isticktoit.net/?p=1383
-
I tried that first ( in fact this is my bookmark for doing the same for Arch Linux :) ) and got stuck over "/sys/kernel/config/usb_gadget/" - this folder doesn't exist.
So I was looking on what is missing there, and stumbled over g_hid.
-
Hi pic0refan
sudo modprobe g_hid
modprobe: can't load module g_hid (kernel.tclocal/drivers/usb/gadget/legacy/g_hid.ko): No such device
If you look in here you'll find it includes:
/lib/modules/4.9.22-piCore/kernel/drivers/usb/gadget/legacy/g_hid.ko
-
Hi pic0refan
Sorry, my previous post should have said:
If you look in here:
http://tinycorelinux.net/9.x/armv6/releases/RPi/src/kernel/4.9.22-piCore_modules.tar.xz
you'll find it includes:
/lib/modules/4.9.22-piCore/kernel/drivers/usb/gadget/legacy/g_hid.ko
-
That's right, and I have this file in
/lib/modules/4.9.22-piCore/kernel.tclocal/drivers/usb/gadget/legacy/g_hid.ko -> /tmp/tcloop/usb-gadget-4.9.22-piCore/usr/local/lib/modules/4.9.22-piCore/kernel/drivers/usb/gadget/legacy/g_hid.ko
It doesn't seem that I have no driver, it seems that for some reason it can't be loaded. After some googling it looks like OTG depends on configfs to be operated, so it will be accessible via /sys/kernel/config/usb_gadget, but in my case there's no such folder.
Does piCore have configfs module?
-
Oh found this one :
http://forum.tinycorelinux.net/index.php/topic,21996.msg139130.html#msg139130 (http://forum.tinycorelinux.net/index.php/topic,21996.msg139130.html#msg139130):
mount -t configfs none /sys/kernel/config
Now I have
ls /sys/kernel/config/
device-tree/ usb_gadget/
still modprobe g_hid doesn't work.
-
Some more insignts - with strace I've got this:
02:12:08 open("/proc/cmdline", O_RDONLY|O_LARGEFILE) = 3
02:12:08 fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
02:12:08 read(3, "bcm2708_fb.fbwidth=656 bcm2708_f"..., 1024) = 249
02:12:08 read(3, "", 775) = 0
02:12:08 close(3) = 0
02:12:08 open("/proc/cmdline", O_RDONLY|O_LARGEFILE) = 3
02:12:08 fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
02:12:08 read(3, "bcm2708_fb.fbwidth=656 bcm2708_f"..., 1024) = 249
02:12:08 read(3, "", 775) = 0
02:12:08 close(3) = 0
02:12:08 open("/proc/cmdline", O_RDONLY|O_LARGEFILE) = 3
02:12:08 fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
02:12:08 read(3, "bcm2708_fb.fbwidth=656 bcm2708_f"..., 1024) = 249
02:12:08 read(3, "", 775) = 0
02:12:08 close(3) = 0
02:12:08 open("kernel.tclocal/drivers/usb/gadget/legacy/g_hid.ko", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
02:12:08 finit_module(3, "", 0) = -1 ENODEV (No such device)
02:12:08 close(3) = 0
02:12:08 open("kernel.tclocal/drivers/usb/gadget/legacy/g_hid.ko", O_RDONLY|O_LARGEFILE) = 3
02:12:08 read(3, "\177E", 2) = 2
02:12:08 _llseek(3, -2, [0], SEEK_CUR) = 0
02:12:08 fstat64(3, {st_mode=S_IFREG|0644, st_size=10916, ...}) = 0
02:12:08 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\1\0(\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 11264) = 10916
02:12:08 read(3, "", 348) = 0
02:12:08 close(3) = 0
02:12:08 init_module(0x1fc5128, 10916, "") = -1 ENODEV (No such device)
02:12:08 write(2, "modprobe: can't load module g_hi"..., 102) = 102
02:12:08 exit_group(1) = ?
02:12:08 +++ exited with 1 +++
looks like something is definitely missing.
-
I created a custom Linux kernel with some userlevel tools with buildroot, verified that all devices work fine.
Is there an easy way to update kernel / userland in tinycore?
E.g - I already have the kernel and working image for RPi, so I'd rather update the modules / binaries from that build system I've got.
-
Is your custom kernel the same kernel version or a different one?
-
It's the newer one, 4.14.39
I presume that I need to package the entire thing somehow (like the content of output/target or images/sdcard.img ).
-
Assuming that you are using piCore-10.0beta3a, which has a 4.14.33 kernel, you would need to:
* replace kernel41433.img (Linux kernel ARM boot executable zImage) with your kernel41439.image
* replace 10.0beta3a.gz (gzipped ASCII cpio archive) with your modified 10.0beta3a.gz
..where the modified cpio archive would replace /lib/modules/4.14.33-piCore with /lib/modules/4.14.39-piCore and regenerate /lib/modules/$KERNEL/modules*