Page 1 of 1

x86 based Device Hangs in EHCI Initialization

Posted: Tue May 17, 2016 7:41 am
by bugraaydogar
Hi all,

I'm dealing with a strange issue. My device hangs while initializing EHCI. I'm using Windows Embedded CE 6 as an operating system. My hw is AMD CS5536 and has 1 EHCI and 2 OHCI in the compain controller.

I will try to explain my hw setup and cases. Additionally, i will explain what i did up to now.

I'm doing cyclic reboot with following configurations:
Case 1 : There is no USB device attached. : No problem observed.
Case 2 : There are 2 usb port attached : No problem observed.
Case 3 : There is a usb port and usb hub. 1 usb device is attached to usb hub. : Device hangs.

Seems like, when i stress the USB, somehow system hangs.

In my OS initializaiton, firstly EHCI is initialized and then OHCI. I think this is the correct way of initializing USB Host Controllers as I read from some links for Linux discussions.

Luckily, I have a software debugger called (KITL) and can debug the issue till device hangs.
What i experienced is that, after setting CONFIGFLAG register which routes all USB device to EHCI first, device hangs. I commented out the code which sets this register and device booted but it didn't recognize high speed devices as expected.

My question is why setting CONFIGFLAG can cause such hang issue?

I have done/checked followings;
- BIOS and EHCI hand off is done in EHCI driver of the operating system.
- If I initialize OHCI before EHCI, it improves the situation a lot but doesnt solve it completely.
- If i dont set CONFIGFLAG, device boots but doesnt recognize high speed devices as i mentioned earlier.

I have another device which is based on Intel, same USB Host Controller driver works great with it.

So I dont know what to do next? What would be your suggestions? Can it be HW specific?
How initializing OHCI earlier improves the situation ? As far as i know, BIOS also initialize OHCI. Can it be related to this ? If it is what should i check?

When I read OHCI/EHCI specification and compare it with source code, it seems perfect match. I dont understand the cause of this issue. I also checked Linux source codes and couldnt find a massive difference. Pls note that, i dont have a hw debugger, therefore i dont see the situation of registers when device hangs.

Any feedback is welcome :)

Regards,
Buğra

Re: x86 based Device Hangs in EHCI Initialization

Posted: Tue May 17, 2016 7:08 pm
by BenLunt
I don't quite understand your situation here. You say "my device hangs". Do you mean that you have built a USB device or is this an "off the shelf" device? Also, when you say that you are using WinCE, is this the OS that is trying to access the device, or is this your development platform?

What do you mean by, "my device hangs"?

Does it stop sending packets? Did it ever send packets? Does it enumerate? Can you retrieve the device's descriptors?

Please be a little more detailed in your process and where it happens to start giving problems.

Thanks,
Ben

http://www.fysnet.net/the_universal_serial_bus.htm

Re: x86 based Device Hangs in EHCI Initialization

Posted: Wed May 18, 2016 12:58 am
by bugraaydogar
Hi,

Thanks for your answer. I thought I describe the situation clearly, seems I didnt :)
As I understand we had a conflict about the term device :) . I wanted to say embedded board when i say device.

I have an embedded board which has AMD CS5536 companion controller with it.It runs WinCE as an operating system. It has 2 USB ports. In one of USB port, I plugged USB stick, for the other one i plug a USB Hub. Additionally, i plugged a USB stick to USB Hub.

With the above configuration, when I reboot the device(embedded board), it hangs while initializing EHCI. Since embedded board hangs in initialization, it doesn't detect any USB stick to start communication.

I hope, it is more clear.

Thanks for your helps,
Bugra

Re: x86 based Device Hangs in EHCI Initialization

Posted: Wed May 18, 2016 4:06 pm
by BenLunt
So as I take it, you have an embedded device running WinCE and when you have a USB stick plugged in,
WinCE hangs.

This is out of my scope. I don't work with WinCE and am unable not help you with it, sorry.

Ben