porting USB Audio to xu208 / does not enumerate

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Try to test different USB based XMOS IP projects and review this thread which appears to be on topic with the same posted error code:

https://www.xcore.com/forum/viewtopic.p ... it=#p20441


mrtok
Member
Posts: 11
Joined: Fri Nov 11, 2016 8:30 am

Post by mrtok »

did i mention that the same source (different compile) runs on the multichannel audio board without problems?

if i understand the thread you mentioned correct, the problem was located in the newer usb lib code.

my understanding is that is the same lib runs on the mc board it should run on our design too.
(ok - there could be some #ifdefs regarding the target which is used, but this is out of my scope)

thanks again :-)
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Thomas, the CPU which you are using is not exactly the same as on the working ref board. Wondering if this is a resource issue between the 2 designs.

Have you validated if your target PCB is able to run any USB related project ?

Consider to test the relatively simple USB CDC design with the use of your specific CPU XU208 during the build. Then post your results.

Try:

https://www.xmos.com/support/appnotes/AN00184

posted here:

https://www.xmos.com/support/appnotes?s ... 20examples

The focus of this simple project is to just have your target PCB spit out some valid USB IDs during enumeration to confirm the USB interface is functional.
mrtok
Member
Posts: 11
Joined: Fri Nov 11, 2016 8:30 am

Post by mrtok »

mon2, I already use a simple design (an00182 - hid example) nevertheless

i started a new one with your appnote

i had to modify makefile: change to use xu208:
# In this case, the target depends on the build configuration.
TARGET = XU208-256-TQ64-C10

and setting the USB_TILE correctly

XCC_FLAGS = -Wall -O3 -report -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -g -DUSB_TILE=tile[0]

I modified main.xc so that USB_ports are not used for I2C:

// I2C interface ports
on tile[0]: port p_scl = XS1_PORT_1A;
on tile[0]: port p_sda = XS1_PORT_1B;

(don´t know if these ports are available but should not conflict with USB internal ports of xu208)

Result:
no enumeration

attached complete project as zip

--
lsusb output only shows the XMOS JTAG
MB-Thomas:~ thomas$ lsusb -d 20b1: -v

Bus 020 Device 022: ID 20b1:f7d4 XMOS Ltd
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 255 Vendor Specific Subclass
bDeviceProtocol 255 Vendor Specific Protocol
bMaxPacketSize0 64
idVendor 0x20b1 XMOS Ltd
idProduct 0xf7d4
bcdDevice 10.06
iManufacturer 1 XMOS
iProduct 2 XMOS XTAG-3
iSerial 5 XD00ieGiwMn.tcvt
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 55
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 3 Not Used
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 3 Not Used
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Another possible s/w only tool to try to debug your case:

http://www.thewindowsclub.com/usb-devic ... r-download

https://msdn.microsoft.com/en-us/librar ... s.85).aspx

Very interested to see the logs of the USB packet(s) from your design.

Hoping that your USB interface is not damaged.

Do you have more than one of these custom PCBs for testing ? If yes, do they both behave in the same manner ?
mrtok
Member
Posts: 11
Joined: Fri Nov 11, 2016 8:30 am

Post by mrtok »

