Two XK-1A connected and boot from the same flash

Technical questions regarding the XTC tools and programming with XMOS.
scrusson
Member
Posts: 9
Joined: Wed Mar 21, 2012 10:33 am

Two XK-1A connected and boot from the same flash

Post by scrusson »

Hi all,

I know that this kind of subject has already been posted (http://www.xcore.com/forum/viewtopic.php?f=26&t=720 https://www.xcore.com/forum/viewtopic.p ... boot+xlink) but the answers given weren't so clear.

I connected two XK-1A boards and I'm running a simple program that lights leds on both cards. This code works fine, from debugger or xrun (from IDE), and xflash'ed successfully,but doesn't work when both cores boot from one flash memory (see "one_flash.zip"), on the other side it works when each core boots on its own flash (but that's not what I want to do :-) (see "two_flashs.zip").

Is it a problem with my "one_flash.xn" file or is it due to an hardware issue and in this case are there any solutions to solve it?

One small other question (but not so critic). In my .xn file, to create the link between the boards, I write :
<LinkEndpoint NodeId="0" Link="1"/>
<LinkEndpoint NodeId="1" Link="0"/>
and it would seem more meaningful for me to write :
<LinkEndpoint NodeId="0" Link="X0LD"/>
<LinkEndpoint NodeId="1" Link="X0LC"/>
but this doesn't work.

Do you have any explanations, in the datasheets I didn't find any explanations for "Link=1 and Link=0".

Thanks

Stephane
You do not have the required permissions to view the files attached to this post.


User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

Hello scrusson,

The XK-1A supports two boot modes: 'Wait for JTAG' and SPI boot.
The XK-1A will boot to 'Wait for JTAG' when a XTAG2 is connected and the XTAG2 resets the device.
Otherwise (as standalone) it will boot from SPI flash.

To be able to boot multiple chips from a single flash it is required that the master node boots from SPI flash (this is not a problem), and all slave nodes to boot from XMOS Link B. This introduces two problems: The XK-1A cannot be set to boot from XMOS Link and the second problem is that the two exposed links are Link C and Link D. So it is not possible to use a standalone multi-chip setup. However you can write multi-chip applications and load all cores through JTAG (see https://www.xmos.com/published/xk-1-two ... ion=latest ).

Code: Select all

<LinkEndpoint NodeId="0" Link="X0LD"/>
<LinkEndpoint NodeId="1" Link="X0LC"/>
This should work. Make sure that you use the latest revision of the tools. I believe that some older revisions do not support it.
User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

You can have the slave node run the single instruction program

Code: Select all

bu 0xffffc072
which jumps back to the boot ROM, booting from link B.

Untested etc. :-)
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

I have to add that Link B is exposed on IO extension header B.
Its less trivial than exposed on the XSYS connectors but at least its exposed.
User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

Ugh, that's right, I forgot.

So you'll have to manually enable the proper link (C and/or D) before
jumping back to ROM. Let's say (enable all links):

Code: Select all

getr r0,2
ldw r4,dp[0x0b]
ldc r3,0x80
bu 0xffffc096
which is getting so big that I might well have made some mistake in there,
so your mileage might vary, etc.

Also, of course, as I should have mentioned before: I have no idea if this
works with the tools and the tools-generated boot code. I don't see why
it wouldn't, but...
scrusson
Member
Posts: 9
Joined: Wed Mar 21, 2012 10:33 am

Post by scrusson »

Hello guys

Thanks for your advices, that helped!

There were two problems that made impossible to make a slave XK-1A boot on a master memory flash via an Xlink : only XlinkB had to be used and I had to force the boot mode on XlinkB that meant put the pins Mode3/Mode2=10.

I solved these two problems. I first built an adaptator that makes all XSYS connectors pins connected between master and slave except the four pins concerning the Xlink that I connected from XSYS master to slave GPIOB (i.e XlinkB). Then, directly on the board, I added a switch that can put the Mode2 pin to 0 or 1, that allows me to change the boot mode (Spi, Jtag or XlinkB).

So this should work, but it doesn't... And I'm lost :-) Did I forget something? All advices will be very appreciated.

Thanks

PS : you can take a look on my .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 id="P1" Type="XS1-L1A-TQ128">
      <Nodes>
        <Node Id="Master" Type="XS1-L1A" InPackageId="0">
          <Boot>
            <Source Location="SPI:bootFlash_0"/>
            <Bootee NodeId="Slave" Core="0"/>
          </Boot>
          <Core Number="0" Reference="stdcore[0]">
            <Port Location="XS1_PORT_1I" Name="PORT_UART_RX_0"/>
            <Port Location="XS1_PORT_1J" Name="PORT_UART_TX_0"/>
            <Port Location="XS1_PORT_1K" Name="PORT_BUTTON_0_0"/>
            <Port Location="XS1_PORT_1L" Name="PORT_BUTTON_1_0"/>
            <Port Location="XS1_PORT_1M" Name="PORT_SPI_MISO_0"/>
            <Port Location="XS1_PORT_1N" Name="PORT_SPI_SS_0"/>
            <Port Location="XS1_PORT_1O" Name="PORT_SPI_CLK_0"/>
            <Port Location="XS1_PORT_1P" Name="PORT_SPI_MOSI_0"/>
            <Port Location="XS1_PORT_4F" Name="PORT_LED_0"/>
          </Core>
        </Node>
      </Nodes>
    </Package>
    <Package id="P2" Type="XS1-L1A-TQ128">
      <Nodes>  
        <Node Id="Slave" Type="XS1-L1A" InPackageId="0">
          <Boot>
            <Source Location="XMOSLINK"/>
          </Boot>
          <Core Number="0" Reference="stdcore[1]">
            <Port Location="XS1_PORT_1I" Name="PORT_UART_RX_1"/>
            <Port Location="XS1_PORT_1J" Name="PORT_UART_TX_1"/>
            <Port Location="XS1_PORT_1K" Name="PORT_BUTTON_0_1"/>
            <Port Location="XS1_PORT_1L" Name="PORT_BUTTON_1_1"/>
            <Port Location="XS1_PORT_1M" Name="PORT_SPI_MISO_1"/>
            <Port Location="XS1_PORT_1N" Name="PORT_SPI_SS_1"/>
            <Port Location="XS1_PORT_1O" Name="PORT_SPI_CLK_1"/>
            <Port Location="XS1_PORT_1P" Name="PORT_SPI_MOSI_1"/>
            <Port Location="XS1_PORT_4F" Name="PORT_LED_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_0" Type="AT25FS010">
      <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>
  </ExternalDevices>

  <JTAGChain>
     <JTAGDevice NodeId="Master"/>
     <JTAGDevice NodeId="Slave"/>
  </JTAGChain>

</Network>