How to use AN00125 USB Mass Storage Class with xCORE-200 Mul

If you have a simple question and just want an answer.
gearthwormist
New User
Posts: 2
Joined: Tue Sep 08, 2015 10:35 pm

How to use AN00125 USB Mass Storage Class with xCORE-200 Mul

Post by gearthwormist »

Trying to get the USB Mass Storage Class example from AN00125 to work on an xCORE-200 Multichannel Audio Platform board. After modifying the code to work with that board, when I run the project, the board does not appear on the USB bus.

Using the debugger, I have determined that tile[1] core[2] is stuck in XUD_Manager_loop waiting for the USB clock:

Code: Select all

        /* Wait for USB clock (typically 1ms after reset) */        p_usb_clk when pinseq(1) :> int _;
I have attached an archive of the project I am working on. (For some reason the xk-audio-216-mc.xn file was not included in the archive; I am using a copy I found in the app_usb_aud_xk_216_mc project since I could not find it in Install New Hardware.)

Any ideas what is going wrong?
You do not have the required permissions to view the files attached to this post.
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1164
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

You're most of the way, and of course it should work OK!

 On tile 0, port F controls the mux and vbus control for USB. By default, D+ and D- won't reach the micro USB B connector. So you need to add this to get USB coming out to your port.

on tile[0]: out port port_4f = XS1_PORT_4F;

on tile[0]: {

    port_4f <: 0x7; //11 = USB B and VBUS enable

    while(1);

}

You need the while (1) or else the ports get de-init'ed on exit of the task. 
Give this a try...

 

Engineer at XMOS