This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB口有时就没反应了,插入U盘没反应

Other Parts Discussed in Thread: AM3352

我的AM3352, PSP是linux-3.2-psp04.06.00.07.sdk

USB口做host模式, 接U盘用。

但是在产品使用过程中,偶尔会发生U盘插入后,没有任何反应,hotplug没收到任何信息。

查看日志信息,发现还有这些可以信息:

[ 7384.321136] ti81xx_interrupt 911: CAUTION: musb1: Babble Interrupt Occured
[ 7384.328308] ti81xx_interrupt 912: Please issue long reset to make usb functional !!
[ 7384.336486] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
[ 7384.336517] hub 2-0:1.0: port 1, status 0101, change 0003, 12 Mb/s
[ 7384.494689] hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
[ 7384.554718] hub 2-0:1.0: unable to enumerate USB device on port 1
[ 7384.561126] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
[ 7384.561157] hub 2-0:1.0: port 1, status 0101, change 0003, 12 Mb/s
[ 7384.714691] hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
[ 7384.775726] ti81xx_interrupt 911: CAUTION: musb1: Babble Interrupt Occured
[ 7384.782897] ti81xx_interrupt 912: Please issue long reset to make usb functional !!
[ 7384.834716] usb 2-1: new full-speed USB device number 44 using musb-hdrc

 

