xflash: Warning: F03148 --quad-spi-clock not given, using default 15.62MHz

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
slava
Member
Posts: 8
Joined: Mon Sep 29, 2014 9:36 am

xflash: Warning: F03148 --quad-spi-clock not given, using default 15.62MHz

Postby slava » Fri Jun 02, 2017 10:48 am

Hello,

with the update to xTIMEcomposer 14.3.0 we are experiencing now strange warnings that don't look healthy.

When using the XLF216-512-FB236-I20.xn the following warnings appeared when trying to flash the device:
xflash: Warning: F03148 --quad-spi-clock not given, using default 15.62MHz
xflash: Warning: F03149 QE_REGISTER and/or QE_BIT locations not found in XN file for this flash device. Using default quad_spi_qe_location_status_reg_0 and quad_spi_qe_bit_6.
I looked up to some kits platform files and added two lines to <ExternalDevices> definition that somehow became needed (why?):

Code: Select all

      <Attribute Name="QE_REGISTER" Value="quad_spi_qe_location_status_reg_0"/>
      <Attribute Name="QE_BIT" Value="quad_spi_qe_bit_6"/>
As a result it seems like 50% of the problem is solved:
Warning: F03098 Factory image and boot loader cannot be write-protected on flash device on node 0
xflash: Warning: F03148 --quad-spi-clock not given, using default 15.62MHz
What else is missing and how can I get rid of/fix the quad-spi-clock not given warning?
User avatar
mon2
XCore Legend
Posts: 1518
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Fri Jun 02, 2017 2:26 pm

]Looks to be a new parm for xflash. Try

--quad-spi-clock 2


but do try different values which assuming to be in Mhz. Lower clock speeds are usually better for the SPI flashing for stability but do experiment and post your results.
slava
Member
Posts: 8
Joined: Mon Sep 29, 2014 9:36 am

Postby slava » Fri Jun 02, 2017 3:03 pm

adding --quad-spi-clock 2 to xflash command results in zero result. This parameter is ignored:
xflash app.xe --quad-spi-clock 2 --loader loader/loader.o -o app.bin --boot-partition-size 0x90000
Warning: F03098 Factory image and boot loader cannot be write-protected on flash device on node 0
xflash: Warning: F03148 --quad-spi-clock not given, using default 15.62MHz
colin
Experienced Member
Posts: 74
Joined: Mon Dec 16, 2013 12:14 pm

Postby colin » Mon Jun 05, 2017 9:33 am

Hi Slava,

XFLASH in tools 14.3 is using a new lib_quad_spi library that is soon to be published on our XMOS github repository. This library has been characterised on the XCORE-200 and as such allows us to achieve much faster boot times when used within the second stage boot loader than with the previous quad spi implementation. As such, there have been some changes to the XN configuration and command line requirements which have not quite made it into the documentation yet.

The change in the XN file is the addition of the QE_REGISTER and QE_BIT attributes for the flash part. The intent here is to make it more flexible for customers to use alternative QSPI parts than those listed as supported by libquadflash. As you have spotted you can modify the XN ExternalDevices as follows:

Code: Select all

  <ExternalDevices>
    <Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="IS25LQ032B">
      <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>
  </ExternalDevices>
  
The other change is to the command line. XFLASH no longer uses option --spi-div when using a quad flash part in tools 14.3, it now expects option --quad-spi-clock. When not given XFLASH will use a default target speed of 15.62MHz and issue the warning that you are seeing (which is purely for your information). if you use XLFLASH option --help you will see the following help for option --quad-spi-clock:

Code: Select all

  --quad-spi-clock arg       Set the Quad SPI clock for the second stage
                             loader;
                             arg = <5MHz|6.25MHz|8.33MHz|12.5MHz|13.88MHz|15.62
                             MHz|17.85MHz|20.83MHz|25MHz|31.25MHz|41.67MHz|50MH
                             z>
As you can see there are a number of clock speeds for you to use. These target speeds are dependant on a number of factors, including the XCORE running at ~500MHz, the length of trace between the XCORE and flash part and other environmental factors. These factors will be documented in the lib_quad_flash library once it is published in github. XFLASH documentation will also be brought up to date to reflect the changes that have been made.

Hope this clears up some of the warnings you have observed.
Best Wishes
Colin
slava
Member
Posts: 8
Joined: Mon Sep 29, 2014 9:36 am

Postby slava » Mon Jun 05, 2017 9:52 am

Thank you Colin for the detailed explanation! It looks like suggested previously argument 2 is not in the list. I will try asap with the new information to see if it clears the warning. But because you are mentioning the upcoming release of lib_quad_flash, do you consider the case in the library that reference clock frequency can be configured to other values rather than 100MHz? We have this issue with the current implementation because we are using 250MHz reference clock frequency and stuck with our SW development till this issue is resolved.

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

Postby colin » Mon Jun 05, 2017 10:30 am

Hi Slava.

