Hardware volume

http://www.xmos.com/support/software
FYI

hello
I’ve received my xtag3 adapter, it looks like I can’t connect it directly to the tone board. I’ve you got the schematic to build the adapter cable between them ?
Here is the pinout of the xtag 3 :
1 5V Target to Host Power
2 NC N/A No connection
3 MSEL Host to Target Select boot from JTAG - Active Low
4 GND N/A Ground
5 TDSRC Host to Target JTAG Test Data
6 XL1_UP1 Target to Host xCONNECT Link
7 TMS Host to Target JTAG Test Mode Select
8 GND N/A Ground
9 TCK Host to Target JTAG Test Clock
10 XL1_UP0 Target to Host xCONNECT Link
11 DEBUG Bidirectional Debug
12 GND N/A Ground
13 TDSNK Target to Host JTAG Test Data
14 XL1_DN0 Host to Target xCONNECT Link
15 RST_N Host to Target System Reset - Active Low
16 GND N/A Ground
17 UART_RX Host to Target Serial Port
18 XL1_DN1 Host to Target xCONNECT Link
19 UART_TX Target to Host Serial Port
20 GND N/A Ground
Please, could you provide the mapping versus your debug connector ?

Thanks

1、5V Target to Host Power = 5V0 /TONE_5V
2、GND = GND

5、TDSRC Host to Target JTAG Test Data = TDO
7、TMS Host to Target JTAG Test Mode Select = TMS
9、TCK Host to Target JTAG Test Clock
13、TDSNK Target to Host JTAG Test Data = TDI
15、RST_N Host to Target System Reset - Active Low = RST

1 Like

Thanks a lot !
Now ,i have to create a xn file to dump the firmware !
regards

