SPI flash problem on new XMOS Board

If you have a simple question and just want an answer.
Post Reply
Schorsch
Member
Posts: 12
Joined: Sun Feb 16, 2014 8:36 am

SPI flash problem on new XMOS Board

Post by Schorsch »

Hi XMOS-Community,

I need help with a new board that I build. I took the XS1-A16A-128-FB217 silicon and I created the layout like the datasheet on page 31 with XSCOPE.

PIN 6 -> XLB1 out ( 33 Ohm )
PIN 10 -> XLB0 out ( 33 Ohm )
PIN 14 -> XLB0 in
PIN 18 -> XLB1 in

I use the XMOS xTAG3 to program the IC and it works fine. But, if I want to flash the SPI I get following error message: ( xTIMEcomposer 14.1.2 )

xrun: First stage multi-node boot failed, please check XN file and Xmos link connectivity

Now my question. Can anyone help me with 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>Device</Type>
  <Name>XS1-A16A-128-FB217-C10 Device</Name>

  <Declarations>
    <Declaration>tileref tile[2]</Declaration>
    <Declaration>tileref analog_tile</Declaration>
  </Declarations>

  <Packages>
    <Package ID="0" Type="XS1-AnA-128-FB217">
      <Nodes>
        <Node Id="0" InPackageId="0" Type="XS1-L8A-64" OscillatorSrc="2" SystemFrequency="500MHz">
          <Boot>
            <Source Location="SPI:bootFlash" />
            <Bootee NodeId="1" Tile="0"/>
          </Boot>
          <Tile Number="0" Reference="tile[0]">
            <!-- SPI Ports -->
            <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 Location="XS1_PORT_8D" Name="PORT_SPI_DISABLE"/>      -->
          </Tile>
        </Node>
        <Node Id="1" InPackageId="1" Type="XS1-L8A-64" OscillatorSrc="2" SystemFrequency="500MHz">
        <Boot>
          <Source Location="LINK"/>
        </Boot>
          <Tile Number="0" Reference="tile[1]"/>
        </Node>
        <Node Id="2" InPackageId="2" Type="periph:XS1-SU" Reference="analog_tile" Oscillator="24MHz">
          <Service Proto="xs1_a_adc_service(chanend c)">
            <Chanend Identifier="c" end="2" remote="31"/>
          </Service>
        </Node>
      </Nodes>
    </Package>
  </Packages>

  <Nodes>
    <Node Id="3" Type="device:" routingId="0x8000">
      <Service Id="0" Proto="xscope_host_data(chanend c);">
        <Chanend Identifier="c" end="3"/>
      </Service>
    </Node>
  </Nodes>

  <Links>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="XLG"/>
      <LinkEndpoint NodeId="1" Link="XLF"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="XLH"/>
      <LinkEndpoint NodeId="1" Link="XLE"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="XLE"/>
      <LinkEndpoint NodeId="1" Link="XLH"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="XLF"/>
      <LinkEndpoint NodeId="1" Link="XLG"/>
    </Link>
    <Link Encoding="5wire">
      <LinkEndpoint NodeId="0" Link="XLC" Delays="52clk,52clk"/>
      <LinkEndpoint NodeId="2" Link="XLC" Delays="1clk,1clk"/>
    </Link>
    <Link Encoding="2wire" Delays="5clk" Flags="XSCOPE">
      <LinkEndpoint NodeId="0" Link="X0LB" />
      <LinkEndpoint NodeId="3" Chanend="1" />
    </Link>
  </Links>

  <ExternalDevices>
    <Device NodeId="0" Tile="0" Name="bootFlash" Class="SPIFlash" Type="S25FL204K">
      <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="2"/>
    <JTAGDevice NodeId="0"/>
    <JTAGDevice NodeId="1"/>
  </JTAGChain>

</Network>

I orientated me on the XN-File from the SLICEKIT-A16.xn.

Many thanks in advance for any help!

Best regards

Schorsch


colin
Experienced Member
Posts: 74
Joined: Mon Dec 16, 2013 12:14 pm

Post by colin »

Hi Schorsch,

The XN file seems sound, I can use it here to flash my Slickit-A16 without issue. The only difference between this XN and the SLICEKIT-A16.xn file that is shipped with the tools is that your xscope is using link X0LB instead of X0LA. This would not cause a first stage multi-node boot error.

Can you please run your xflash again, this time with --verbose and post the output here. Would be interesting to see where in the flash process that actually fails. Also can you do an xrun --dumpstate your.xe and post the results of that here too.

Many Thanks
Colin
Schorsch
Member
Posts: 12
Joined: Sun Feb 16, 2014 8:36 am

