Multichannel USB failing on Mac when unplug/replug

Technical discussions around xCORE processors (e.g. General Purpose (L/G), xCORE-USB, xCORE-Analog, xCORE-XA).
Machdisk
Member++
Posts: 20
Joined: Wed Aug 01, 2018 11:17 am

Multichannel USB failing on Mac when unplug/replug

Postby Machdisk » Wed May 08, 2019 9:36 am

Hello All,

We are seeing an odd crash occurring when we un plug and replug the USB of our XU224 board into a device running MacOS. This only occurs when we have passed some audio through it first though.

To replicate the fault:
1) Plug in the Xu224 USB
2) Pass audio via the core audio asio driver
3) Unplug the USB
4) Replug the USB
5) Device will not be detected by the Mac but will keep running it’s other tasks otherwise (GPIO handling etc continues to run without any interruption, it's only the USB that won't recover).
6) To recover, the XU224 must be power cycled and it always comes back after being reset.

Additionally we have noticed that:

1) The VBUS behaves differently after a crash. When first powered up the Vbus will sit at 0V until the USB is plugged in when it will go to 5V, if the unit is unplugged without passing audio then Vbus will drop to about 2.1V and will be redetected if plugged back into the mac. However if audio is passed before unplugging then Vbus drops down to 0V when the USB is unplugged and then the device cannot be redetected.
2) The XU216 based explorer kit board does not do the same thing if we run the same test case code on both the explorer board and our XU224 board (Stock USB reference firmware with appropriate XN). Our board fails while the 216 works OK.
The only relevant difference between the two we can find is that the Explorer kit has slightly different hardware on the VBUS line. (Ferrite instead of resistor in line and different cap values), Our board has these parts as per the latest version of the XU224 datasheet.

Does anyone have any idea what could be causing this behaviour? The unit is otherwise rock solid (Does not have the same issue on Windows for instance)
User avatar
mon2
XCore Legend
Posts: 1385
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Wed May 08, 2019 12:41 pm

Can you post the (partial) schematic of the VBUS interface to the XMOS CPU for your custom design?

Is your product USB Bus powered or self-powered using an external power supply?
Machdisk
Member++
Posts: 20
Joined: Wed Aug 01, 2018 11:17 am

Postby Machdisk » Wed May 08, 2019 4:13 pm

Sure no problem, see the attached. Also the device is self powered and works stably for days of audio streaming if left alone. It only falls over when we disconnect and reconnect.
You do not have the required permissions to view the files attached to this post.
User avatar
mon2
XCore Legend
Posts: 1385
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Wed May 08, 2019 4:21 pm

Did you configure the proper value for the SELF POWERED definition inside of customdefines.h file?

https://www.xmos.com/developer/publishe ... 9.a&page=3

xmos_self_powered.png


reference:
viewtopic.php?t=4525
You do not have the required permissions to view the files attached to this post.
Machdisk
Member++
Posts: 20
Joined: Wed Aug 01, 2018 11:17 am

Postby Machdisk » Wed May 08, 2019 5:01 pm

Yep, Self powered is defined as 1
User avatar
mon2
XCore Legend
Posts: 1385
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Thu May 09, 2019 3:31 am

Have a quick read through this thread:

viewtopic.php?f=37&t=5808
User avatar
mon2
XCore Legend
Posts: 1385
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Thu May 09, 2019 12:43 pm

How does your widget behave on a Windows PC ?
Machdisk
Member++
Posts: 20
Joined: Wed Aug 01, 2018 11:17 am

Postby Machdisk » Thu May 09, 2019 2:12 pm

Mostly seems to behave itself on windows PC. On Mac (multiple different macs) it's a guarantee that it will fail. Connect, pass audio, disconnect, reconnect and not recognised. Windows will work for hundreds of cycles.

Though it does occasionally seem to get in a similar state where it isn't recognised and needs to be power cycled but I think that is something else with the software as I have to be doing a lot of fiddling with settings to cause that on windows and I believe it didn't do that till the latest build. The mac issue is consistent even with the off the shelf test builds
Machdisk
Member++
Posts: 20
Joined: Wed Aug 01, 2018 11:17 am

Postby Machdisk » Fri May 10, 2019 2:30 pm

On another board it has the same issue on both Windows and mac devices
Machdisk
Member++
Posts: 20
Joined: Wed Aug 01, 2018 11:17 am

Postby Machdisk » Fri May 10, 2019 3:03 pm

OK, bit of an update, I tried with a new build that changes the portmap to do with a couple of other ports on tile 2 which handle ADAT inputs and outputs (USB is on tile 0) and suddenly the USB crashing behaviour is much worse. It now happens on both MacOS and on windows and happens with every disconnect/reconnect without fail. Going back to the old software restores the older behaviour. Also when it does seem to connect it takes longer to be recognised by the host machine. Is there some kind of timeout that could be getting tripped?

Who is online

Users browsing this forum: No registered users and 0 guests