zy_oo

zy_oo

0个粉丝

4

问答

0

专栏

1

资料

zy_oo  发布于  2016-07-08 21:03:26
采纳率 0%
4个问答
8824

Hi3516A调试USB Device模式 内核报错 求助

 
板子想要调试下USB Device
加载驱动后,USB接入电脑  打印如下报错

内核的报错不太看的懂  求助帮忙分析下 谢谢


modprobe  g_file_storage.ko file=/dev/mtdblock0 luns=1 stall=0 removable=1
dwc_otg: version 3.00a 10-AUG-2012
Core Release: 3.10a
Setting default values for core params
Using Buffer DMA mode
Periodic Transfer Interrupt Enhancement - disabled
Multiprocessor Interrupt Enhancement - disabled
OTG VER PARAM: 0, OTG VER FLAG: 0
Dedicated Tx FIFOs mode
g_file_storage gadget: controller 'dwc_otg_pcd' not recognized
g_file_storage gadget: No serial-number string provided!
g_file_storage gadget: File-backed Storage Gadget, version: 1 September 2010
g_file_storage gadget: NOTE: This driver is deprecated.  Consider using g_mass_storage instead.
g_file_storage gadget: Number of LUNs=1
g_file_storage gadget-lun0: ro=0, nofua=0, file: /dev/mtdblock0
~ # usb 2-1: new full-speed USB device number 2 using hiusb-ohci
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 80000007 [#1] ARM
Modules linked in: g_file_storage dwc_otg gpioi2c(O) hi_mipi(O) hi3516a_adec(O) hi3516a_aenc(O) hi3516a_ao(O) hi3516a_ai(O) hi3516a_aio(O) acodec(O) pwm(O) hi3516a_ive(O) hi3516a_vda(O) hi3516a_jpege(O) hi3516a_h265e(O) hi3516a_h264e(O) hi3516a_chnl(O) hi3516a_venc(O) hi3516a_rc(O) hifb(O) hi3516a_vou(O) hi3516a_vpss(O) hi3516a_viu(O) hi3516a_isp(O) hi3516a_vgs(O) hi3516a_region(O) hi3516a_tde(O) hi3516a_sys(O) hi3516a_base(O) hi_media(O) mmz(O)
CPU: 0    Tainted: G           O  (3.4.35 #2)
PC is at 0x0
LR is at hub_port_init+0x438/0x774
pc : [<00000000>]    lr : []    psr: a0000013
sp : c3881ea0  ip : 00000002  fp : c3881f0c
r10: c39d8900  r9 : 00000002  r8 : c05ab77c
r7 : 00000002  r6 : ffffffa6  r5 : ffffffc2  r4 : c2d65000
r3 : 00000000  r2 : c0587aec  r1 : 00000000  r0 : c3a2c400
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 83188059  DAC: 00000015

LR: 0xc02fe7d8:
e7d8  0a000091 e3530010 0a00008f e3500000 03e00046 e2555001 1affffe2 e51b7050
e7f8  e1a05000 e1a00006 e5c43147 ebf648ae e3a03000 e1a0000a e58d3000 e51b1030
e818  e1a02004 e51b303c ebfffe05 e2506000 baffff34 e594301c e51bc034 e153000c
e838  1affff4c e3550000 0affff7e e5940034 e3e06059 e5903088 e593301c e12fff33
e858  e1a02005 e3011b34 e2840068 e34c1051 ebfeac45 eaffffa9 e51bc040 e59c3088
e878  e5933010 e3130040 1affff97 e3560000 1affff1c e594301c e3530005 0a000019
e898  e5d45147 e1d423bc e35500ff 03a05c02 e1550002 0a00002b e3530001 1a000019
e8b8  e1a02005 e3011c10 e2840068 e34c1051 ebfeac2d e3e06059 eaffff0a e51bc034

SP: 0xc3881e20:
1e20  c3881e54 c3881e30 c2d65000 60000013 00000032 00000000 a0000013 ffffffff
1e40  c3881e8c c05ab77c c3881f0c c3881e58 c000ddf8 c0008400 c3a2c400 00000000
1e60  c0587aec 00000000 c2d65000 ffffffc2 ffffffa6 00000002 c05ab77c 00000002
1e80  c39d8900 c3881f0c 00000002 c3881ea0 c02fe858 00000000 a0000013 ffffffff
1ea0  00000000 00000000 c2e107c0 00000040 00001388 c3881ed0 c3a2c400 00000002
1ec0  c059db9c c05094d8 c0511af0 c3a2c400 00000032 00000000 00000002 00000001
1ee0  c2d65000 00000000 c3a2c800 c3a2c418 00000002 c2d65000 00000001 c39d8938
1f00  c3881fbc c3881f10 c03006ac c02fe42c c0570190 c3826038 c3a2c400 c059db9c

FP: 0xc3881e8c:
1e8c  c3881ea0 c02fe858 00000000 a0000013 ffffffff 00000000 00000000 c2e107c0
1eac  00000040 00001388 c3881ed0 c3a2c400 00000002 c059db9c c05094d8 c0511af0
1ecc  c3a2c400 00000032 00000000 00000002 00000001 c2d65000 00000000 c3a2c800
1eec  c3a2c418 00000002 c2d65000 00000001 c39d8938 c3881fbc c3881f10 c03006ac
1f0c  c02fe42c c0570190 c3826038 c3a2c400 c059db9c 00000000 00000001 c39d8981
1f2c  c3881f7c 00000001 c3a33c20 00000002 c3a2c400 c05ab77c c3a33c20 00000101
1f4c  c3a2c800 00000000 c0587ad8 c3a2c89c c39d8948 c39d8981 c3a2c800 c39d8900
1f6c  c39d8908 00000000 01010013 00000001 00000101 c3864580 c0035fb8 c3881f88

R0: 0xc3a2c380:
c380  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
c3a0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
c3c0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
c3e0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
c400  c05883f8 00000002 c0514078 00000001 00000000 00000003 00000006 00000000
c420  00000000 00000000 c3a2c800 00000000 c3a33430 c0587bb4 00000000 00000000
c440  00000000 00000003 c05141dc 00000010 6963686f 6463685f 6273753a 00000032
c460  00000000 00000000 c0599c1c c0599c1c ffffb022 c0599b00 c0302104 c3a2c400

R2: 0xc0587a6c:
7a6c  00000000 c05117ec 0007c110 00000001 c02fc108 c05117fc 001cc915 00000002
7a8c  c02fc060 c051180c 20669823 00000001 c02fbe28 00000000 00000000 00000000
7aac  00000000 c0511890 c02fcc84 00000000 00000000 c05118d8 00000000 c02fc97c
7acc  c02fc950 c02fc8fc c0450db8 c39d8938 c39d8938 c0587ae0 c0587ae0 00000000
7aec  c0587aec c0587aec 00000000 c0587af8 c0587af8 c3864580 00000000 c0587af4
7b0c  00001388 00000001 c05121e4 c02ff958 c02ff864 c02fcfc0 c02ff764 c02fe018
7b2c  c02fdff4 c02ff740 c02fdf98 c0450e4c c0587b3c c0587b3c c05121e4 c0587bf4
7b4c  00000000 c0511890 00000000 00000000 c03077fc c0306dbc 00000000 00000000

R4: 0xc2d64f80:
4f80  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
4fa0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
4fc0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
4fe0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5000  00000000 00000031 00000000 00000000 00000000 00000000 00000005 00000002
5020  00000000 00000000 00000001 00000000 c3a2c800 c3a2c400 00000507 00000040
5040  00000000 00000000 c2d65048 c2d65048 ffdd6000 00000000 00000000 00000000
5060  00000001 00000000 c3a2c868 00000000 c2e10780 c2d65074 c2d65074 00000000

R8: 0xc05ab6fc:
b6fc  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
b71c  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
b73c  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
b75c  00000000 c3a3ce00 00000001 00000000 00000000 00000000 ffffffed ffffffed
b77c  00000000 00000001 00000001 c3864580 00000006 00000000 00000006 00000000
b79c  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
b7bc  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
b7dc  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

R10: 0xc39d8880:
8880  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
88a0  00000000 c39d88a4 c39d88a4 00000000 00000000 00000000 00000000 c39d88bc
88c0  c39d88bc 00000000 00000000 00000000 00000000 00000000 c0588028 c030aac8
88e0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
8900  c3a33c20 c3a2c800 00000002 c3a32800 c39d5200 c39d5240 00000001 c39d891c
8920  c39d891c 00000000 00000000 c39d8918 00000000 00000000 c0587ad8 c0587ad8
8940  00000002 00000000 00000000 00000000 00000000 c39d5300 00000000 00000000
8960  00000000 c39d8964 c39d8964 00000200 c39d8970 c39d8970 c02fd88c 000001f4
Process khubd (pid: 163, stack limit = 0xc38802e8)
Stack: (0xc3881ea0 to 0xc3882000)
1ea0: 00000000 00000000 c2e107c0 00000040 00001388 c3881ed0 c3a2c400 00000002
1ec0: c059db9c c05094d8 c0511af0 c3a2c400 00000032 00000000 00000002 00000001
1ee0: c2d65000 00000000 c3a2c800 c3a2c418 00000002 c2d65000 00000001 c39d8938
1f00: c3881fbc c3881f10 c03006ac c02fe42c c0570190 c3826038 c3a2c400 c059db9c
1f20: 00000000 00000001 c39d8981 c3881f7c 00000001 c3a33c20 00000002 c3a2c400
1f40: c05ab77c c3a33c20 00000101 c3a2c800 00000000 c0587ad8 c3a2c89c c39d8948
1f60: c39d8981 c3a2c800 c39d8900 c39d8908 00000000 01010013 00000001 00000101
1f80: c3864580 c0035fb8 c3881f88 c3881f88 00000013 c3829ee4 00000000 c030018c
1fa0: 00000013 00000000 00000000 00000000 c3881ff4 c3881fc0 c0035b60 c0300198
1fc0: c3829ee4 00000000 00000000 00000000 c3881fd0 c3881fd0 00000000 c3829ee4
1fe0: c0035ac8 c001f5bc 00000000 c3881ff8 c001f5bc c0035ad4 ffffffff fffffff7
Backtrace:
[] (hub_port_init+0x0/0x774) from [] (hub_thread+0x520/0x1058)
[] (hub_thread+0x0/0x1058) from [] (kthread+0x98/0x9c)
[] (kthread+0x0/0x9c) from [] (do_exit+0x0/0x698)
r6:c001f5bc r5:c0035ac8 r4:c3829ee4
Code: bad PC value
---[ end trace bd6209a2dce34f84 ]---
我来回答
回答13个
时间排序
认可量排序

ngswfx

1个粉丝

55

问答

1

专栏

40

资料

ngswfx 2016-07-09 01:30:42
认可0
本帖最后由 ngswfx 于 2016-7-9 01:40 编辑

没弄过不懂

估计还是驱动没对吧

Unable to handle kernel NULL pointer dereference at virtual address 00000000

controller 'dwc_otg_pcd' not recognized 这怎么还不认识了


rafael_wl

0个粉丝

12

问答

0

专栏

7

资料

rafael_wl 2016-07-09 15:34:19
认可0
otg 一般都有一个 工作在device 和host的模式选择,这个有选择么? 海思默认好像都是工作在host

zy_oo

0个粉丝

4

问答

0

专栏

1

资料

zy_oo 2016-07-10 12:30:19
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=33572&ptid=11886]ngswfx 发表于 2016-7-9 01:30[/url]
没弄过不懂

估计还是驱动没对吧
[/quote]

[url]http://www.ebaina.com/bbs/forum.php?mod=viewthread&tid=11860&highlight=device[/url]
因为参考这个人的帖子  打印信息前面和我一样,我考虑下会不会是我的硬件有问题导致的?

zy_oo

0个粉丝

4

问答

0

专栏

1

资料

zy_oo 2016-07-10 12:33:25
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=33592&ptid=11886]rafael_wl 发表于 2016-7-9 15:34[/url]
otg 一般都有一个 工作在device 和host的模式选择,这个有选择么? 海思默认好像都是工作在host[/quote]

