I checked the script you posted to me.  That's pretty much what I'm doing, 
except I'm trying to create a
HID function device with:

mkdir g1/function/hid.0

Which does "create" the device.  I then have to provide some kind of HID 
report descriptor, which I do
based on one that has worked for me before, but somehow, when I perform the 
final step, I get a crash
when libcomposite tries to call the f_hid.c (the function file which I 
believe is contained in usb_f_hid driver).
Following the crash, it appears that it isn't getting an endpoint back from 
usb_ep_autoconfig ... and I don't
know at this point, why that would be the case.

The other drivers, I believe, do seem to work, or at least I was able to 
originally (before I needed to use the
OTG port as a device port) connect to the beaglebone black (that's the 
board I'm using, btw) over the regular
USB-IP interface.  So when I wasn't able to configure the HID interface 
properly, I became confused.

I had a script that looked like this:
-----------------------------------------------
modprobe libcomposite
cd /sys/kernel/config/usb_gadget


mkdir g1


cd g1


echo 0x1234 > idVendor
echo 0x5678 > idProduct


echo 0x0100 > bcdDevice
echo 0x0200 > bcdUSB


mkdir -p strings/0x409


echo "0123456789" > strings/0x409/serialnumber
echo "Manufacturer Inc." > strings/0x409/manufacturer
echo "My HID Dev" > strings/0x409/product


mkdir -p functions/hid.0


echo "Config 1: MY HID Cfg" > configs/c.1/strings/0x409/configuration
echo 250 > configs/c.1/MaxPower


echo 1 > functions/hid.0/protocol
echo 1 > functions/hid.0/subclass
echo 9 > functions/hid.0/report_length


cat ~/my_hid_desc.bin > functions/hid.0/report_desc


ln -s functions/hid.0 configs/c.1


ls /sys/class/udc > UDC



----------------------------------------
At the last, it fails:

udc musb-hdrc.0.auto: registering UDC driver [g1]
configfs-gadget gadget: adding 'hid'/dc77eb7c to config 'c'/dc7298a8
Unable to handle kernel NULL pointer dereference at virtual address 00000002
pgd = dab90000
[00000002] *pgd=9ab55831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT THUMB2
Modules linked in: usb_f_hid libcomposite gadgetfs musb_dsps musb_hdrc 
phy_am335x udc_core phy_am335x_control phy_generic ... other drivers ...
CPU: 0 PID: 1247 Comm: ls Not tainted 4.9.0-rc6-armv7-devel-r62 #5
Hardware name: Generic AM33XX (Flattened Device Tree)
task: da82b900 task.stack: dc6a6000
PC is at alloc_ep_req_0x1b/0x58 [libcomposite]
LR is at 0x0

And the stack dump continues.

On Monday, October 31, 2016 at 5:47:06 PM UTC-4, RobertCNelson wrote:
>
> Hey Everyone, 
>
> Over the weekend, TI imported and tagged there first v4.9.x branch: 
>
>
> http://git.ti.com/gitweb/?p=ti-linux-kernel/ti-linux-kernel.git;a=shortlog;h=refs/heads/ti-linux-4.9.y
>  
>
> I've added our patchset, overlays are broken past the first i2c 
> address:  (havn't tried with a board plugged in) 
>
> debian@beaglebone:~$ dmesg | grep bone 
> [    2.101727] bone_capemgr bone_capemgr: Baseboard: 
> 'A335BNLT,00C0,2516BBBK2626' 
> [    2.101753] bone_capemgr bone_capemgr: 
> compatible-baseboard=ti,beaglebone-black - #slots=4 
> [    2.101796] bone_capemgr bone_capemgr: Failed to add slot #1 
> [    2.126911] bone_capemgr bone_capemgr: Baseboard: 
> 'A335BNLT,00C0,2516BBBK2626' 
> [    2.126940] bone_capemgr bone_capemgr: 
> compatible-baseboard=ti,beaglebone-black - #slots=4 
> [    2.126971] bone_capemgr bone_capemgr: Failed to add slot #1 
> [    2.360973] bone_capemgr bone_capemgr: Baseboard: 
> 'A335BNLT,00C0,2516BBBK2626' 
> [    2.361012] bone_capemgr bone_capemgr: 
> compatible-baseboard=ti,beaglebone-black - #slots=4 
>
> cpufreq is broken, this should be fixed pretty soon.. 
>
> HDMI-Audio: this is new and went mainline in v4.9.x-rc, fingers 
> crossed, it should work so please test. ;)  ( i finally have a lcd 
> monitor (with audio) that i can finally test with. .;) ) 
>
> pru: nothing yet.. 
>
> eqep: needs porting.. 
>
> Kernel should hit the apt repo in a day or two, i'll reply to this 
> message when ready... 
>
> cd /opt/scripts/tools/ 
> git pull 
> sudo ./update_kernel.sh --ti-channel --lts-4_9 
>
> (no rt yet) 
>
> SRC is here: 
>
> https://github.com/beagleboard/linux/tree/4.9 
>
> https://github.com/beagleboard/linux/commits/4.9 
>
> The best way to build it is via yakbuild: 
>
> git clone https://github.com/RobertCNelson/yakbuild 
> cd ./yakbuild/ 
> cp recipe.sh.v4.9.x.sample recipe.sh 
> ./build_kernel.sh 
>
> While the dtb's can be built/tested via dtb-rebuilder 
>
> #this is one line.. 
> git clone -b 4.9-ti https://github.com/RobertCNelson/dtb-rebuilder/ 
> cd ./dtb-rebuilder/ 
> make 
>
> status 
> v4.4.x-ti - still supported and on-going working 
> v4.1.x-ti - maintenance-only please upgrade to v4.4.x-ti 
> v3.14.x-ti - maintenance (really eol) 
> v3.8.13-bone - maintenance, probably never EOL... (i see another gcc6 
> patch coming on the horizon). ;) 
>
> Regards, 
>
> -- 
> Robert Nelson 
> https://rcn-ee.com/ 
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/bf37d8f0-ae9e-4c84-b0d8-c3bbeceebe2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to