i.MX28 Accessing USB Test Modes Windows CE 6.0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX28 Accessing USB Test Modes Windows CE 6.0

1,664 Views
markwilliams
Senior Contributor I

Hi all,

I have an i.MX28-based design and I am currently performing USB testing. I have an onboard SMSC 3-port USB hub connected to USB1 (host-only) port. The USB0 (OTG) port of the i.MX28 is just used for downloading images.

I found an IOCTL in the HCD driver that I have used to force my hub to output the USB high speed test pattern for signal integrity analysis (IOCTL_EXTERN_HUB_TESTMODE). This has worked perfectly and I have been able to verify from the hub to the outside world.

I now need to verify from the i.MX28 to the hub. To do this I will need to set the hub IC to 'Force High Speed Enable' so it turns on its internal termination. I will then need to get the i.MX28 to generate the high speed test pattern.

Does anyone have any experience with setting up the i.MX processors in Windows CE to command various test modes on the USB ports? Any help would be appreciated.

Kind regards,

Labels (1)
0 Kudos
Reply
3 Replies

979 Views
markwilliams
Senior Contributor I

Looking into this further it looks like I may need to get the hub to attach to the i.MX28 at high speed before enabling the test packet from the i.MX28.

The hub is suspended when no devices are attached to its ports. I assume I will need to connect a high-speed device to one of the ports to get the hub to connect with the i.MX28 at high speed, then turn on the test packet?

I am struggling to find info on this but I would guess a lot of embedded designs have on-board hubs and would need to perform this testing. Perhaps they remove the hub IC and fit ideal termination resistors at the hub-ic end for the purpose of signal integrity testing. After all for eye diagram compliance tests you would need to use ideal 45 ohm terminations on D+/D-.

I am currently experiencing issues with connecting USB memory sticks to my design and trying to determine if it is to do with the hardware or a software driver issue.

0 Kudos
Reply

979 Views
djhoop
Contributor II

I'm working on a Kinetis K60f MCU, so take this response how you will since it's a different processor.

That said, I do have a TI TUSB2046B hub permanently connected with my MCU. I was having troubles getting the hub to attach and enumerate until I was very careful with the power-on reset timing on the hub. Before this timing was fixed, my hub was staying in suspend mode. Also, my hub is full speed, so there are likely some additional differences in things with your high speed setup. Either way, you could try looking at the power-on reset timings required by the hub and ensure that you're getting the correct enumeration activity. At the very least, I think it could help with getting your hub to come out of suspend mode. Once the hub enumerates, I believe it should stay live until you stop sending SOFs, which won't happen if the code is doing what it should. My knowledge of USB is somewhat limited, however, since most of what I know was gleaned from reviewing the USB code and reading stuff over the last month or so. Hopefully my painful lesson helps you out.

0 Kudos
Reply

979 Views
markwilliams
Senior Contributor I

Hi djhoop,

Thanks for your reply above. I used the TUSB2046B on my previous design with no problems, on this design because the i.MX28 supports high speed USB I moved to the USB2513B from SMSC.

I only seem to have issues with memory sticks and other high-speed connections seem to be fine. I will analyse the power up / reset and see if this is an issue. I remember having to add an external reset supervisor to my TUSB2046B design but I do no have this on the SMSC variant. I am using Windows CE and it is notorious for having poor memory stick support.

I managed to get the test packet to output from the i.MX28 - you need to shut down the controller first. I added this code to hwinit.c and then called it from an IOCTL added to the system.c file in the HCD driver:

void BSPSetTestMode(void)

{

    // Access the USB Control Register

    volatile DWORD  *temp;

    // USB_CTRL_T ctrl;

    USB_PORTSC_T portsc;

  USB_USBCMD_T cmd; 

    CSP_USB_REG *pReg;

    pReg = (PCSP_USB_REG)(&(gRegs->H1));

    // Stop the controller first

    {

        temp = (DWORD *)&cmd;

        *temp = INREG32(&pReg->USBCMD);

        cmd.RS = 0;

        OUTREG32(&pReg->USBCMD, *temp);

        while ((INREG32(&pReg->USBCMD) & 0x1) == 0x1){

             Sleep(100);

        }

    }

  // Send out the test packet

    temp = (DWORD *)&portsc;

    *temp = INREG32(&pReg->PORTSC[0]);

    portsc.PTC = 4;

    OUTREG32(&pReg->PORTSC[0], *temp);

  RETAILMSG(1,(_T("USB Test Packet Enabled\r\n")));

  

    return;

}

From this I was able to use the USB compliance testing package on a scope we have hired and the signal integrity looks great on the eye diagrams. So I don't think it is a high speed signal integrity issue.

I will keep looking... In the mean time if I limit the i.MX28 to full-speed mode only it all works!

Mark

0 Kudos
Reply