Program two or more XC-2 Boards over serial JTAG

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
User avatar
RemoRitzmann
Member++
Posts: 23
Joined: Wed Feb 03, 2010 10:23 pm

Program two or more XC-2 Boards over serial JTAG

Post by RemoRitzmann »

I'm working on a project that uses 4 XC-2 Kits (4 Nodes, 16 Cores) and need to program them all together. To start I have connected only two XC-2 Development Kits (2 Nodes, 8 Cores) with serialized JTAG (Daisy Chain) the following way:

Image

The XC-2_2board.xn file looks like this:

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[8]</Declaration>
  </Declarations>

  <Nodes>
    <Node Id="0" Type="XS1-G4B-FB512">
      <Core Number="0" Reference="stdcore[0]">
        <Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO_1"/>
        <Port Location="XS1_PORT_1B" Name="PORT_SPI_SS_1"/>
        <Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK_1"/>
        <Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI_1"/>
        <Port Location="XS1_PORT_1E" Name="PORT_BUTTON_LED_0_1"/>
        <Port Location="XS1_PORT_1F" Name="PORT_BUTTON_LED_1_1"/>
        <Port Location="XS1_PORT_1G" Name="PORT_UART_RX_1"/>
        <Port Location="XS1_PORT_1H" Name="PORT_UART_TX_1"/>
        <Port Location="XS1_PORT_1I" Name="PORT_LED_0_0_1"/>
        <Port Location="XS1_PORT_1J" Name="PORT_LED_1_0_1"/>
        <Port Location="XS1_PORT_4C" Name="PORT_BUTTON_A_1"/>
        <Port Location="XS1_PORT_4D" Name="PORT_BUTTON_B_1"/>
      </Core>
      
      <Core Number="1" Reference="stdcore[1]">
        <Port Location="XS1_PORT_1I" Name="PORT_x1ledA"/>
        <Port Location="XS1_PORT_1J" Name="PORT_x1ledB"/>
      </Core>
      
      <Core Number="2" Reference="stdcore[2]">
        <Port Location="XS1_PORT_1A" Name="PORT_SDI07"/>
        <Port Location="XS1_PORT_1K" Name="PORT_ETH_TXCLK_0"/>
        <Port Location="XS1_PORT_1L" Name="PORT_ETH_TXEN_0"/>
        <Port Location="XS1_PORT_1M" Name="PORT_ETH_RXCLK_0"/>
        <Port Location="XS1_PORT_1N" Name="PORT_ETH_RXDV_0"/>
        <Port Location="XS1_PORT_1O" Name="PORT_ETH_RXER_0"/>
        <Port Location="XS1_PORT_1P" Name="PORT_ETH_MDC_0"/>
        <Port Location="XS1_PORT_4E" Name="PORT_ETH_RXD_0"/>
        <Port Location="XS1_PORT_4F" Name="PORT_ETH_TXD_0"/>
        <Port Location="XS1_PORT_8D" Name="PORT_ETH_RST_N_MDIO_0"/>
        <Port Location="XS1_PORT_1I" Name="PORT_x2ledA"/>
        <Port Location="XS1_PORT_1J" Name="PORT_x2ledB"/>
      </Core>
      
      <Core Number="3" Reference="stdcore[3]">
        <Port Location="XS1_PORT_1I" Name="PORT_x3ledA"/>
        <Port Location="XS1_PORT_1J" Name="PORT_x3ledB"/>
      </Core>
    </Node>
    
 <Node Id="1" Type="XS1-G4B-FB512">
      <Core Number="0" Reference="stdcore[4]">
        <Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO_1"/>
        <Port Location="XS1_PORT_1B" Name="PORT_SPI_SS_1"/>
        <Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK_1"/>
        <Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI_1"/>
        <Port Location="XS1_PORT_1E" Name="PORT_BUTTON_LED_0_1"/>
        <Port Location="XS1_PORT_1F" Name="PORT_BUTTON_LED_1_1"/>
        <Port Location="XS1_PORT_1G" Name="PORT_UART_RX_1"/>
        <Port Location="XS1_PORT_1H" Name="PORT_UART_TX_1"/>
        <Port Location="XS1_PORT_1I" Name="PORT_LED_0_0_1"/>
        <Port Location="XS1_PORT_1J" Name="PORT_LED_1_0_1"/>
        <Port Location="XS1_PORT_4C" Name="PORT_BUTTON_A_1"/>
        <Port Location="XS1_PORT_4D" Name="PORT_BUTTON_B_1"/>
      </Core>
	  
      <Core Number="1" Reference="stdcore[5]">
        <Port Location="XS1_PORT_1I" Name="PORT_LED_0_1_1"/>
        <Port Location="XS1_PORT_1J" Name="PORT_LED_1_1_1"/>
      </Core>
	  
      <Core Number="2" Reference="stdcore[6]">
        <Port Location="XS1_PORT_1I" Name="PORT_LED_0_2_1"/>
        <Port Location="XS1_PORT_1J" Name="PORT_LED_1_2_1"/>
        <Port Location="XS1_PORT_1K" Name="PORT_ETH_TXCLK_1"/>
        <Port Location="XS1_PORT_1L" Name="PORT_ETH_TXEN_1"/>
        <Port Location="XS1_PORT_1M" Name="PORT_ETH_RXCLK_1"/>
        <Port Location="XS1_PORT_1N" Name="PORT_ETH_RXDV_1"/>
        <Port Location="XS1_PORT_1O" Name="PORT_ETH_RXER_1"/>
        <Port Location="XS1_PORT_1P" Name="PORT_ETH_MDC_1"/>
        <Port Location="XS1_PORT_4E" Name="PORT_ETH_RXD_1"/>
        <Port Location="XS1_PORT_4F" Name="PORT_ETH_TXD_1"/>
        <Port Location="XS1_PORT_8D" Name="PORT_ETH_RST_N_MDIO_1"/>
      </Core>
	  
      <Core Number="3" Reference="stdcore[7]">
        <Port Location="XS1_PORT_1I" Name="PORT_LED_0_3_1"/>
        <Port Location="XS1_PORT_1J" Name="PORT_LED_1_3_1"/>
      </Core>
    </Node>
  </Nodes> 

  <Devices>
    <Device NodeId="0" Core="0" Class="SPIFlash" Name="bootFlash_0" Type="AT25DF041A">
      <Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO_0"/>
      <Attribute Name="PORT_SPI_SS"   Value="PORT_SPI_SS_0"/>
      <Attribute Name="PORT_SPI_CLK"  Value="PORT_SPI_CLK_0"/>
      <Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI_0"/>
    </Device>
    <Device NodeId="1" Core="0" Class="SPIFlash" Name="bootFlash_1" Type="AT25DF041A">
      <Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO_1"/>
      <Attribute Name="PORT_SPI_SS"   Value="PORT_SPI_SS_1"/>
      <Attribute Name="PORT_SPI_CLK"  Value="PORT_SPI_CLK_1"/>
      <Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI_1"/>
    </Device>
  </Devices>

  <Links>
    <Link Encoding="2wire" Delays="4,4">
      <LinkEndpoint NodeId="0" Link="X0LC"/>
      <LinkEndpoint NodeId="1" Link="X0LD"/>
    </Link>
  </Links>

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