Post by Schorsch »

Hi colin,

thanks for your help!!! I try your commands early in the morning and reply you the outputs.


Best regards

Schorsch
Schorsch
Member
Posts: 12
Joined: Sun Feb 16, 2014 8:36 am

Post by Schorsch »

Hi colin,

here the output ( --verbose ):

Code: Select all

XFlash_Application found _start :10000 on Node 1
XFlash_Application found _DoSyscall :102e6 on Node 1
XFlash_Application found _DoException :101be on Node 1
XFlash_Application found _start :10000 on Node 2
XFlash_Application found _DoSyscall :101c4 on Node 2
XFlash_Application found _DoException :10140 on Node 2
XFlash_Application : Attempting to Compress Binary Data
libcompressor marker 1=17
libcompressor marker 2=19
libcompressor marker 3=26
libcompressor best marker length 3 2 2 
libcompressor best marker length 3 2 3 
libcompressor best marker length 3 2 4 
libcompressor best marker length 4 2 4 
libcompressor DoCompression_Compress took : 14ms
libcompressor compile command=xcc -nostartfiles -Xmapper --bootstyle=forsim -x assembler-with-cpp "decompressor-0e486cbe" -x xn "target-xn-v0-66cacc29" -o decompressor-a05c88f8
libcompressor validating decompressor decompressor-a05c88f8
libcompressor launching simulator decompressor-a05c88f8 --disable-syscalls --max-cycles 100000000
libcompressor simulator starting @0x10000
libcompressor simulator terminate @0x1ff78
libcompressor decompressor validated
XFlash_Application on Node : 1 compressed from : 1532 bytes to : 1482 bytes (3.264%)
libcompressor marker 1=11
libcompressor marker 2=12
libcompressor marker 3=17
libcompressor best marker length 3 2 2 
libcompressor DoCompression_Compress took : 13ms
libcompressor compile command=xcc -nostartfiles -Xmapper --bootstyle=forsim -x assembler-with-cpp "decompressor-b33b3ebb" -x xn "target-xn-v0-66cacc29" -o decompressor-66b57374
libcompressor validating decompressor decompressor-66b57374
libcompressor launching simulator decompressor-66b57374 --disable-syscalls --max-cycles 100000000
libcompressor simulator starting @0x10000
libcompressor simulator terminate @0x1ff7a
libcompressor decompressor validated
XFlash::DoXFlash
XFlash::DoImageProgramming
XFlash::GetDeviceInfo
XFlash_DeviceInfo::GetDeviceInfo_Hardware
XFlash_DeviceInfo::GetDeviceInfo_Hardware_IssueCompileCommand : xcc -Xmapper --dontenablesodlinks -Xmapper --wnoXN -x xc "spiinfo-0e68f670" -x xn "target-xn-v0-66cacc29" -o "spiinfo-acf4390a" -lflash -D xnPORT_SPI_MISO0=PORT_SPI_MISO -D xnPORT_SPI_SS0=PORT_SPI_SS -D xnPORT_SPI_CLK0=PORT_SPI_CLK -D xnPORT_SPI_MOSI0=PORT_SPI_MOSI 
XFlash_Utils::BuildRunCommand : xrun --io --adapter-id NIQ2C2mg spiinfo-acf4390a 
Warning: F03098 Factory image and boot loader cannot be write-protected on flash device on node 0
XFlash::BuildFlashBinaryFile
XFlash_Builder_S2L::BuildStage2Loaders Factory
Stage2_Loader::Compile : xcc -Wno-bidirectional-buffered-port -Xmapper --dontenablesodlinks -Xmapper --nochaninit -Xmapper --noinitialtidy -Xmapper --image-base -Xmapper 0x10080 -Xmapper --image-size -Xmapper 0xff80 -Xmapper --wno110 -Xmapper --wno226 -Xmapper --wnoXN -std=c99 -O2 -x xn "target-xn-v0-66cacc29" -x xc s2l-n0-a245ebe9 -lstage2loader -lswitchsetup -lspiaccess -o s2l-n0-87363d5d
Stage2Loader found _DoSyscall : 0x10346 on Node 1
Stage2Loader found _DoException : 0x10248 on Node 1
Stage2_Loader : Attempting to Compress Binary Data
libcompressor marker 1=42
libcompressor marker 2=45
libcompressor marker 3=46
libcompressor best marker length 3 2 2 
libcompressor best marker length 3 2 3 
libcompressor best marker length 3 2 4 
libcompressor best marker length 3 2 5 
libcompressor best marker length 4 2 4 
libcompressor best marker length 4 2 5 
libcompressor DoCompression_Compress took : 20ms
libcompressor compile command=xcc -nostartfiles -Xmapper --bootstyle=forsim -x assembler-with-cpp "decompressor-1f48e6eb" -x xn "target-xn-v0-66cacc29" -o decompressor-5110affd
libcompressor validating decompressor decompressor-5110affd
libcompressor launching simulator decompressor-5110affd --disable-syscalls --max-cycles 100000000
libcompressor simulator starting @0x10000
libcompressor simulator terminate @0x1fef8
libcompressor decompressor validated
Stage2_Loader on Node : 1 compressed from : 2488 bytes to : 2090 bytes (16%)
Stage2_SwitchSetup::Compile : xcc -c -march=xs1b -x assembler-with-cpp swstup-n0v0-38df4a8d -o swstup-n0v0-a66cd3cf
Stage2_SwitchSetup::Compile : xcc -nostartfiles -Wno-bidirectional-buffered-port -Xmapper --first -Xmapper swstup-n0v0-a66cd3cf -Xmapper --dontenablesodlinks -Xmapper --nochaninit -Xmapper --noinitialtidy -Xmapper --wno110 -Xmapper --wno226 -Xmapper --wnoXN -std=c99 -O2 -x xn "target-xn-v0-66cacc29" -x xc swstup-n0v0-4e6af0df -lswitchsetup -o swstup-n0v0-ffeb0de8
XFlash_Builder_Image::BuildImages Factory
XFlash_Builder_Image::BuildImageTable
  master node = 0
    node = 0
    node = 1
