Unexpected xflash behaviour with S25FL116K

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
CousinItt
Respected Member
Posts: 360
Joined: Wed May 31, 2017 6:55 pm

Unexpected xflash behaviour with S25FL116K

Post by CousinItt »

Hi,

the xCORE-200 explorerKIT has been fitted with various flash devices. I have one with a Spansion S25FL116K and I'm resurrecting an old project for it using xTimeComposer 14.4.1 (under windows 10 64-bit). This has meant some modifications to the XN file, which has also uncovered a problem. I'm not sure if this is a bug or if I'm doing something daft. Please advise. Full description follows.

The original device spec in the XN file is:

Code: Select all

    <Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="S25FL116K">
      <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="quad_spi_qe_location_status_reg_0"/>
      <Attribute Name="QE_BIT" Value="quad_spi_qe_bit_6"/>
    </Device>
The updated spec is:

Code: Select all

    <Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="SPANSION_S25FL116K">
      <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_0"/>
      <Attribute Name="QE_BIT" Value="flash_qe_bit_6"/>
    </Device>
This works fine: the program can run in RAM or from flash. However, during flashing this warning appears:
The use of libquadflash will be deprecated from XFLASH in xTIMEcomposer 15.0.0. # Please add the PageSize, SectorSize and NumPages attributes to your External Device definitions in your target XN file to enable the use of lib_flash.
When I try that, as follows, xflash claims to have programmed the device successfully, but it doesn't work.

Code: Select all

    <Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="SPANSION_S25FL116K" PageSize="256" SectorSize="4096" NumPages="8192">
...
Comparing the --verbose output of xflash, I can see the following differences:

Working:

Code: Select all

XFlash_DeviceInfo::GetDeviceInfo_Hardware
XFlash_DeviceInfo::GetDeviceInfo_Hardware_IssueCompileCommand : xcc -Xmapper --dontenablesodlinks -Xmapper --wnoXN -x xc "spiinfo-97cad04a" -x xn "target-xn-v0-f9125f54" -o "spiinfo-6a2ac69e" -lquadflash -D xnPORT_SQI_CS0=PORT_SQI_CS -D xnPORT_SQI_SCLK0=PORT_SQI_SCLK -D xnPORT_SQI_SIO0=PORT_SQI_SIO 
XFlash_Utils::BuildRunCommand : xrun --io spiinfo-6a2ac69e 
XFlash::BuildFlashBinaryFile
Faulty:

Code: Select all

XFlash_DeviceInfo::GetDeviceInfo_SQI
XFlash::BuildFlashBinaryFile
The working case later refers to -lquadflash and gives updates as it flashes site 0; the faulty case refers to -lquadspi and then skips any updates but still claims success.

Sorry this is a long post - I wanted to provide all the info.


RitchRock
XCore Addict
Posts: 186
Joined: Tue Jan 17, 2017 9:25 pm

Post by RitchRock »

Running into this problem and discovered the same thing. Have you since found a work around? Do you think the problem might be confined to the SPANSION_S25FL116K?
User avatar
CousinItt
Respected Member
Posts: 360
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

Hi RitchRock,

I'm pretty sure I fixed it, the problem is I can't remember exactly how. I've looked at a few project xn files and I think what I did is to use a mixture of new and old, like so:

Code: Select all

    <Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash0" Type="S25FL116K">
      <Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS1"/>
      <Attribute Name="PORT_SQI_SCLK"   Value="PORT_SQI_SCLK1"/>
      <Attribute Name="PORT_SQI_SIO"  Value="PORT_SQI_SIO1"/>
      <Attribute Name="QE_REGISTER" Value="flash_qe_location_status_reg_0"/>
      <Attribute Name="QE_BIT" Value="flash_qe_bit_6"/>
    </Device>   
I definitely avoided adding the stuff that it complains about - page size etc. I can live with the warnings.

I'm still using the 14.4.1 tools, so if you're on 15.x I would take this with a pinch of salt.

Please post what works for you.
RitchRock
XCore Addict
Posts: 186
Joined: Tue Jan 17, 2017 9:25 pm

Post by RitchRock »

Got it yes, my work around is not adding the PageSize="256" SectorSize="4096" NumPages="8192" as well. I'm on 14.4.1.
Post Reply