</Network>
But when I built the program I got the following error message:

xcc -o "SPI.xe" ./src/main.o ./src/Modules/Core00.o ./src/Modules/Core02.o ./src/Modules/Core03.o ./src/Modules/FM02.o ./src/Modules/M01.o ./src/Modules/M02.o ./src/Modules/M04.o ../XC-2_2board.xn
./src/main.o: Error: Specified network is not a recognised topology.

Do you have an idea, what's wrong with that?
Last edited by RemoRitzmann on Thu Apr 15, 2010 2:20 pm, edited 6 times in total.
User avatar
boeserbaer
Active Member
Posts: 51
Joined: Fri Jan 29, 2010 4:36 pm

Post by boeserbaer »

I don't have an answer for your problem, but I do think some improved example files and documentation on the XN files would be good. The strength of these processors for my application is treating the various networked cores as a single multi threaded application. I see you are using XC-2s. How well does ethernet work?

Regards, Mike
User avatar
RemoRitzmann
Member++
Posts: 23
Joined: Wed Feb 03, 2010 10:23 pm

Post by RemoRitzmann »

I got a good describing slice out of Tools User Guide (Draft of 10.2) Chapter 3:
toolsuser_en_ch3.pdf
We are in testphase currently, I can report more about the Ethernet later on.
You do not have the required permissions to view the files attached to this post.
Last edited by RemoRitzmann on Thu Apr 15, 2010 12:04 pm, edited 2 times in total.
User avatar
boeserbaer
Active Member
Posts: 51
Joined: Fri Jan 29, 2010 4:36 pm

