Multichannel USB failing on Mac when unplug/replug

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
Machdisk
Member++
Posts: 20
Joined: Wed Aug 01, 2018 11:17 am

Multichannel USB failing on Mac when unplug/replug

Post by Machdisk »

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: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

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

Post by Machdisk »

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: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

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:
https://www.xcore.com/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

Post by Machdisk »

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

Post by mon2 »

Have a quick read through this thread:

https://www.xcore.com/viewtopic.php?f=37&t=5808
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

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

Post by Machdisk »

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

Post by Machdisk »

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

Post by Machdisk »

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?