请问什么原因。 

  • 首先确定下USB HOST这部分的原理图设计是不是按照我们下面的guide做的:

    http://processors.wiki.ti.com/index.php/AM335x_Schematic_Checklist#USB

    其次感觉你用的软件版本你比较老,建议用SDK06

  • 硬件工程师检查了,硬件设计上没问题, 我今天又一次碰到这个问题

    [59444.213623] usb-storage: Bulk status result = 0 
    [59444.213653] usb-storage: Bulk Status S 0x53425355 T 0x143 R 0 Stat 0x0 
    [59444.213653] usb-storage: scsi cmd done, result=0x0 
    [59444.213684] usb-storage: *** thread sleeping. 
    [59444.222045] usb-storage: queuecommand_lck called 
    [59444.222106] usb-storage: *** thread awakened. 
    [59444.222106] usb-storage: Command WRITE_10 (10 bytes) 
    [59444.222137] usb-storage: 2a 00 00 00 08 01 00 00 01 00 
    [59444.222167] usb-storage: Bulk Command S 0x43425355 T 0x144 L 512 F 0 Trg 0 LUN 0 CL 10 
    [59444.222167] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes 
    [59444.222320] usb-storage: Status code 0; transferred 31/31 
    [59444.222320] usb-storage: -- transfer complete 
    [59444.222320] usb-storage: Bulk command transfer result=0 
    [59444.222351] usb-storage: usb_stor_bulk_transfer_sglist: xfer 512 bytes, 1 entries 
    [59444.222473] usb-storage: Status code 0; transferred 512/512 
    [59444.222473] usb-storage: -- transfer complete 
    [59444.222473] usb-storage: Bulk data transfer result 0x0 
    [59444.222473] usb-storage: Attempting to get CSW... 
    [59444.222503] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes 
    [59444.223022] usb-storage: Status code 0; transferred 13/13 
    [59444.223022] usb-storage: -- transfer complete 
    [59444.223052] usb-storage: Bulk status result = 0 
    [59444.223052] usb-storage: Bulk Status S 0x53425355 T 0x144 R 0 Stat 0x0 
    [59444.223083] usb-storage: scsi cmd done, result=0x0 
    [59444.223114] usb-storage: *** thread sleeping. 
    [61395.863189] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 
    [61395.863250] hub 2-0:1.0: port 1, status 0100, change 0001, 12 Mb/s 
    [61395.863250] usb 2-1: USB disconnect, device number 10, portnum 1 
    [61395.869567] usb 2-1: unregistering device 
    [61395.869567] usb 2-1: unregistering interface 2-1:1.0 

    [61395.869598] device: 'ep_81': device_unregister 
    [61395.869598] PM: Removing info for No Bus:ep_81 
    [61395.869689] device: 'ep_02': device_unregister 
    [61395.869720] PM: Removing info for No Bus:ep_02 
    [61395.869781] PM: Removing info for usb:2-1:1.0 
    [61395.869842] bus: 'usb': remove device 2-1:1.0 
    [61395.869873] usb-storage: storage_disconnect() called 
    [61395.869873] device: '9:0:0:0': device_unregister 
    [61395.869903] PM: Removing info for No Bus:9:0:0:0 
    [61395.870483] PM: Removing info for scsi:9:0:0:0 
    [61395.870574] bus: 'scsi': remove device 9:0:0:0 
    [61395.870605] PM: Removing info for No Bus:9:0:0:0 
    [61395.888000] PM: Removing info for No Bus:sda1 
    [61395.888977] device: '8:0': device_unregister 
    [61395.889007] PM: Removing info for No Bus:8:0 
    [61395.892242] device: '8:0': device_create_release 
    [61395.892364] PM: Removing info for No Bus:sda 
    [61395.899719] device: 'host9': device_unregister 
    [61395.899749] PM: Removing info for No Bus:host9 
    [61395.906799] PM: Removing info for scsi:host9 
    [61395.906890] bus: 'scsi': remove device host9 
    [61395.909637] usb-storage: -- usb_stor_release_resources 
    [61395.909667] usb-storage: -- sending exit command to thread 
    [61395.909667] usb-storage: *** thread awakened. 
    [61395.909698] usb-storage: -- exiting 
    [61395.909790] usb-storage: -- dissociate_dev 
    [61395.922698] usb 2-1: usb_disable_device nuking all URBs 
    [61395.922729] device: 'ep_00': device_unregister 
    [61395.922729] PM: Removing info for No Bus:ep_00 
    [61395.922882] PM: Removing info for usb:2-1 
    [61395.923004] bus: 'usb': remove device 2-1 
    [61395.923034] device: 'usbdev2.10': device_unregister 
    [61395.923034] PM: Removing info for No Bus:usbdev2.10 
    [61395.925994] device: 'usbdev2.10': device_create_release 
    [61396.084686] hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x100 
    [61396.293151] PM: Removing info for scsi:target9:0:0 
    [61396.293243] bus: 'scsi': remove device target9:0:0 
    [69246.862823] am335x_keybutton receive button_interrupt 
    [69246.868103] am335x_keybutton Signal= 1 
    [69246.902282] am335x_keybutton receive button_interrupt 
    [69246.907562] am335x_keybutton Signal= 1 
    [69246.911590] am335x_keybutton receive button_interrupt 
    [69246.916839] am335x_keybutton Signal= 1 

    [69251.776306] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002 
    [69251.776367] hub 1-0:1.0: port 1, status 0101, change 0001, 12 Mb/s 
    [69251.934692] hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x101 
    [69251.994903] ti81xx_interrupt 911: CAUTION: musb0: Babble Interrupt Occured 
    [69252.002105] ti81xx_interrupt 912: Please issue long reset to make usb functional !! 
    [69252.054687] usb 1-1: new high-speed USB device number 3 using musb-hdrc 
    [69257.054779] usb 1-1: khubd timed out on ep0in len=0/64 
    [69262.054748] usb 1-1: khubd timed out on ep0in len=0/64 
    [69267.054779] usb 1-1: khubd timed out on ep0in len=0/64 
    [69267.114746] hub 1-0:1.0: unable to enumerate USB device on port 1 
    [69267.121124] ti81xx_interrupt 911: CAUTION: musb0: Babble Interrupt Occured 
    [69267.128295] ti81xx_interrupt 912: Please issue long reset to make usb functional !! 
    [69267.136352] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002 
    [69267.136383] hub 1-0:1.0: port 1, status 0501, change 0003, 480 Mb/s 
    [69267.294677] hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x501 
    [69267.414672] usb 1-1: new high-speed USB device number 4 using musb-hdrc 
    [69272.414794] usb 1-1: khubd timed out on ep0in len=0/64 
    [69277.414764] usb 1-1: khubd timed out on ep0in len=0/64 
    [69282.414764] usb 1-1: khubd timed out on ep0in len=0/64 
    [69282.474761] hub 1-0:1.0: unable to enumerate USB device on port 1 
    [69282.481140] ti81xx_interrupt 911: CAUTION: musb0: Babble Interrupt Occured 
    [69282.488311] ti81xx_interrupt 912: Please issue long reset to make usb functional !! 
    [69282.496398] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002 
    [69282.496429] hub 1-0:1.0: port 1, status 0501, change 0003, 480 Mb/s 
    [69282.654693] hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x501 
    [69282.774688] usb 1-1: new high-speed USB device number 5 using musb-hdrc 



    日志分析: 
    1、为什么在
    [61395.863189]行附近,出现USB设备断掉连接情况 
    [61395.863189] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 
    [61395.863250] hub 2-0:1.0: port 1, status 0100, change 0001, 12 Mb/s 
    [61395.863250] usb 2-1: USB disconnect, device number 10, portnum 1 
    [61395.869567] usb 2-1: unregistering device 


  • 确认两点:

    1. 这个脚是做的OTG,还是HOST?如果是配置成为了HOST,USB_ID脚是否有接地了。

    2. USB_VBUS是否是直接接在电源的5V上面的,如果是的话,建议增加一个patch,参考:

    http://e2e.ti.com/support/arm/sitara_arm/f/791/p/333490/1163908

    diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
    index 13bfef3..e41b224 100644
    --- a/arch/arm/mach-omap2/omap_phy_internal.c
    +++ b/arch/arm/mach-omap2/omap_phy_internal.c
    @@ -288,8 +288,17 @@ void ti81xx_musb_phy_power(u8 id, u8 on , bool wkup)
                                                    TI816X_USBPHY0_NORMAL_MODE;
                            usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;
                    } else if (cpu_is_am33xx()) {
    -                       usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN);
    -                       usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN);
    +                       usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN | USBPHY_OTGVDET_EN);
    +
    +                       /* HACK: If USB0 port is in host-only mode, clear its
    +                        * USBPHY_OTGVDET_EN bit to ignore first VBUS sensing.
    +                        * Change 0 to 1 if USB1 port is in host-only mode.
    +                        */
    +                       if (id == 0)
    +                               usbphycfg |= USBPHY_OTGSESSEND_EN;
    +                       else
    +                               usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN);
    +
                            usbwkupctrl = AM33XX_USB_WKUP_CTRL_DISABLE;
                    }
    
  • 我们做了两块板子, 第一块板子的图如下:

     

    第二块板子的图如下:

  • 请问,用哪个设计图,要驱动加补丁?

  • 当VBUS直连5V的时候需要加补丁,第二个。