I'll be honest, even after going through the "Tools User Guide" the creation/tweaking of XN files escapes me. I'm trying to do something pretty basic, continuously send a packet back and forth between to XS-L1 Custom boards. The program compiles but when I scope pins 52-55 on the 1st board with my Saleae I get nothing. Would someone be willing to take a look at my XN file and code to see if I'm on the right track? I'm almost positive the problem is in setting up the links in my XN file. Any help is greatly appreciated!
Additionally, does anyone know where I can get a detailed datasheet on the XLINK protocol including timing diagrams and the process to initialize/release the links?
MAIN.XC
Code: Select all
#include <platform.h>
#include <xs1.h>
#include <print.h>
// Xcore 0 Ports
void XlinkTrans (chanend INTO, chanend OutOf)
{
unsigned int time;
timer t;
unsigned tmp;
while(1)
{
t :> time;
select
{
case INTO :> tmp: // wait for message from another core
{
t when timerafter(time + 5000) :> time;
OutOf <: tmp;
break;
}
}
}
}
void main(void)
{
chan Chans[2];
par
{
on stdcore [0]: {
Chans[0] <: 1;
XlinkTrans(Chans[1], Chans[0]);
}
on stdcore [1]: XlinkTrans(Chans[0], Chans[1]);
}
}
The XN File
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>
<Declarations>
<Declaration>core stdcore[2]</Declaration>
</Declarations>
<Packages>
<Package Type="XS1-L1A-TQ48" Id="whatever">
<Nodes>
<Node InPackageId="0" Type="XS1-L1A" id="0" oscillator="13Mhz" systemfrequency="500MHz" referencefrequency="100MHz">
<Core Number="0" Reference="stdcore[0]">
<Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO"/>
<Port Location="XS1_PORT_1B" Name="PORT_SPI_SS"/>
<Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK"/>
<Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI"/>
<Port Name="UIFM_INT_CLK_PORT" Location="XS1_PORT_1I"/>
<Port Name="UIFM_USB_CLK_PORT" Location="XS1_PORT_1H"/>
<Port Name="UIFM_REG_WRITE_PORT" Location="XS1_PORT_8C"/>
<Port Name="UIFM_REG_READ_PORT" Location="XS1_PORT_8D"/>
<Port Name="UIFM_FLAG_0_PORT" Location="XS1_PORT_1N"/>
<Port Name="UIFM_FLAG_1_PORT" Location="XS1_PORT_1O"/>
<Port Name="UIFM_FLAG_2_PORT" Location="XS1_PORT_1P"/>
<Port Name="UIFM_TX_DATA_PORT" Location="XS1_PORT_8A"/>
<Port Name="UIFM_RX_DATA_PORT" Location="XS1_PORT_8B"/>
<Port Name="UIFM_STP_SUS_PORT" Location="XS1_PORT_1E"/>
<Port Name="UIFM_LS_PORT" Location="XS1_PORT_4D"/>
</Core>
</Node></Nodes>
</Package>
<Package Type="XS1-L1A-TQ48" Id="whatever1">
<Nodes>
<Node InPackageId="0" Type="XS1-L1A" id="1" oscillator="13Mhz" systemfrequency="500MHz" referencefrequency="100MHz">
<Core Number="0" Reference="stdcore[1]">
<Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO" />
<Port Location="XS1_PORT_1B" Name="PORT_SPI_SS" />
<Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK" />
<Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI" />
<Port Name="UIFM_INT_CLK_PORT" Location="XS1_PORT_1I" />
<Port Name="UIFM_USB_CLK_PORT" Location="XS1_PORT_1H" />
<Port Name="UIFM_REG_WRITE_PORT" Location="XS1_PORT_8C" />
<Port Name="UIFM_REG_READ_PORT" Location="XS1_PORT_8D" />
<Port Name="UIFM_FLAG_0_PORT" Location="XS1_PORT_1N" />
<Port Name="UIFM_FLAG_1_PORT" Location="XS1_PORT_1O" />
<Port Name="UIFM_FLAG_2_PORT" Location="XS1_PORT_1P" />
<Port Name="UIFM_TX_DATA_PORT" Location="XS1_PORT_8A" />
<Port Name="UIFM_RX_DATA_PORT" Location="XS1_PORT_8B" />
<Port Name="UIFM_STP_SUS_PORT" Location="XS1_PORT_1E" />
<Port Name="UIFM_LS_PORT" Location="XS1_PORT_4D" />
</Core>
</Node></Nodes>
</Package></Packages>
<Links>
<Link Encoding="2wire" Delays="15,15">
<LinkEndpoint NodeId="0" Link="X0LC" />
<LinkEndpoint NodeId="1" Link="X0LB" />
</Link></Links>
<ExternalDevices>
<Device Nodeid="0" Core="0" Class="SPIFlash" Name="bootFlash" Type="W25X40">
<Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO"/>
<Attribute Name="PORT_SPI_SS" Value="PORT_SPI_SS"/>
<Attribute Name="PORT_SPI_CLK" Value="PORT_SPI_CLK"/>
<Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI"/>
</Device>
</ExternalDevices>
<JTAGChain>
<JTAGDevice NodeId="0" Position="0" /><JTAGDevice NodeId="1" Position="1" /></JTAGChain>
</Network>