Xscope on a Custom Board

Technical questions regarding the XTC tools and programming with XMOS.
Antinh
Junior Member
Posts: 4
Joined: Fri Feb 20, 2015 12:05 pm

Xscope on a Custom Board

Post by Antinh »

Hi,

I am trying to get Xscope to work on a custom board that is using a XS1-L01A-LQ64-C4 but I'm having trouble.

I've written a very simple piece of code (prints hello world!) that I have managed to successfully run with Xscope on different development boards (Startkit and a couple Slicekits); which leads me to think that it must be something to do with either the XN file that I have edited or a hardware problem.

Regarding the hardware, I believe that I have tested everything that could cause an issue in using Xscope and all seems fine. I am using Link B and have done continuity checks; I was also able to send a square wave along the link without Xscope configured.

Would it be possible for someone to have a quick look at my XN file to see if I have done something silly? This would really help me to narrow down the list of possible causes.

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>Device</Type>
  <Name>XS1-L01A-LQ64-C4 Device</Name>
  
  <Declarations>
    <Declaration>tileref tile[1]</Declaration>
  </Declarations>
    
  <Packages>
    <Package id="0" Type="XS1-L1A-LQ64">
      <Nodes>
        <Node Id="0" InPackageId="0" Type="XS1-L1A"
        Oscillator="25MHz" SystemFrequency="400MHz">
          <Tile Number="0" Reference="tile[0]">
	  </Tile>
        </Node>
      </Nodes>
    </Package>
  </Packages>

  <Nodes>
    <Node Id="1" 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="X0LB" />
        <LinkEndpoint NodeId="1" Chanend="1" />
    </Link>
  </Links>
	
  <JTAGChain>
     <JTAGDevice NodeId="0"/>
  </JTAGChain>

</Network>
Also, on the line with:

<Chanend Identifier="c" end="3"/>

I'm not quite sure what "end" refers to and why it is the number 3. I can see that it is different to Chanend so I'm not sure what "end" this is.

Any help will be greatly appreciated!
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Hi. Disclaimer - do not have immediate experience with this topic but here are a few pointers through observations of assorted readings.

Reference:
https://www.xmos.com/support/tools/docu ... nent=14814

1) Remove the keyword "clk" from:

Delays="5clk"

and change to:

Delays="4,4"

2) Suspecting the issue is inside this area:

<Nodes>
<Node Id="1" 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="X0LB" />
<LinkEndpoint NodeId="1" Chanend="1" />
</Link>
</Links>

Remove the above block of text and review the following for good examples:

http://www.xcore.com/questions/2043/can ... e-processo

https://www.xmos.com/support/tools/docu ... nent=14796
Antinh
Junior Member
Posts: 4
Joined: Fri Feb 20, 2015 12:05 pm

Post by Antinh »

Hi Mon2,

Thanks for having a quick look. I have tried what you suggested but it still does not seem to work.

I now understand what "end" is now thanks to the docs you linked though.

I should add that I got the XN file for the XS1-L01A-LQ64-C4 from the deprecated folder under targets where all the XN files are kept. This XN file didn't have any Xscope configuration and so had to be edited. I did this by looking at other XN files of boards that have working Xscope functionality.

The good examples that you suggest I follow seem to configure the XConnect Links slightly differently to how the current XN files do it. Mainly, that the RoutingId is configured in a Node and the LinkEndpoint is associated with this Node.

However, I have tried doing it both ways, also with different values for "Delays", with the same result.

It might also be of interest that I boot over JTAG.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Hi Antinh. Aside from Xscope not working, do you have an onboard LED you can use to debug your code. Can you get a LED to flash on / off with your custom board ?

This document offers details on how to boot from JTAG (although could not locate a specific example using this syntax for JTAG boot):

https://www.xmos.com/support/tools/docu ... nent=14814

You will need to define a boot element and also:

<Source Location="SPI:bootFlash"/> ; usually default will need to be replaced with:

<Source Location="LINK"/> ; not the complete syntax so you will need to modify to suit your board. Note to XMOS - a clear example using LINK with JTAG boot will be excellent to have in the documentation.

I would suggest to work on getting the boot from JTAG to function using a LED or something simple like monitor a slow pulse train on a free pin before moving to the Xscope testing. This will also validate that your custom hardware design is operational.

Power supply details such as current draw, voltage pins, sequencing all confirmed to be ok ?
Antinh
Junior Member
Posts: 4
Joined: Fri Feb 20, 2015 12:05 pm

Post by Antinh »

Hi Mon2,

I have several IO on the custom board and all have been tested and are working.
I have not had to define a boot element in my XN file before and the chip seems to boot over JTAG fine; I have normal functionality in terms of reading/writing over IO (both physically with pulses and also printing over JTAG), so I don't think that this is my problem.

Power sequencing and voltage/current levels are all ok.

The only problem that I am having with the board is getting Xscope to work. As mentioned in my initial post, I think that the problem is either in my XN file or possibly something in my hardware design. Although, I have tested the pins for XConnect Link B which seem ok and everything else on the board works.

So I'm a bit stuck! :S
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Hi Antinh. This is an interesting topic and will be more of importance to us as well very soon as we close some pending XMOS based prototypes.

Which toolchain version are you using ? Found some details, somewhere in the user forums (believe user TSC pointed out this detail) that the DEVICE NAMES have changed with the tools so you may be out of sync.

Specifically, assuming you are using the most recent 14.0.2 toolchain, just created an empty project using your referenced target XMOS device and the XN file reads as follows:

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>Device</Type>
  <Name>XS1-L4A-64-TQ48-C4 Device</Name>
  
  <Declarations>
    <Declaration>tileref tile[1]</Declaration>
  </Declarations>

  <Packages>
    <Package id="0" Type="XS1-LnA-64-TQ48">
      <Nodes>
        <Node Id="0" InPackageId="0" Type="XS1-L4A-64" SystemFrequency="400MHz">
          <Tile Number="0" Reference="tile[0]"/>
        </Node>
      </Nodes>
    </Package>
  </Packages>

  <JTAGChain>
     <JTAGDevice NodeId="0"/>
  </JTAGChain>

</Network>
Suggesting to do the same and allow for the toolchain to auto-create a supporting XN file for this target component. The use of the older device name style may be confusing the tool.
Antinh
Junior Member
Posts: 4
Joined: Fri Feb 20, 2015 12:05 pm

Post by Antinh »

Hi Mon2,

I'm actually using the 14.0.3 toolchain, but I was right when I said it was either the XN file or something in my Hardware design. It turns out that the XN file wasn't my problem after all.

I'm using an XTAG V2 adapter, with an XA-SK-XTAG2 adapter to connect the XSYS header to a Slicekit chain connector on my board. My problem was that the XA-SK-XTAG2 adapter is wired so that the Xscope channel to the XSYS header is connected to Link A on the SliceKit chain connector (I was using Link B). All a bit confusing; I had to have a look through the schematics to work this one out.

Thanks for the time that you put in to this topic! It has been quite useful anyway actually. Hopefully we can all learn from this :P