XN File

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am

XN File

Post by rp181 »

I have the follow 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>
	<Name>XK-1</Name>

	<Declarations>
		<Declaration>core stdcore[2]</Declaration>
	</Declarations>
	
	<Packages>
		<Package id="P1" Type="XS1-L1A-TQ128">
			<Nodes>
				<Node Id="Master" Type="XS1-L1A" InPackageId="0" Oscillator="20MHz"
					SystemFrequency="500MHz">
					<Boot>
						<Source Location="SPI:bootFlash" />
						<Bootee NodeID="Slave" Core="0" />
					</Boot>
					<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" />
					</Core>
				</Node>
			</Nodes>
		</Package>
		<Package id="P2" Type="XS1-L1A-TQ128">
			<Nodes>
				<Node Id="Slave" Type="XS1-L1A" InPackageId="0" Oscillator="20MHz"
					SystemFrequency="500MHz">
					<Boot>
						<Source Location="XMOSLINK" />
					</Boot>
					<Core Number="0" Reference="stdcore[1]">

					</Core>
				</Node>
			</Nodes>
		</Package>
	</Packages>

	<Links>
		<Link Encoding="2wire" Delays="4,4">
			<LinkEndpoint NodeId="Master" Link="X0LD" />
			<LinkEndpoint NodeId="Slave" Link="X0LB" />
		</Link>
	</Links>

	<ExternalDevices>
		<Device NodeId="Master" Core="0" Class="SPIFlash" Name="bootFlash"
			Type="W25X10BV">
			<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="Master" Position="0" />
		<JTAGDevice NodeId="Slave" Position="1" />
	</JTAGChain>

</Network>

When I try and run the program (just calls a function on core 0 with some printfs), I get:

Code: Select all

xrun: Program received signal ET_ILLEGAL_RESOURCE, Resource not valid.
      0x000101d0 in wakeCore ()
Does anyone know what/if the problem is the XN file?


ale500
Respected Member
Posts: 259
Joined: Thu Sep 16, 2010 9:15 am

Post by ale500 »

Shouldn't be...

Code: Select all

 <Declarations>
      <Declaration>core stdcore[1]</Declaration>
   </Declarations>
1 instead of 2 ?
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am

Post by rp181 »

There are 2 cores, in nodes Master and Slave. When declaring an array, stdcore[2] has a length of 2, so 2 cores.
MaxFlashrom
Experienced Member
Posts: 82
Joined: Fri Nov 05, 2010 2:59 pm

Post by MaxFlashrom »

rp181 wrote:There are 2 cores, in nodes Master and Slave. When declaring an array, stdcore[2] has a length of 2, so 2 cores.
This does seem right, as documented in the 11.2 Tools user guide, section 8, which outlines a 2-core example like yours,

listing

Code: Select all

< Declarations >
< Declaration > core stdcore [2] </ Declaration >
</ Declarations >
and the comment
The board contains two XCores. The declaration “core
stdcore[2];” is exported to the header file <platform.h>.
Max.