XFlash_Builder_Image::BuildImageTable num cores for image table = 2
XFlash_Builder_Image::CalculateBufferSize Starting calculation _total_image_size=0
XFlash_Builder_Image::CalculateBufferSize Add Image Header _total_image_size=34
XFlash_Builder_Image::CalculateBufferSize Add Switch Setup header _total_image_size=3c
XFlash_Builder_Image::CalculateBufferSize Add Per Core header _total_image_size=54
XFlash_Builder_Image::CalculateBufferSize_SwitchSetup _total_image_size=a7c
XFlash_Builder_Image::CalculateBufferSize_Application application size = 5d0 _total_image_size = 104c
XFlash_Builder_Image::CalculateBufferSize_Application application size = 2a0 _total_image_size = 12ec
XFlash_Builder_Image::BuildImageTable allocated image buffer size = 12ec
XFlash_Builder_Image::WriteBuffer_ImageHeader
XFlash_Builder_Image::WriteBuffer_SwitchSetup current switch setup table offset : 34
XFlash_Builder_Image::WriteBuffer_SwitchSetup current application data offset : 54
XFlash_Builder_Image::WriteBuffer_SwitchSetup size : a24
XFlash_Builder_Image::WriteBuffer_SwitchSetup aligned_size : a28
XFlash_Builder_Image::WriteBuffer_SwitchSetup init_vec_shift : 0
XFlash_Builder_Image::WriteBuffer_Application
XFlash_Builder_Image::WriteBuffer_Application for node : 0
XFlash_Builder_Image::WriteBuffer_Application for core : 0
XFlash_Builder_Image::WriteBuffer_Application current core table offset : 3c
XFlash_Builder_Image::WriteBuffer_Application current application data offset : a7c
XFlash_Builder_Image::WriteBuffer_Application size : 5ca
XFlash_Builder_Image::WriteBuffer_Application aligned_size : 5d0
XFlash_Builder_Image::WriteBuffer_Application init_vec_shift : 0
XFlash_Builder_Image::WriteBuffer_Application chan end : 80040002
XFlash_Builder_Image::WriteBuffer_Application for node : 1
XFlash_Builder_Image::WriteBuffer_Application for core : 0
XFlash_Builder_Image::WriteBuffer_Application current core table offset : 48
XFlash_Builder_Image::WriteBuffer_Application current application data offset : 104c
XFlash_Builder_Image::WriteBuffer_Application size : 29c
XFlash_Builder_Image::WriteBuffer_Application aligned_size : 2a0
XFlash_Builder_Image::WriteBuffer_Application init_vec_shift : 0
XFlash_Builder_Image::WriteBuffer_Application chan end : 80050002
XFlash_Builder_Image::WriteBuffer_CRC
XFlash_Builder_Binary::BuildBinary
XFlash_Builder_Binary::CalculateBufferSize_Factory
XFlash_Builder_Binary::CalculateBufferSize_Factory : Adding s2l size word (4)4
XFlash_Builder_Binary::CalculateBufferSize_Factory : Adding s2l app (8ac) 8b0
XFlash_Builder_Binary::CalculateBufferSize_Factory : Adding s2l crc (4)8b4
XFlash_Builder_Binary::CalculateBufferSize_Factory : Adding factory app (12ec) 1ba0
XFlash_Builder_Binary::CalculateBufferSize_Factory : Adding sector padding (460) 2000
XFlash_Builder_Binary::CalculateBufferSize_Factory : First User Sector offset = 2000
XFlash_Builder_Binary::GetSearchLimitPadding : current size (2000) 0
XFlash_Builder_Binary::CalculateBufferSize_Data
XFlash_Builder_Binary::BuildBinary : Allocating buffer - 2000
XFlash_Builder_Binary::GetSearchLimitPadding : current size (2000) 0
XFlash_Builder_Binary::WriteBufferToBinary : flash_bin_node0
XFlash_Programmer_Program::DoProgram
XFlash_Programmer_Program::GenerateSource
XFlash_Programmer_Program::IssueCompileCommand :xcc -w -Xmapper --dontenablesodlinks -O2 -lflash -x xc "fp-350d4a40" -x xn "target-xn-v0-66cacc29" -D VERBOSE=1 -D MONITOR=1 -D ERASE_ALL_FIRST=1 -o "fp-f8065661"
XFlash_Utils::BuildRunCommand : xrun --io --adapter-id NIQ2C2mg fp-f8065661 
xrun: First stage multi-node boot failed, please check XN file and Xmos link connectivity