Dump done,
I’ve got a binary file of 1MB( it looks like the flash memory is not the same as in the schematic (512kB). How to do to be sure that my dump file is correct and i could write it again to the board without brick it ?
thanks

Hi,
I’ve compiled my first firmware and uploaded to the tone board, as expected it doesn’t work :slight_smile: ,no sound but at least the board is recognized as a xmos device, the alsamixer shows the hardware volume so good news.I’ve done basic configuration of the 9038 through i2c and managed the 2 gpios to enable the good audio clock
I think i need advice on the conf file.
here is my setup :



            <!-- Audio Ports -->          
            <Port Location="XS1_PORT_1D"  Name="PORT_MCLK_IN"/>
            <Port Location="XS1_PORT_1P"  Name="PORT_I2S_LRCLK"/>
            <Port Location="XS1_PORT_1O"  Name="PORT_I2S_BCLK"/>
            <Port Location="XS1_PORT_1N"  Name="PORT_I2S_DAC0"/>
            <Port Location="XS1_PORT_4C"  Name="PORT_I2C"/>
            
            <Port Location="XS1_PORT_1O"  Name="PORT_DSD_DAC0"/>
            <port Location="XS1_PORT_1N"  Name="PORT_DSD_DAC1"/>
            <Port Location="XS1_PORT_1P"  Name="PORT_DSD_CLK"/>
            <Port Location="XS1_PORT_16B"  Name="PORT_MCLK_COUNT"/> 

Am I in the right direction ?
Thanks

2 Likes

Hi,
I’ve managed to upload my new firmware , I’ve got now a full working firmware with hardware volume management. The board is very good at debugging, i was able to debug and trace my firmware code.

I can now manage the volume of the spdif input which was impossible before.
Regards

7 Likes

congrats!!! xxxxxxxxx

Hi there!

So cool U guys! :smiley:

I’m trying to do sort of the same thing, but sadly I cannot dump the firmware, and I’m running out of ideas really fast… I’m hoping maybe you can tell me, what I’m doing wrong. :neutral_face:

Now, I’m a total noob so bear with me. Here’s what I’ve tried:

  1. I got myself a Tone B. Generic, an Xcore-200 Multichannel Audio development board and an Xtag 3.

  2. I soldered the 20 pin connector onto the Khadas TB and for the record: Yes, I have tested the soldering for bad connectivity all the way from the pins to the Xmos chip.

  3. I connected the pins as best I could the way I understand your description (and checked connectivity for cable issues):

  4. I created an XN file.

  5. I fired up xflash: xflash --read-all -o khadas_tone_orig_image.bin --target-file xu208-128-qf48-c10.xn

  6. I fixed, ahem, some bugs in the XN file… ahem… :wink:

  7. Once more, I fired up xflash, only now it says:
    xrun: Problem in connection to device
    Error: F03013 Failed to run : 0x7ffee03333c0.

  8. So, now I’m thinking maybe I grilled something, but the TB’s still playing USB music like it should, and xflash --list-devices shows the Xtag very nicely:
    ID Name Adapter ID Devices
    -- ---- ---------- -------
    0 XMOS XTAG-3 WWeHTF1a None
    , although with the Xcore-200, it says: …DevicesO[0], indicating that it doesn’t connect with anything in the TB case.

  9. I also tried dumping the firmware from the Xcore-200 board using the provided XN file; that worked like a charm, throwing me a 2MB binary.

Long story short: I think, I’ve done all that I’m supposed to do, I think, I’ve followed your steps above down to the last detail, I’ve checked for connectivity issues, I’ve checked that the hardware is still functional but I can’t get any firmware out of the thing. I couldn’t find any useful hints when googling the error codes.

My money is on my XN file being the problem, but I really have no idea exactly what’s wrong. :thinking:

Could you please help shed some light on the matter? :slightly_smiling_face:

Kind regards…

Hi,
Here is my xn file

<?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>Device</Type>
  <Name>XU208-128-TQ64-C10 Device</Name>

  <Declarations>
<Declaration>tileref tile[1]</Declaration>
<Declaration>tileref usb_tile</Declaration>
  </Declarations>

  <Packages>
<Package id="0" Type="XS2-UnA-128-TQ64">
  <Nodes>
    <Node Id="0" InPackageId="0" Type="XS2-L8A-128" SystemFrequency="500MHz" OscillatorSrc="1">
      <Boot>
        <Source Location="bootFlash"/>
      </Boot>
      <Tile Number="0" Reference="tile[0]">
      <Port Location="XS1_PORT_1B" Name="PORT_SQI_CS"/>
        <Port Location="XS1_PORT_1C" Name="PORT_SQI_SCLK"/>
        <Port Location="XS1_PORT_4B" Name="PORT_SQI_SIO"/>
        
        <!-- Audio Ports -->          
        <Port Location="XS1_PORT_1D"  Name="PORT_MCLK_IN"/>
        <Port Location="XS1_PORT_1P"  Name="PORT_I2S_LRCLK"/>
        <Port Location="XS1_PORT_1O"  Name="PORT_I2S_BCLK"/>
        <Port Location="XS1_PORT_1N"  Name="PORT_I2S_DAC0"/>
        <Port Location="XS1_PORT_4C"  Name="PORT_I2C"/>
        
        <Port Location="XS1_PORT_1O"  Name="PORT_DSD_DAC0"/>
        <port Location="XS1_PORT_1N"  Name="PORT_DSD_DAC1"/>
        <Port Location="XS1_PORT_1P"  Name="PORT_DSD_CLK"/>
        <Port Location="XS1_PORT_16B"  Name="PORT_MCLK_COUNT"/> 
        
        <!-- USB Ports -->
        <Port Location="XS1_PORT_1H"  Name="PORT_USB_TX_READYIN"/>
        <Port Location="XS1_PORT_1J"  Name="PORT_USB_CLK"/>
        <Port Location="XS1_PORT_1K"  Name="PORT_USB_TX_READYOUT"/>
        <Port Location="XS1_PORT_1I"  Name="PORT_USB_RX_READY"/>
        <Port Location="XS1_PORT_1E"  Name="PORT_USB_FLAG0"/>
        <Port Location="XS1_PORT_1F"  Name="PORT_USB_FLAG1"/>
        <Port Location="XS1_PORT_1G"  Name="PORT_USB_FLAG2"/>
        <Port Location="XS1_PORT_8A"  Name="PORT_USB_TXD"/>
        <Port Location="XS1_PORT_8B"  Name="PORT_USB_RXD"/>
        </Tile>
    </Node>
    <Node Id="1" InPackageId="1" Type="periph:XS1-SU" Reference="usb_tile" Oscillator="24MHz">
    </Node>
  </Nodes>
  <Links>
    <Link Encoding="5wire">
      <LinkEndpoint NodeId="0" Link="8" Delays="52clk,52clk"/>
      <LinkEndpoint NodeId="1" Link="XL0" Delays="1clk,1clk"/>
    </Link>
  </Links>
</Package>
  </Packages>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash">
  <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>

regards

1 Like

Thank you so much! Unfortunately, it still doesn’t work. :confused:

Also, I’ve noticed that the music is garbled for a few seconds the first time I play after connecting the USB. Apparently, it only happens on my Macbook; testing it on Windows worked just fine. Next up is to try the Xtag on Windows. The plot thickens…

BTW: Does anyone else have playback issues with a Macbook? I’ve just tried it on a friend’s MB, and it was the same problem… :neutral_face:

…and now we’ve tried on a Windows PC: Same result… :frowning:

It should work on a Generic TB, right? What am I missing??

Which version you installed? Windows 7, 8 or 10?

Have fun!

Just received my tone board and found there’s no hardware volume control in Volumio. Please update the firmware asap! By the way, we could simply use pc to flash the firmware right?

1 Like

Hi, thanks for your reply!

We get the same result on Windows 10 and OS X Mojave. As mentioned, I tried with the XN file by occip (thanks again!) to no avail, so the fault lies elsewhere. Now, I’m thinking the Xtag, which works like a charm with the Xcore-200 board, so it may simply be my wiring (which I may very well have screwed up…), but after checking, double checking, triple checking, quadruple checking … I haven’t found any faults. My colleague had a look as well, and he also couldn’t find anything obvious.

Again, the Xcore-200 board works perfectly with the Xtag: I can read the firmware, I can xrun on it, I can xflash on it etc. etc. Everything seems to be working the way it should. With the Xtag connected to the TB, however: No connection.

I’m probably missing something, but I have no idea what… :confused:

One thing: Have you tried playing USB Audio from a Macbook? We’re getting some awful noise for a few seconds, after which it plays nicely, but only when playing from a Macbook (Mojave, we tried two different Macbooks, same result). Could you please check out this issue? If it doesn’t happen on other TBs, we may have a hardware defect on our hands…

Cheers!

Same here, Khadas please update XMOS firmware to include hardware volume control. Posts above show that user occip could do it so it’s not too difficult.

1 Like

Congrats occip!
Can you share more details and just control the volume of SPDIF?

We have reserved volume control and mute design but we need an accessory, probably a small PCB with a volume control button.The development of this accessory and the upgrade plan of XMOS software have been scheduled.

1 Like

Could you open source the other parts of your code that works together with that xn? I looked thru the USB audio guide for XMOS and looks like the most complicated part would be the I2C control, other than that it looks just standard parts of the example code.

Hello
I manage the dac volume with the usb interface :
I’m using volumio on a raspberry pi3 connected to IR receiver.
With a remote control I can pause volumio ( the tone board switches to the spdif input), and manage volume. I can do the same thing through the volumio app or a web browser.

A good alternative is to connect the IR Receiver directly to volume pin of the tone board with software handling.