The new lib_quad_flash lib assumes the xcore clock is running at 500MHz and the reference clock is running at 100MHz. The following table as lifted from the lib_quad_spi documentation that is in progress and demonstrates which clocks are used to achieve the desired target speed:
target clock in-div out-div clock edge pad delay
5MHz reference 5 5 falling 0
6.25MHz reference 4 4 falling 0
8.33MHz reference 3 3 falling 0
12.5MHz xcore 10 10 falling 0
13.88MHz xcore 9 9 falling 0
15.62MHz xcore 8 8 falling 0
17.85MHz xcore 7 7 falling 0
20.83MHz xcore 6 6 falling 0
25MHz xcore 5 5 falling 0
31.25MHz xcore 4 5 falling 0
41.66MHz xcore 3 5 plusone 0
50MHz reference 0 1 plusone 1
As you are running your reference clock at 250MHz I would recommend you stick to speeds that clock off the xcore clock which are in the 12.5MHZ-41.66MHz range.

The library documentation will also provide guidelines on using clocks that differ from 500MHz/100MHz. Though this is not written just yet.

Best Wishes
Colin.
simonf
Member++
Posts: 16
Joined: Wed Nov 23, 2016 10:18 pm

Postby simonf » Thu Jun 08, 2017 10:05 am

Hi Colin,

Let me quickly jump in here.
Our new question is how we make the quadspi lib work with a reference clock of 250 MHz? Maybe you could provide us with a little code snippet / example application to illustrate the approach?
(I don't fully understand your proposal for different reference clocks since they are all lower frequency than the 100MHz default and we are aiming for a higher reference clock frequency.)

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

Postby colin » Thu Jun 08, 2017 11:25 am

Hi Simon,

This is a different issue from the questions Slava posted regarding the XFLASH warnings he was seeing. If I'm understanding you correctly, you are attempting to use libquadflash (with functions such as fl_connectToDevice etc) here which is not using lib_quad_spi at this time. It is still using the spi-spec file approach as seen with the original libflash for spi and documented in the tools user guide. As you are using a reference clock of 250MHz you will need a custom spi spec file that has the appropriate divider in it and pass your custom spi-spec file to fl_connectToDevice. Presumably you would have taken the same approach with libflash in the past to obtain the correct dividers there for your spi devices and 250MHz reference clock? Let me know if this is not the case and I'll be happy to give you some further guidance.

Best Wishes,
Colin.
simonf
Member++
Posts: 16
Joined: Wed Nov 23, 2016 10:18 pm

Postby simonf » Thu Jun 08, 2017 5:42 pm

Hi Colin,

I believe for the XS1 architecture we didn't configure anything since we only increased the reference clock speed on the tile where our motor control software is running (not the tile to which flash is connected).
As far as I understood from Slava this cannot be done anymore since the reference clock now is used for all tiles of the die, correct?

We would need guidance how to configure the flash correctly for a reference clock of 250MHz.


Thanks a lot,
Simon
colin
Experienced Member
Posts: 74
Joined: Mon Dec 16, 2013 12:14 pm

Postby colin » Fri Jun 09, 2017 9:39 am

Hi Simon,

This is the spi spec file for the ISSI_IS25LQ016B...if this is not the QSPI device you are using then let me know which device you are using and I can point you at the right one. Alternatively you can look in the xTIMEcomposer install directory and then target/include/QuadSpecMacros.h for others that are natively supported.

Code: Select all

    ISSI_IS25LQ016B,        /* IS25LQ016B */
    256,                    /* page size */
    8192,                   /* num pages */
    3,                      /* address size */                                  
    3,                      /* log2 clock divider */                            
    0x9F,                   /* QSPI_RDID */
    0,                      /* id dummy bytes */
    3,                      /* id size in bytes */
    0x9D4015,               /* device id */
    0x20,                   /* QSPI_SE */
    4096,                   /* Sector erase is always 4KB */
    0x06,                   /* QSPI_WREN */
    0x04,                   /* QSPI_WRDI */
    PROT_TYPE_NONE,         /* no protection */
    {{0,0},{0x00,0x00}},    /* QSPI_SP, QSPI_SU */
    0x02,                   /* QSPI_PP */
    0xEB,                   /* QSPI_READ_FAST */
    1,                      /* 1 read dummy byte */
    SECTOR_LAYOUT_REGULAR,  /* mad sectors */
    {4096,{0,{0}}},        /* regular sector sizes */
    0x05,                   /* QSPI_RDSR */
    0x01,                   /* QSPI_WRSR */
    0x01,                   /* QSPI_WIP_BIT_MASK */
In this spec file you are interested in the log2 clock divider which is currently set to 3. This will give a QSPI clk of 16.6MHz from a 100MHz reference clock (100 / (2*3)). If you change this to a divide of 8 or 9 then you will get a QSPI clk of 15.6MHz (250 / (2*8)) or 13.88MHz (250 / (2*9)). Save your modified spec file in your own header file.

To use your custom spec file with libquadflash then you can follow the document Add support for a new flash devicehttps://www.xmos.com/support/tools/docu ... nent=14627 and specifically the section Add support to xTIMEComposer. Note you are using the libquadflash not libflash as shown in the document so be careful with the include and library calls.

You should also use your custom spi-spec file with XFLASH, passing it in with the --spi-spec option.

Let me know if you need any further assistance,
Best Wishes
Colin.

Who is online

Users browsing this forum: No registered users and 2 guests