XUD Issue attaching when connected at power up

Technical questions regarding the XTC tools and programming with XMOS.
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

XUD Issue attaching when connected at power up

Post by bearcat »

I am having an issue in XUD when I power up, or start from XTAG, with a host connected. If I connect the host after start, the host attaches fine. After attaching, the system works over USB without any errors.

Very similiar code in tools V11 and an older XUD works.

I am using the XUD as supplied in the latest Audio source. Build date of 4/3/2013. Using tools V13.0.1. (I would have liked to use the latest XUD, but that is a different animal without an Audio firmware to reference). L series using the SMC part.

It appears to hang on waiting for the ULPI interface to go idle. Not sure, but the code appears to be looking twice, with the first time completed. But I might not have decoded that right...

That's sounds odd, as the bus should go idle. I don't know how the clocking is set up though.
XUD_PowerUp_ConnectProblem.JPG
You do not have the required permissions to view the files attached to this post.


User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

It's somewhere in the HS reset sequence, seems to be waiting
for a SE0. My guess is the hub does not think it is resetting
this bus. Does your PHY reset pin work properly? What does
your OS show (Linux can show you everything it does on USB).
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Post by bearcat »

Thanks Segher. I will re-verify the PHY reset, maybe a solder joint broke. Interesting to see exactly when reset is activated, if not at only XUD start. The same hardware was used between the 2 different firmwares versions, of which one firmware worked. USB design is same as reference, with the 20k on VBUS note.

Good point about linux. I will try a connect, and look at the logs. Windows shows nothing.

Hoping something rings a bell with Ross. Trying to get these last couple issues worked out that I have put off...
User avatar
Ross
XCore Expert
Posts: 967
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

What version of the USB Audio design are you using please, 6.1?
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Post by bearcat »

Ross, my code is based on a highly modified reference. I am using the XUD from audio reference V6.1.

Since the device hasn't attached, there is no host information to look at.

The PHYReset signal is working and looks correct...

Ok, having to learn more about USB and ULPI. Luckily the ULPI documents show the AttachHS in detail. Where XUD stalls in AttachHS, is at the last step in the AttachHS sequence. It is looking for idle on the USB, and then start operation. The ULPI will give a squelch (0x0).

It appears that the squelch is missed. Need to look more into the timings...

Updated: My ealier analysis was wrong, modified to update.
User avatar
Ross
XCore Expert
Posts: 967
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Hi,

The exact version should be listed at the top of the sw_usb_audio/README.rst file.

Also, which tools version are you using?

Which SMSC ULPI also pleases?
User avatar
Ross
XCore Expert
Posts: 967
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Something to try...

Change the p_usb_rst parameter to null and compile the attached file into your project.

You might have to change RESET_MASK depending on what I/O you have used for the phy reset line (and maybe the externed p_usb_rst port if you changed it's name..)

Let me know how you get on.
You do not have the required permissions to view the files attached to this post.
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Post by bearcat »

Thanks Ross. That solved it.

You had the hook in the routine already for something like this. Adding a time delay in the reset did it.

Check that one off my list...
User avatar
Ross
XCore Expert
Posts: 967
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Good news :)

The hook was really in place just in case someone needed to do something odd like putting the reset line on a shift register chain.
User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

So what was the problem then? Something wrong with
this particular PHY, something wrong with this XUD version,
something wrong with the host hardware, something wrong
with the host OS, something else?

So many variables!