Error: F03013 Failed to complete flash programming.
and here ( --dumpstate ):

Code: Select all

***** Active Cores *****
  2  tile[1] core[0]  0xffffc070 in ?? ()
* 1  tile[0] core[0]  0xffffc070 in ?? ()

Thread 2 (tile[1] core[0]):

***** Call Stack *****
#0  0xffffc070 in ?? ()

***** Disassembly *****
0xffffc070:	waiteu (0r)      *
0xffffc072:	ldc (ru6)       r1, 0x1
0xffffc074:	bu (u6)         0x2
0xffffc076:	ldc (ru6)       r1, 0x0
0xffffc078:	bu (u6)         0x0

***** Registers *****
r0             0x2	2
r1             0x0	0
r2             0x0	0
r3             0x0	0
r4             0x0	0
r5             0x0	0
r6             0x0	0
r7             0x0	0
r8             0x0	0
r9             0x0	0
r10            0x5	5
r11            0x40b	1035
cp             0x0	0
dp             0xffffc344	-15548
sp             0x0	0
lr             0x0	0
pc             0xffffc070	-16272
sr             0x41	65
spc            0x0	0
ssr            0x0	0
et             0x0	0
ed             0x0	0
sed            0x0	0
kep            0xffffc300	-15616
ksp            0x0	0

Thread 1 (tile[0] core[0]):

***** Call Stack *****
#0  0xffffc070 in ?? ()

***** Disassembly *****
0xffffc070:	waiteu (0r)      *
0xffffc072:	ldc (ru6)       r1, 0x1
0xffffc074:	bu (u6)         0x2
0xffffc076:	ldc (ru6)       r1, 0x0
0xffffc078:	bu (u6)         0x0

***** Registers *****
r0             0x12	18
r1             0x8	8
r2             0x0	0
r3             0x0	0
r4             0x0	0
r5             0x0	0
r6             0x0	0
r7             0x0	0
r8             0x0	0
r9             0x0	0
r10            0x5	5
r11            0x40b	1035
cp             0x0	0
dp             0xffffc344	-15548
sp             0x0	0
lr             0x0	0
pc             0xffffc070	-16272
sr             0x41	65
spc            0x0	0
ssr            0x0	0
et             0x0	0
ed             0x0	0
sed            0x0	0
kep            0xffffc300	-15616
ksp            0x0	0
Many thanks!

Best regards

Schorsch
Schorsch
Member
Posts: 12
Joined: Sun Feb 16, 2014 8:36 am

Post by Schorsch »

Hi colin,
the problem is solved! What have I done:

I had a NC7WZ04 for pulling down the RST_N Pin from the xTAG3 Header to the XMOS RST_N PIN. The RST_N PIN on the XMOS was held high by a 10k resistor close to it.
Now I changed the NC7WZ04 to a FET ( IRLML0030 ) ... and now it works! I think, that the RST_N PIN need a very low impedance to ground.

Many thanks for your help and best greetings!

Schorsch
colin
Experienced Member
Posts: 74
Joined: Mon Dec 16, 2013 12:14 pm

Post by colin »

Hi Schorsch,

Thanks for the update, glad you got it sorted.

Best Wishes,
Colin.
Post Reply