Migrating "USB Audio MFi Software" to Xcore200 Explorer Board

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
Junior Member
Posts: 7
Joined: Wed Jul 12, 2017 3:44 pm

Migrating "USB Audio MFi Software" to Xcore200 Explorer Board

Post by zoran4afc »

Following my post "XMOS module_usbhost High Speed support" (http://www.xcore.com/viewtopic.php?f=37&t=7008), I am trying to migrate "USB Audio MFi Software" to Xcore200 Explorer Board.
As before, I need only the USB host functionality from the "USB Audio MFi Software" project. That project is targeted to Xcore200 Multichannel Audio Platform.
The USB hardware is the same at MA and Explorer boards, except there is no USB A / USB B port switching at the Explorer board (Explorer board has only USB B micro female port).
After resolving simple cabling and USB power problems (adapting USB B micro male to USB A female and adding external 5V supply for USB A that will be connected to external USB DAC), I expected that the unchanged Host USB code at the Explorer board would, at least, reset the USB Bus and request Device Descriptor, but it never happens.
My goal is to implement the USB Host UAC1/UAC2 driver for xcore200, using Ethernet port for connecting to PC audio player and USB Host port to connect external UAC1 or UAC2 DAC device. Xcore would be used only to connect USB DAC to PC computer using Ethernet.

High Speed USB Host is my first problem, since I got only Full Speed from adapted "USB Audio MFi Software" on the Xcore200 Multichannel Audio Platform, as I described in my earlier post "XMOS module_usbhost High Speed support" (http://www.xcore.com/viewtopic.php?f=37&t=7008).
The second problem, subject of the current topic, is running USB host at the hardware simpler than Xcore200 MA, i.e. at Xcore200 Explorer.
I believe that the key for both problems is in the module_usbhost [swc_usbhost - 3.0.0rc0]. I would adapt the "libUsbHostLLD_x200.a" but I need the source code for that library.

Here is the code fragment from "epManager.c" (module_usbhost_epmanager [swc_usbhost - 3.0.0rc0]) where the execution is stuck, my debug code and comments are marked with "@@":

void USBHostStack(streaming_chanend cClients[NUM_CTRL_CHANENDS], chanend cUSBCtrl)
UsbTransfer *usbTrans;
int disconnectflag[NUM_CTRL_CHANENDS];

// Wake-up handshake

// Receive info on which clients require disconnect notification
// This also sends a wake-up to all connected channels.
startChans(cClients, disconnectflag);

printstrln("USBHostStack@1"); // @@ reached!

// Initial connection
while (USB_Ctrl(cUSBCtrl, USB_CMD_POWER_CYCLE) == 1) {
} // @@ never exits!

printstrln("USBHostStack@2"); // @@ never reached, as if nothing is plugged in

while (1)
int status;

// Run enumeration