Post by boeserbaer »

No, I don't speak german, my girlfriend is from Berlin though, so I can get translation.
User avatar
boeserbaer
Active Member
Posts: 51
Joined: Fri Jan 29, 2010 4:36 pm

Post by boeserbaer »

I don't see any links defined, could that be the problem?
User avatar
RemoRitzmann
Member++
Posts: 23
Joined: Wed Feb 03, 2010 10:23 pm

Post by RemoRitzmann »

Hi all!
I've added the Links Part, but without the expected results. So I've tried some other things but it's still not working. When I Flash I get the error Message:
  • Assertion failed: thisNode == bootSite.m_node, file FlashProgrammer.cpp, line 520
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
When I run the Application the following error message apears:
  • xrun: Problem in connection to device
The XTAG Device is recognised as usual but still not works with two XC-2 Boards.
Do I need the XLink connection between the two boards that for? I have not connected Xlink so far and I'm using XTAG, not XTAG2 - can this be a problem?

Have you ever programed 2 or more Devices through Daisy Chain JTAG?
Or do you have any other Ideas?
User avatar
RemoRitzmann
Member++
Posts: 23
Joined: Wed Feb 03, 2010 10:23 pm

Post by RemoRitzmann »

We finaly found the solution:

The JTAG Dasy Chain needs to be connected directly to the first device the following way:
2JTAG_XC-2.png
With this we don't get an error message, but still have problem that it's not working.

Regards
Remo
You do not have the required permissions to view the files attached to this post.
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Post by bearcat »

Post Removed
Last edited by bearcat on Fri Apr 16, 2010 5:27 pm, edited 1 time in total.
User avatar
XMatt
XCore Addict
Posts: 147
Joined: Tue Feb 23, 2010 6:55 pm

Post by XMatt »

bearcat wrote:You most likely need to connect the debug pins together with a pull up resistor. This allows for multi core debugging. When a core reaches a breakpoint it toggles the debug pin low to indicate this. Not sure if it's needed for programming, or if the XTAG2 expects it?

You may have an issue with the XTAG2 with multiple processors needing buffers. Not sure if this effects the G4 like it does the L1.
The diagram they have is correct. I don't know where you are getting your information from regarding how they other signals are used but they are not accurate and are only going to confuse when posting them as fact.
User avatar
Thomas
Experienced Member
Posts: 66
Joined: Fri Feb 05, 2010 12:34 pm

Post by Thomas »

I tested the posted .xn file with 9.9.2 tools and it works.
I attached a xc files running a thread on all 8 cores. So using the above .xn file as 2_G4.xn one can run:
xcc 2_G4.xc 2_G4.xn -o "2_G4.xe"
xsim 2_G4.xe

should print:
I'm a nice thread running on stdcore[1]
I'm a nice thread running on stdcore[2]
I'm a nice thread running on stdcore[3]
I'm a nice thread running on stdcore[4]
I'm a nice thread running on stdcore[5]
I'm a nice thread running on stdcore[6]
I'm a nice thread running on stdcore[7]
I'm a nice thread running on stdcore[0]

Also, the .xn file indicates the system has one flash chip per xcore.
One flash per system is enough because you can boot the other XCores via xlinks.

Booting other cores via xlinks can be done with the .xn file also. This is documented for the upcoming 10.4 tool release but already works in 9.9.2.
Here is more information: http://www.xmos.com/published/xtools_en_ch3
(FYI: "Chapter 3 - Describing Hardware Platforms" on http://www.xmos.com/support/documentation)

I hope this helps.

Cheers, Thomas

2_G4.xc:
#include <platform.h> //Note: This is auto-generated from the .xn file
#include <stdio.h>

void print_stuff(int stdcore) {
printf("I'm a nice thread running on stdcore[%d]\n",stdcore);
}

int main() {
// Create 8 threads using par replicator.
par (int i=0; i<8; i++)
on stdcore : print_stuff(i);
return 0;
}