Custom XMOS board not starting from NOR-Flash Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
PVS_Bram
Member
Posts: 8
Joined: Fri Jan 12, 2024 11:20 am

Custom XMOS board not starting from NOR-Flash

Post by PVS_Bram »

Hi everyone

I have developed a custom board using the XU316-1024-QF60B. The design is based/tested on the USB MULTICHANNEL AUDIO EVALUATION KIT which uses a XU316-1024-TQ128 and the firmware is based on the sw_usb_audio example. I used the eval kit to develop the firmware and determine which parts I would like to use.

The kit is configured to work as an Asynchronous USB stereo input/output, 48000 Hz, 32 bit with the I2S Codec as the master for the I2S line. This works on both boards. The problem I am encountering now is that the flash present on the circuit board can be flash using the XFLASH command from XTC. But when starting the device it is not starting using any firmware. I also verified that the boot procedure selection pins (X0D04, X0D05 and X0D06) are all in a low state at startup, thus selecting the QSPI flash I expect to use.

I know the flash is programmed correctly because the command:

Code: Select all

xflash --verbose --read-all --target-file {board file} -o temp.bin
retrieves the exact same data as the binary of the Firmware Image. The flash is written by the XMOS XAX-TAG4 over JTAG using the XFLASH command terminal. When restarting the XMOS I can see the following on the data lines using a logic analyser. Where the command 0xEB (Fast Read Quad I/O) is send on D0, but there is no response/data after this command.
Screenshot 2024-05-02 143825.png
Does anyone have any idea what is wrong? The following is the board configurtion file, the PCB schemtic file is attached to this message.

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>XS3-UnA-1024-QF60B</Name>

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

  <Packages>
    <Package id="0" Type="XS3-UnA-1024-QF60B">
      <Nodes>
        <Node Id="0" InPackageId="0" Type="XS3-L16A-1024" Oscillator="24MHz" SystemFrequency="600MHz" ReferenceFrequency="100MHz">
          <Boot>
            <Source Location="bootFlash"/>
          </Boot>
          <Tile Number="0" Reference="tile[0]">
            <Port Location="XS1_PORT_1B" Name="PORT_SQI_CS"/>
            <Port Location="XS1_PORT_1C" Name="PORT_SQI_SCLK"/>
            <Port Location="XS1_PORT_4B" Name="PORT_SQI_SIO"/>

            <!-- Various ctrl signals -->
            <Port Location="XS1_PORT_8D"  Name="PORT_CTRL"/>

            <!-- I2C -->
            <Port Location="XS1_PORT_1L"  Name="PORT_I2C_SCL"/>
            <Port Location="XS1_PORT_1M"  Name="PORT_I2C_SDA"/>

            <!-- Clocking --> 
            <Port Location="XS1_PORT_16B" Name="PORT_MCLK_COUNT"/>
            <Port Location="XS1_PORT_1D"  Name="PORT_MCLK_IN_USB"/>
            <Port Location="XS1_PORT_1A"  Name="PORT_PLL_REF"/>            
          </Tile>
          <Tile Number="1" Reference="tile[1]">            
            <!-- Audio Ports: I2S -->         
            <Port Location="XS1_PORT_1D"  Name="PORT_MCLK_IN"/>
            <Port Location="XS1_PORT_1B"  Name="PORT_I2S_LRCLK"/>
            <Port Location="XS1_PORT_1C"  Name="PORT_I2S_BCLK"/>
            <Port Location="XS1_PORT_1G"  Name="PORT_I2S_ADC0"/> <!-- 1G / 1I -->
            <Port Location="XS1_PORT_1F"  Name="PORT_I2S_DAC0"/> <!-- 1F / 1P -->
          </Tile>
        </Node>
      </Nodes>
    </Package>
  </Packages>
  <Nodes>
    <Node Id="2" Type="device:" RoutingId="0x8000">
      <Service Id="0" Proto="xscope_host_data(chanend c);">
        <Chanend Identifier="c" end="3"/>
      </Service>
    </Node>
  </Nodes>
  <Links>
    <Link Encoding="2wire" Delays="5clk" Flags="XSCOPE">
      <LinkEndpoint NodeId="0" Link="XL0"/>
      <LinkEndpoint NodeId="2" Chanend="1"/>
    </Link>
  </Links>
  <ExternalDevices>
      <Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" PageSize="256" SectorSize="4096" NumPages="8192">
      <Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS"/>
      <Attribute Name="PORT_SQI_SCLK"   Value="PORT_SQI_SCLK"/>
      <Attribute Name="PORT_SQI_SIO"  Value="PORT_SQI_SIO"/>
    </Device>
  </ExternalDevices>
  <JTAGChain>
    <JTAGDevice NodeId="0"/>
  </JTAGChain>

</Network>

Thanks for you advice.

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


View Solution
Joe
Active Member
Posts: 33
Joined: Sun Dec 13, 2009 1:12 am

Post by Joe »

The flash you are using is quite old, and a bit too small really. Old is a problem because it means it does not have an SFDP structure in it so the tools cannot query it as to its properties. Small is a problem as you may not be able to fit multiple application images on it (normally we have at least two: one for backup one for upgrading by DFU). We use 32Mbit on the mc audio board which is probably overkill but xcore.ai has 8Mbit of memory so with the worst case biggest program two images is 16Mbit so normally a good choice.

What may be happening here is the flash has not had its quad enable bit set. Without this set the flash will probably ignore the quad read command.

Normally the tools will read how to set the quad enable bit by querying the SFDP structure in the flash but in this case it doesn't have one so you will need to tell the tools the QE bit location manually. You can do this in the XN.

<Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS"/>
<Attribute Name="PORT_SQI_SCLK" Value="PORT_SQI_SCLK"/>
<Attribute Name="PORT_SQI_SIO" Value="PORT_SQI_SIO"/>
<Attribute Name="QE_REGISTER" Value="flash_qe_location_status_reg_1"/>
<Attribute Name="QE_BIT" Value="flash_qe_bit_1"/>

That should work for your flash.

Note
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" PageSize="256" SectorSize="4096" NumPages="8192">

This line I guess is copied from mc audio but for your 2MBit flash you should have NumPages="1024" as 1024x256 = 2Mbit.

Cheers,
Joe
Joe
Active Member
Posts: 33
Joined: Sun Dec 13, 2009 1:12 am

Post by Joe »

You can probably read "status register 2" and see if the QE bit is set with command:

xflash --spi-command 0x35 1 --target-file=<your_xn_filename>.xn

The --spi-command allows you to manually carry out commands which might help you work out what's going wrong.