Page 2 of 2

Re: Hello ad first problem

Posted: Mon Oct 16, 2017 10:34 am
by infiniteimprobability
Hi,
I just downloaded the test binary I posted and tried on a different board and it works fine (enumerates as stereo USB audio class 1 device). So I have to conclude there is a HW issue with your board - probably at the USB end.
Checking BCLK and LRCLK toggling will be interesting, but I think it won't fix the USB interface and the debugger is saying the code runs fine.

I know it's a pain, but I'd suggest returning the board from your supplier. Please feel free to reference this thread.

Re: Hello ad first problem

Posted: Wed Oct 25, 2017 11:53 am
by PaoloF
All right, I already figured I had to ship the board to the assistance, but first I would like to have a last test:
in the tests I've done so far, I've always used the micro-USB port, can you use the USB type-A?
If the issue is at USB end, is possible that USB type-A work well?
I tried to connect an type-A/type-A cable, but from the documentation I did not understand how I should do it to enable it

Re: Hello ad first problem

Posted: Wed Oct 25, 2017 2:16 pm
by infiniteimprobability
hi,
yes it should be. In audiohw.xc you can see the following section:

Code: Select all

    /* 0b11 : USB B */
    /* 0b01 : Lightning */
    /* 0b10 : USB A */
#ifdef USB_SEL_A
    set_gpio(P_GPIO_USB_SEL0, 0);
    set_gpio(P_GPIO_USB_SEL1, 1);
#else
    set_gpio(P_GPIO_USB_SEL0, 1);
    set_gpio(P_GPIO_USB_SEL1, 1);
#endif
so it looks like you just need to define USB_SEL_A to get that socket to work. The LED should swap over (see schematic or hw manual).

The low level USB software still wants to see VBUS though to tell it a host is present so ensure that you do:

Code: Select all

    set_gpio(P_GPIO_VBUS_EN, 1);
to get VBUS to drive back to the xmos chip (you can see this further down). This will also drive 5v out of USB A too so be careful about driving 5v against 5v!

Re: Hello ad first problem

Posted: Tue Apr 16, 2024 9:25 pm
by jb123
so it looks like you just need to define USB_SEL_A to get that socket to work.
What is `USB_SEL_A`? It seems to disable `XUD_UserSuspend` and `XUD_UserResume` if not defined?

Re: Hello ad first problem

Posted: Wed Apr 17, 2024 10:25 pm
by jb123
Apparently it enables a USB A port on the XK-AUDIO-216-MC-AB? To act as a USB Host?

Code: Select all

6.12.3
------

  * ADDED:      Added roleswitch compatible build config to app_usb_aud_x200
  * CHANGE:     iPod detect code upataed and USB mux set appropriately for
    roleswitch (guarded by USB_SEL_A)

Code: Select all

#Audio Class 2, iAP enabled, Input, Output, No,  No SPDIF Tx. Select USB A port. Ignore VBUS.
#Note, this is the config used for Apple role-switch
XCC_FLAGS_2ioxx_usba_mfi = $(BUILD_FLAGS) -DIAP=1 -DMIDI=0 -DSPDIF_TX=0 -DUSB_SEL_A=1 -DXUD_PWR_CFG=0
INCLUDE_ONLY_IN_2ioxx_usba_mfi =
9
USB Connectivity
The USB connectivity section consists of a USB A connector, USB B connector and a
high-speed 3:1 switch to select between them.
MFi support for Apple Host Mode and USB Role Switch
So this is mostly irrelevant now that "USB Device Mode is not recommended for most accessories"?