No LRCLK, BLCK, audio in custom XU316-1024-QF60B-C32

Discussions about USB Audio on XMOS devices
Zetika
Junior Member
Posts: 7
Joined: Tue Jun 13, 2023 10:38 pm

No LRCLK, BLCK, audio in custom XU316-1024-QF60B-C32

Post by Zetika »

I'm programming the XU316-1024-QF60B as a USB audio interface based on multichannel audio v.8.1.0
The xn file is:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.xmos.com http://www.xmos.com">
  <Type>Board</Type>
  <Name>ClearOne xmos code</Name>

  <Declarations>
    <Declaration>tileref tile[2]</Declaration>
  </Declarations>

  <Packages>
    <Package id="0" Type="XS3-UnA-1024-QF60B">
      <Nodes>
        <Node Id="0" InPackageId="0" Type="XS3-L16A-1024" Oscillator="24MHz" SystemFrequency="600MHz" ReferenceFrequency="100MHz">
          <Boot>
            <Source Location="bootFlash"/>
          </Boot>
          <Tile Number="0" Reference="tile[0]">
            <Port Location="XS1_PORT_1B" Name="PORT_SQI_CS"/>   <!-- X0D01-->
            <Port Location="XS1_PORT_4B" Name="PORT_SQI_SIO"/>  <!-- X0D04, X0D05, X0D06, X0D07-->
            <Port Location="XS1_PORT_1C" Name="PORT_SQI_SCLK"/> <!-- X0D10-->
            
            <!-- I2C -->
            <Port Location="XS1_PORT_1L"  Name="PORT_I2C_SCL"/> <!-- X0D35 -->
            <Port Location="XS1_PORT_1M"  Name="PORT_I2C_SDA"/> <!-- X0D36 -->

            <!-- Clocking --> 
            <Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
            <Port Location="XS1_PORT_1N"  Name="PORT_MCLK_IN_USB"/>
          
            
          </Tile>
          <Tile Number="1" Reference="tile[1]">
            <!-- Audio Ports: I2S -->         
            <Port Location="XS1_PORT_1A"  Name="PORT_I2S_DAC0"/>  <!-- XMOS_SDO0  X1D00-->
            <Port Location="XS1_PORT_1B"  Name="PORT_I2S_LRCLK"/> <!-- XMOS_LRCK X1D01-->
            <Port Location="XS1_PORT_1C"  Name="PORT_I2S_BCLK"/>  <!-- XMOS_BCLK X1D10-->
            <Port Location="XS1_PORT_1D"  Name="PORT_MCLK_IN"/>   <!-- MCLK_XMOS X1D11-->
            <port Location="XS1_PORT_1F"  Name="PORT_I2S_DAC1"/>  <!-- XMOS_SDO1 X1D13-->
            <Port Location="XS1_PORT_1G"  Name="PORT_I2S_ADC0"/>  <!-- XMOS_SDI0 X1D22-->
            <Port Location="XS1_PORT_1K"  Name="PORT_I2S_ADC1"/>  <!-- XMOS_SDI0 X1D31-->
          </Tile>
        </Node>
      </Nodes>
    </Package>
  </Packages>
  <Nodes>
    <Node Id="2" Type="device:" RoutingId="0x8000">
      <Service Id="0" Proto="xscope_host_data(chanend c);">
        <Chanend Identifier="c" end="3"/>
      </Service>
    </Node>
  </Nodes>
  <Links>
    <Link Encoding="2wire" Delays="5clk" Flags="XSCOPE">
      <LinkEndpoint NodeId="0" Link="XL0"/>
      <LinkEndpoint NodeId="2" Chanend="1"/>
    </Link>
  </Links>
  <ExternalDevices>
      <Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" PageSize="256" SectorSize="4096" NumPages="16384">
      <Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS"/>
      <Attribute Name="PORT_SQI_SCLK"   Value="PORT_SQI_SCLK"/>
      <Attribute Name="PORT_SQI_SIO"  Value="PORT_SQI_SIO"/>
    </Device>
  </ExternalDevices>
  <JTAGChain>
    <JTAGDevice NodeId="0"/>
  </JTAGChain>
</Network>
I am building it with:
XCC_FLAGS_1AMi2o2xxxxxx = $(BUILD_FLAGS) -DAUDIO_CLASS=1 \
-DXUA_DFU_EN=0 \
-DXUA_USE_SW_PLL=1 \
-DMAX_FREQ=48000 \
-DMIN_FREQ=48000 \
-DI2S_CHANS_DAC=2 \
-DI2S_CHANS_ADC=2 \
-DNUM_USB_CHAN_IN=2 \
-DNUM_USB_CHAN_OUT=2 \
-DMIXER=0

I am receiving the PORT_MCLK_IN signal and it is connected to PORT_MCLK_IN_USB but I don't receive PORT_I2S_LRCLK, PORT_I2S_BCLK or audio from the host. When I change the ports and put it on a XK-Audio-316-MC-AB it works. No idea what is happening, I need help.

Thank you.
User avatar
Ross
Verified
XCore Legend
Posts: 1070
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

If you're getting an MCLK on Tile[1] 1D then the device has booted and the App PLL is configured, so that's a good start

For your board, have you removed the code in AudioHWConfig() and AudioHwInit() that will be trying to access the external HW on the XK-AUDIO-316-MC board?
Technical Director @ XMOS. Opinions expressed are my own
Zetika
Junior Member
Posts: 7
Joined: Tue Jun 13, 2023 10:38 pm

Post by Zetika »

Opsssss, you are right, I forgot to remove it, now it is working. Thank you very much.