按照海思《外围设备驱动 操作指南》这个手册的方式来操作,这里好像没提到模式选择

ngswfx

1个粉丝

55

问答

1

专栏

40

资料

ngswfx 2016-07-10 12:43:04
认可0
本帖最后由 ngswfx 于 2016-7-10 12:44 编辑

[quote][url=forum.php?mod=redirect&goto=findpost&pid=33628&ptid=11886]zy_oo 发表于 2016-7-10 12:33[/url]
按照海思《外围设备驱动 操作指南》这个手册的方式来操作,这里好像没提到模式选择[/quote]

这个gadget 在kernel menuconfig里面有选择项,你看过具体配置没?

zy_oo

0个粉丝

4

问答

0

专栏

1

资料

zy_oo 2016-07-10 15:11:10
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=33629&ptid=11886]ngswfx 发表于 2016-7-10 12:43[/url]
这个gadget 在kernel menuconfig里面有选择项,你看过具体配置没?[/quote]

内核按照这样配置了,网上看了下  
内核这样配置就可以了。

zy_oo

0个粉丝

4

问答

0

专栏

1

资料

zy_oo 2016-07-10 15:26:43
认可0
g_file_storage 和g_mass_storage两个驱动 都尝试过了  板子USB与PC连接前的打印都差不多  感觉应该没有问题  连接上USB后,打印都是

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 80000007 [#1] ARM
Modules linked in: g_mass_storage dwc_otg
CPU: 0    Not tainted  (3.4.35 #4)
PC is at 0x0
LR is at hub_port_init+0x768/0x808
pc : [<00000000>]    lr : []    psr: a0000013
sp : c3881ea0  ip : 00000002  fp : c3881f0c
r10: 00000001  r9 : 00000000  r8 : ffffffa6
r7 : ffffffc2  r6 : 00000032  r5 : c39d8900  r4 : c316b000
r3 : 00000000  r2 : c0587aec  r1 : 00000000  r0 : c3a2c400
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 83180059  DAC: 00000015

我在hub_port_init函数中先加打印调试下,但是 会不会是硬件引起的问题呢?
板子不是自己这边做的  硬件问题可能就比较麻烦了

zy_oo

0个粉丝

4

问答

0

专栏

1

资料

zy_oo 2016-07-10 16:26:15
认可0
在调试驱动过程中在
\Hi3516A_RDK\RDK\osdrv\osdrv\opensource\kernel\linux-3.4.y\drivers\usb\core\Hub.c
文件中
hub_port_init函数内
添加如下打印
终端打印显示错误在
DEBUG 2和DEBUG 3之间
就是这句话
hcd->driver->hi_ehci_reset(hcd);
有问题,额  那接下来怎么解决这个问题呢...


~ # usb 2-1: new full-speed USB device number 2 using hiusb-ohci
DEBUG 1DEBUG 2
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 80000007 [#1] ARM
Modules linked in: g_mass_storage dwc_otg
CPU: 0    Not tainted  (3.4.35 #10)
PC is at 0x0
LR is at hub_port_init+0x788/0x7c8

ngswfx

1个粉丝

55

问答

1

专栏

40

资料

ngswfx 2016-07-10 19:20:28
认可0
本帖最后由 ngswfx 于 2016-7-10 19:43 编辑

[quote][url=forum.php?mod=redirect&goto=findpost&pid=33634&ptid=11886]zy_oo 发表于 2016-7-10 15:11[/url]
内核按照这样配置了,网上看了下  
内核这样配置就可以了。[/quote]

怎么是M选择呀,我一般都弄成*的,M没有被选中吧,M好像是手动的意思,编译前还会提问是否选择 yes or no

你把它弄成*试试。

ngswfx

1个粉丝

55

问答

1

专栏

40

资料

ngswfx 2016-07-10 19:24:41
认可0
本帖最后由 ngswfx 于 2016-7-10 19:52 编辑

[quote][url=forum.php?mod=redirect&goto=findpost&pid=33636&ptid=11886]zy_oo 发表于 2016-7-10 16:26[/url]
在调试驱动过程中在
\Hi3516A_RDK\RDK\osdrv\osdrv\opensource\kernel\linux-3.4.y\drivers\usb\core\Hub. ...[/quote]

你可以把udev->bus的值打印出来,通常如果某个地方报错,应该是前面就有问题了。

判断hcd是否为NULL

判断hcd->driver是否为空

////////////////让它不报错很简单,主要是这个值为什么为NULL,你就需要研究一下了

你就:
if(hcd&&hcd->driver)
        hcd->driver->hi_ehci_reset(hcd);


//////////////////////////////////其实r的值就没对,能到这里,已经出问题了,检查r为什么不是0,这段代码一看就是容错用的。平时不应该进来的,r是那个函数返回的?


//////我看了一下代码,你这个估计还是环境没准备好。

代码里面不是有CONFIG_USB_OTG吗,你在 #ifdef CONFIG_USB_OTG  底下打印点东西出来,判断kernel menuconfig配置对了没有。这个CONFIG_USB_OTG肯定要定义的。


另外你的信息log中有一行:controller 'dwc_otg_pcd' not recognized                         这里已经非常明确,没有识别出dwc_otg_pcd,接下来的动作,报错是早晚的事。

zy_oo

0个粉丝

4

问答

0

专栏

1

资料

zy_oo 2016-07-11 15:58:19
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=33640&ptid=11886]ngswfx 发表于 2016-7-10 19:24[/url]
你可以把udev->bus的值打印出来,通常如果某个地方报错,应该是前面就有问题了。

判断hcd是否为NULL ...[/quote]

谢谢ngswfx提供的建议

目前还是没找到问题在哪里。
CONFIG_USB_OTG在内核配置里面找不到定义它的选项
内核中只找到CONFIG_USB_OTG_UTILS。根据海思给的文档的话,显示驱动都已经默认编在内核中了,我也用的内核的默认配置,仅仅在使用USB Device模式下的时候,文档提到要添加dwc_otg.ko、g_file_storage.ko。
所以我想应该不是内核配置的问题吧....

因为没搞过USB的驱动,所以暂时还没找出问题在哪。

kg123456

0个粉丝

14

问答

0

专栏

3

资料

kg123456 2016-07-11 16:14:57
认可0
你看下是不是USB电源的问题
参考这个帖子
[url]http://www.ebaina.com/bbs/thread-7154-1-1.html[/url]

stars_625

0个粉丝

0

问答

0

专栏

0

资料

stars_625 2016-11-12 15:40:06
认可0
主要是这个错误:g_file_storage gadget: controller 'dwc_otg_pcd' not recognized
通过修改gadget_chips.h增加海思UDC的设备代号可解

--- gadget_chips.h.orig        2016-11-12 15:34:28.207573500 +0800
+++ gadget_chips.h        2016-11-11 20:40:18.290281156 +0800
@@ -50,6 +50,7 @@
#define gadget_is_s3c2410(g)                (!strcmp("s3c2410_udc", (g)->name))
#define gadget_is_s3c_hsotg(g)                (!strcmp("s3c-hsotg", (g)->name))
#define gadget_is_s3c_hsudc(g)                (!strcmp("s3c-hsudc", (g)->name))
+#define gadget_is_dwc_otg_pcd(g)        (!strcmp("dwc_otg_pcd", (g)->name))

/**
  * usb_gadget_controller_number - support bcdDevice id convention
@@ -118,6 +119,8 @@ static inline int usb_gadget_controller_
                return 0x31;
        else if (gadget_is_dwc3(gadget))
                return 0x32;       
+        else if (gadget_is_dwc_otg_pcd(gadget))
+                return 0x33;
       

        return -ENOENT;
}
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
相关问答
无更多相似问答 去提问
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区