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.

How to enter usb host controller test mode [OMAP35X]

 

Dear Experts,

I am using TI OMAP35X, and I want to enter USB test mode to test the usb diagram for USB Host.

(OMAP USB HOST CTL --> USB PHY --> USB HUB --> USB TYPE A CONNECTOR)

Is Section 23.1.4.11 (Register to Enable the USB 2.0 Test Modes) for both OTG Controller (Section 23.1) and Host Subsystem (Section 23.2) ? or only for USB OTG Controller ?

I write some program to enter test mode in wince/e-boot, but I can’t get waveform from USB connector.

Can anyone tell me how to enter USB Host Controller test mode ~??!! Thx ~

 

Below is my code ~

=====================================================

@boot\xldr\platform.c

//Enable the CLK for USB // hbchen form indy

SETREG32(&pPrcmCoreCM->CM_ICLKEN1_CORE, 1<<4);     //enable EN_HOSTOTGUSB bit

SETREG32(&pPrcmCoreCM->CM_AUTOIDLE1_CORE, 1<<4);          //enable CM_AUTOIDLE1_CORE bit

=====================================================

#define USB_BA 0x480AB000 // +0fh Register to Enable the USB 2.0 Test Modes

@boot\eboot\menu.c

VOID USBTest(OAL_BLMENU_ITEM *pMenu) {

UINT8 mode = (UINT8)pMenu->pParam3;

unsigned long volatile *bufa=NULL, *bufb=NULL;

unsigned char volatile *b8=NULL;

UINT16 c=0, cnt=1000;

//---------------------- 

OALLog(L" ======USB HOST Test MODE : [0x%x]======\r\n",mode);

if (mode & MUSB_TEST_FORCE_HOST) OALLog(L"FORCE HOST ");

if (mode & MUSB_TEST_FIFO_ACCESS) OALLog(L"FIFO ACCESS ");

if (mode & MUSB_TEST_FORCE_FS) OALLog(L"FULL SPEED ");

if (mode & MUSB_TEST_FORCE_HS) OALLog(L"HIGH SPEED ");

if (mode & MUSB_TEST_PACKET)

{

OALLog(L"TEST_PACKET ");

musb_load_testpacket();

}

if (mode & MUSB_TEST_K) OALLog(L"TEST_K ");

if (mode & MUSB_TEST_J) OALLog(L"TEST_J ");

if (mode & MUSB_TEST_SE0_NAK) OALLog(L"TEST_SE0_NAK ");

b8= (unsigned char volatile *)OALPAtoUA(USB_BA+0xf); // change to uncached address

*b8=mode;

}

=====================================================

VOID musb_load_testpacket()

{

unsigned char volatile *b8=NULL;

UINT16 volatile *b16=NULL;

unsigned long volatile *bufa=NULL;

UINT8 i=0;

UINT16 cnt=1000;

//-------------------------------

b8= (unsigned char volatile *)OALPAtoUA(USB_BA+0xe); // 

*b8=0; // select ep 0 ???

bufa= (void volatile *)OALPAtoUA(USB_BA+0x20); 

for(i=0;i<53;i++)

{

cnt=1000;

*bufa = musb_test_packet[i]; //write pattern to fifo

while(cnt--);

}

b16=(UINT16 volatile *)OALPAtoUA(USB_BA+0x12); // change to uncached address

*b16 = 0x0002;//MUSB_CSR0_TXPKTRDY 0x0002 

}

 

  • Chen,

    The test mode register PORT_SCi is for USBHOST interface only and can be used for testmode only when device is connected directly. As you are using a hub in between so you need to send SET_FEATURE command to hub for entering into test mode.

    why are you using musb in your code above ? You don;t need to do anything with musb if test mode is required for usbhost interface.

    Regards,
    Ajay

  • Dear Ajay,

    Thanks a lot. I am not familiar with USB. So I did a stupid thing to use OTG Controller.

    >>The test mode register PORT_SCi is for USBHOST interface only and can be used for

    >>testmode only when device is connected directly. As you are using a hub in between so

    >>you need to send SET_FEATURE command to hub for entering into test mode.

     

    Did you mean that I should not control USB EHCI HOST PORT_SCi to enter testmode, but only need to send SET_FEATURE command to hub by USB driver ??

     

    >>why are you using musb in your code above ? You don;t need to do anything with musb if test mode is required for usbhost interface.

     

     

  • >>Did you mean that I should not control USB EHCI HOST PORT_SCi to enter testmode, but only need to send SET_FEATURE command to hub by USB driver ??

    yes, correct. You can refer usb2.0 spec section "9.4.9 Set Feature" for this.

    Regards,

    Ajay

  • Hi Chen ,

                   I want to write a C code in CCS so that i can test the OMAP35 as a host by entering in to the test mode(TEST_packet ) ,can you please help me out to do this , am a newbie in USB !