On Fri, Dec 16, 2016 at 4:31 PM, roboknight <[email protected]> wrote:
> 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.

no change: 4.9.0-bone3

I'm still figuring out usb configfs, so no pointers yet. ;)

[   23.696925] Unable to handle kernel NULL pointer dereference at
virtual address 00000002
[   23.705155] pgd = da914000
[   23.707872] [00000002] *pgd=9c60b831, *pte=00000000, *ppte=00000000
[   23.714215] Internal error: Oops: 17 [#1] THUMB2
[   23.718851] Modules linked in: usb_f_hid libcomposite
cpufreq_powersave cpufreq_conservative cpufreq_ondemand
cpufreq_userspace snd_soc_hdmi_codec nls_ascii nls_cp437
snd_soc_simple_card snd_soc_simple_card_utils omap_sham omap_aes
crypto_engine snd_soc_davinci_mcasp snd_soc_omap snd_soc_edma omap_rng
snd_soc_core rng_core tilcdc snd_pcm_dmaengine tps65217_charger
snd_pcm evdev snd_seq snd_seq_device snd_timer snd tda998x soundcore
omap_wdt uio_pdrv_genirq uio leds_gpio cpufreq_dt
[   23.761803] CPU: 0 PID: 1159 Comm: ls Not tainted 4.9.0-bone3 #1
[   23.767831] Hardware name: Generic AM33XX (Flattened Device Tree)
[   23.773947] task: db4440c0 task.stack: db70e000
[   23.778583] PC is at alloc_ep_req+0x1b/0x58 [libcomposite]
[   23.784088] LR is at 0x0
[   23.786629] pc : [<bf94027c>]    lr : [<00000000>]    psr: 60000033
[   23.786629] sp : db70fde0  ip : 00000000  fp : db70ab1c
[   23.798154] r10: db70aac4  r9 : db70aac4  r8 : db09d7d4
[   23.803396] r7 : db70aaa8  r6 : dc31c488  r5 : 00000009  r4 : da907800
[   23.809948] r3 : 00000000  r2 : 00000000  r1 : 00000001  r0 : da907800
[   23.816501] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA Thumb
Segment none
[   23.823838] Control: 50c5387d  Table: 9a914019  DAC: 00000051
[   23.829605] Process ls (pid: 1159, stack limit = 0xdb70e210)
[   23.835285] Stack: (0xdb70fde0 to 0xdb710000)
[   23.839662] fde0: db09d77c bf950188 00000000 bf94f5e5 db70ab24
db70aaa8 dc5b8f00 00000001
[   23.847876] fe00: db09d77c db70aaa8 bf94f579 bf941ad8 db09d7d4
bf93ce23 00000000 db70aaa8
[   23.856089] fe20: db010e8c db010de0 db70aaa8 db010e8c db010de0
db010c00 db09d7d4 bf93fca9
[   23.864302] fe40: 00000055 db010e54 00000000 dc31d1b8 024000c0
db557000 db010de0 00000000
[   23.872515] fe60: c0eabee4 dc5b8900 c0eabed8 db480f00 dc5b8ed8
c05a933d db010de0 db557000
[   23.880728] fe80: 00000000 c05a9499 00000000 db010c00 00000011
dc5b8900 db010d90 fffffff0
[   23.888941] fea0: 00000051 bf93ff9d 00000011 00000000 00000011
db70ff80 00000011 dc5b8ec0
[   23.897154] fec0: dc603000 c024e419 db70ff80 db480f00 00000011
db70ff80 c024e381 00000000
[   23.905367] fee0: 00000000 00000000 000222f8 c01fdfe9 b6fc8000
db70ffb0 c0e09664 50c5387d
[   23.913581] ff00: be8193e4 00000000 000222e0 c01011e5 00000073
c01e40f1 000b6fc8 c01feeb1
[   23.921794] ff20: 00004df6 00000007 db480f00 db70ff64 00000000
c01feeb1 00000011 db480f00
[   23.930007] ff40: 00000011 b6fc8000 db70ff80 00000000 00000000
c01feedf 000b6fc8 db70ff64
[   23.938220] ff60: 00000001 db480f00 db480f00 00000011 b6fc8000
00000000 00000000 c01ff12d
[   23.946433] ff80: 00000000 00000000 00000022 b6f415e0 00000011
b6fc8000 00000004 c0106824
[   23.954646] ffa0: db70e000 c0106641 b6f415e0 00000011 00000001
b6fc8000 00000011 00000000
[   23.962860] ffc0: b6f415e0 00000011 b6fc8000 00000004 b6fc9528
00562e20 00562e50 000222f8
[   23.971073] ffe0: 00000011 be81b700 b6eaf905 b6ee906c 40000010
00000001 00000000 00000000
[   23.979362] [<bf94027c>] (alloc_ep_req [libcomposite]) from
[<bf94f5e5>] (hidg_bind+0x6c/0x1bc [usb_f_hid])
[   23.989178] [<bf94f5e5>] (hidg_bind [usb_f_hid]) from [<bf93ce23>]
(usb_add_function+0x4a/0x118 [libcomposite])
[   23.999356] [<bf93ce23>] (usb_add_function [libcomposite]) from
[<bf93fca9>] (configfs_composite_bind+0x19c/0x250 [libcomposite])
[   24.011091] [<bf93fca9>] (configfs_composite_bind [libcomposite])
from [<c05a933d>] (udc_bind_to_driver+0x29/0xa8)
[   24.021489] [<c05a933d>] (udc_bind_to_driver) from [<c05a9499>]
(usb_gadget_probe_driver+0xa1/0xd0)
[   24.030598] [<c05a9499>] (usb_gadget_probe_driver) from
[<bf93ff9d>] (gadget_dev_desc_UDC_store+0x84/0x94 [libcomposite])
[   24.041629] [<bf93ff9d>] (gadget_dev_desc_UDC_store [libcomposite])
from [<c024e419>] (configfs_write_file+0x99/0xf0)
[   24.052290] [<c024e419>] (configfs_write_file) from [<c01fdfe9>]
(__vfs_write+0x1d/0xbc)
[   24.060418] [<c01fdfe9>] (__vfs_write) from [<c01feedf>]
(vfs_write+0x83/0x134)
[   24.067759] [<c01feedf>] (vfs_write) from [<c01ff12d>] (SyS_write+0x39/0x68)
[   24.074846] [<c01ff12d>] (SyS_write) from [<c0106641>]
(ret_fast_syscall+0x1/0x4e)
[   24.082453] Code: d545 4604 b1b0 6a73 (f993) 2002
[   24.087360] ---[ end trace c208dc44a507be5c ]---

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/CAOCHtYgR9VBr4G%2BkEQ6CCbmB9uX8ShPkDKC8Q%3DkgxyNL7DkqTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to