mon2 wrote: Do you have more than one of these custom PCBs for testing ? If yes, do they both behave in the same manner ?
second PCB tested - same behavior. :-(
mrtok
Member
Posts: 11
Joined: Fri Nov 11, 2016 8:30 am

Post by mrtok »

=========================== USB Port7 ===========================

Connection Status : 0x02 (Device failed enumeration)
Port Chain : 2-7
Properties : 0x00
IsUserConnectable : no
PortIsDebugCapable : no
PortHasMultiCompanions : no
PortConnectorIsTypeC : no

======================== USB Device ========================

+++++++++++++++++ Device Information ++++++++++++++++++
Device Description : Unbekanntes USB-Gerät (Fehler beim Anfordern einer Gerätebeschreibung.)
Device Path : \\.\usb#vid_0000&pid_0002#5&1d65b4dc&0&7#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Device ID : USB\VID_0000&PID_0002\5&1D65B4DC&0&7
Hardware IDs : USB\DEVICE_DESCRIPTOR_FAILURE
Driver KeyName : {36fc9e60-c465-11cf-8056-444553540000}\0011 (GUID_DEVCLASS_USB)
Driver Inf : C:\WINDOWS\inf\usb.inf
Legacy BusType : PNPBus
Class : USB
Class GUID : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Interface GUID : {a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Enumerator : USB
Location Info : Port_#0007.Hub_#0003
Manufacturer Info : (Standard-USB-Hostcontroller)
Capabilities : 0x60 (SilentInstall, RawDeviceOK)
Status : 0x01802400 (DN_HAS_PROBLEM, DN_DISABLEABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code : 43 (CM_PROB_FAILED_POST_START)
Address : 7
Power State : D3 (supported: D0, D3, wake from D0)

---------------- Connection Information ---------------
Connection Index : 0x07 (7)
Connection Status : 0x02 (DeviceFailedEnumeration)
Current Config Value : 0x00
Device Address : 0x00 (0)
Is Hub : 0x00 (no)
Number Of Open Pipes : 0x00 (0)
Device Bus Speed : 0x02 (High-Speed)

--------------- Connection Information V2 -------------
Connection Index : 0x07 (7)
Length : 0x10 (16 bytes)
SupportedUsbProtocols : 0x03
Usb110 : 1 (yes)
Usb200 : 1 (yes)
Usb300 : 0 (no)
ReservedMBZ : 0x00
Flags : 0x00
DevIsOpAtSsOrHigher : 0 (Is not operating at SuperSpeed or higher)
DevIsSsCapOrHigher : 0 (Is not SuperSpeed capable or higher)
DevIsOpAtSsPlusOrHigher : 0 (Is not operating at SuperSpeedPlus or higher)
DevIsSsPlusCapOrHigher : 0 (Is not SuperSpeedPlus capable or higher)
ReservedMBZ : 0x00

------------------ Device Descriptor ------------------
bLength : 0x00 (0 bytes)


again no packet capture
--

second device will be tested soon...
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

frido1 reported:
Accordingly, I built AN00124 version 2.0.0 which works. It seems that the newer versions of the used libraries in v2.0.1 and v2.0.2 are causing problems.

Interesting enough is that I face the same issue (USB device fails enumeration) if I build an run the latest version (sw_usb_audio-[sw]_6.14.0beta2) of an application of the USB audio framework. Using an older version (sw_usb_audio-[sw]_6.12.6) results in a functional USB soundcard...
Would you please try again but compile using the older sw_usb_audio-[sw]_6.12.6 ?

Note: AN00124 was for a different target kit but worth reviewing the above details as the issue appears to be the same.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Thomas, was your most recent post that your custom board # 2 is also not working with the USB projects ?

If yes, cannot believe that ESD is the issue for the 2 non-working boards. Review the possible USB library related issues as noted by frido1 and the work around is to use an older version. Looking for valid USB IDs to be broadcasted from your hardware.

If you are comfortable with the idea, post a minimal complete project for testing this USB interface. The same project should work with the XMOS XCORE-200 (official) hardware. Have the XCORE-200 Explorer kit somewhere in the building and can test against that target as soon as there a bit of free time. We have assorted USB bus analyzers as well (USB 1.1, USB 2.0 & USB 3.1 Gen 1).

To be sure we have it right,

project with the XE216-512-TQ128 as the target (ie. XMOS official boards) - the USB project will function ok

same project with the XU208 as the target (your custom board) - the USB project will fail to enumerate on the USB interface

Correct ?
mrtok
Member
Posts: 11
Joined: Fri Nov 11, 2016 8:30 am

Post by mrtok »

mon2 wrote:Thomas, was your most recent post that your custom board # 2 is also not working with the USB projects ?
yes.
If yes, cannot believe that ESD is the issue for the 2 non-working boards. Review the possible USB library related issues as noted by frido1 and the work around is to use an older version. Looking for valid USB IDs to be broadcasted from your hardware.
ok. Update: I did with AN00124 and version 2.0.0 - without success.
If you are comfortable with the idea, post a minimal complete project for testing this USB interface. The same project should work with the XMOS XCORE-200 (official) hardware. Have the XCORE-200 Explorer kit somewhere in the building and can test against that target as soon as there a bit of free time. We have assorted USB bus analyzers as well (USB 1.1, USB 2.0 & USB 3.1 Gen 1).
I also tested the AN00182 design with the official XMOS MC Audio Board v2 with XE216 on board. no probs. could not attach project zip because its too large - but it is the example latest version.
To be sure we have it right,

project with the XE216-512-TQ128 as the target (ie. XMOS official boards) - the USB project will function ok
yes.
same project with the XU208 as the target (your custom board) - the USB project will fail to enumerate on the USB interface

Correct ?
yes.

Today or tomorrow I will get an analyzer too.

Another question regarding VBUS connection:
the multichannel board uses a 100nF cap to GND. The datasheets states that a 2.2uF cap needs to be connected.

so I am a bit confused. (used the 100nF as the multichannelboard did - tested the 2.2u without success)

Thanks again.
Attachments
Bildschirmfoto 2016-11-15 um 13.17.28.png
datasheet XU208-256-TQ64 page 21
(44.29 KiB) Not downloaded yet
Bildschirmfoto 2016-11-15 um 13.17.28.png
datasheet XU208-256-TQ64 page 21
(44.29 KiB) Not downloaded yet
Bildschirmfoto 2016-11-15 um 13.17.17.png
multichannel audio ref board layout
(63.98 KiB) Not downloaded yet
Bildschirmfoto 2016-11-15 um 13.17.17.png
multichannel audio ref board layout
(63.98 KiB) Not downloaded yet
Post Reply