<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックRe: SPIFI read issues in quad mode and at higher clock speeds using lpcspifilib</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/521998#M4634</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avenuti on Mon Nov 23 11:18:03 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Okay, I think I'm finally making progress here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Went back to the function spifiInit, which initially had been causing me problems. If I called that function with the reset flag set 'true', the library would not initialize correctly, causing spifiGetHandleMemSize to return 0 and spifiInitDevice to return NULL. Calling spifiInit with the reset flag set 'false' would fix this, and according to the documentation "in most cases, a reset isn't needed".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Curiously, spifiInit does nothing whatsoever if that reset flag is set 'false', so I figured I'd go through it line-by-line and figure out what inside spifiInit was causing problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It turns out that line 344 (of spifi_dev_common.c) was the culprit, setting the feedback clock to 1, or SPIFI_CTRL_FBCLK(0). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not only did setting this to 0 allow me to run spifiInit with reset 'true', but doing so fixed my quad mode / high speed reading problem! I can now run at 180 MHz, with the SPIFI clock at 60 MHz, and both reads and writes are functioning properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It turns out that &lt;/SPAN&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;SPAN&gt; setting SPIFI_CTRL_RFCLK(1) (by skipping the spifiInit reset completely) was the actual cause of my read problem. Setting SPIFI_CTRL_RFCLK(0) (with the feedback clock also 0) reintroduced my problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please give me some insight as to what exactly is going on with RFCLK/FBCLK enabled or disabled? The documentation for these is clear but not meaningful.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 16:37:13 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T16:37:13Z</dc:date>
    <item>
      <title>SPIFI read issues in quad mode and at higher clock speeds using lpcspifilib</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/521996#M4632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avenuti on Fri Nov 20 14:39:07 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Setup:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso v7.9.2_493&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCOpen v2.12&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lpclibspifi v1.03_68&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NXP LPC1837FET256&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Spansion S25FL512S&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Workspace has my project, lpc_chip_18xx from LPCOpen, and spifilib_m3 from lpcspifilib.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have followed the instructions in the SPIFIlib manual under "LPCSPIFILIB library use model", with the exception of speeding up the SPIFI base clock after initialization (I'll get to that in a moment).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Issue 1: When SPIFI is set to quad spi mode, data reads from flash are not correct, even though programming in quad spi mode works correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have two areas of flash, 0x14280000 and 0x142C0000, that are being used in testing. In both blocks I erase with spifiEraseByAddr and program with spifiProgram. Erasing and programming the first block is done with quad mode off, and the second with quad mode on. After programming I put the device in memory-mapped mode with spifiDevSetMemMode and check the data in the Memory window. When quad mode is off, the data shows correctly in the Memory window for both blocks. When quad mode is on, the data appears incorrectly for both blocks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;&amp;nbsp;&amp;nbsp; spifi_result = spifiDevSetMemMode(gSpifiDeviceHandlePtr, true);

&amp;nbsp;&amp;nbsp; spifi_result = spifiDevSetOpts(gSpifiDeviceHandlePtr, SPIFI_OPT_USE_QUAD, true);
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; spifi_result = spifiDevSetOpts(gSpifiDeviceHandlePtr, SPIFI_OPT_USE_QUAD, false);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When the above is run (with quad mode initially off) the data appears correctly after the 1st line is stepped over, switches to be wrong after the 2nd line is stepped over, then switches back to correct after the 3rd line is stepped over.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Issue 2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The maximum read speed for this device, according to the lpcspifilib, is 80 MHz. Whenever the SPIFI base clock is set above ~50 MHz, functions in the SPIFI library that use any read commands (such as spifiDevSetOpts which reads the device status) do not execute correctly. They seem to get stuck reading the device status inside spifi_HW_WaitCMD, which loops indefinitely.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;According to the spec sheet for the Spansion chip, there is a maximum speed of 50 MHz for certain read functions, but it looks like the SPIFI library is always using fast-mode reads.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/521996#M4632</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: SPIFI read issues in quad mode and at higher clock speeds using lpcspifilib</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/521997#M4633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Mon Nov 23 08:08:31 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Avenuti,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have taken a look at the issue you have raised using a Spansion S25FL512s on a dev board fitted with a SPI flash test socket. Despite this being a sub optimal connection scheme, I was not able to duplicate any of the issues you raised.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my test case the board was running a 180MHz clock and the SPI device details report as below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Device family = S25FL512S&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Device size = 0x4000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Erase Sector size = 0x40000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Write page size = 0x200&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SPIFI final rate = 60000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am able to program and verify single, dual and quad speeds (1.16MB/s) and read at single, dual and quad (verifying the reads using a checksum) at speeds as below: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;Flash Read in 8948 ms
Flash Read in 4474 ms
Flash Read in 2237 ms (approx 30MB/s)&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When connected through LPCXpresso v7.9.2 [Build 493] [2015-09-14], I am able to see the memory window display the expected memory values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also I see no problem calling spifiDevSetOpts or spifiDevGetInfo at single, dual or quad settings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Given that I am able to achieve reliable quad operation on this part (via a test socket on a daughter card), exploring the hardware side of your board might be productive.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yours, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso-Support&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/521997#M4633</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: SPIFI read issues in quad mode and at higher clock speeds using lpcspifilib</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/521998#M4634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avenuti on Mon Nov 23 11:18:03 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Okay, I think I'm finally making progress here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Went back to the function spifiInit, which initially had been causing me problems. If I called that function with the reset flag set 'true', the library would not initialize correctly, causing spifiGetHandleMemSize to return 0 and spifiInitDevice to return NULL. Calling spifiInit with the reset flag set 'false' would fix this, and according to the documentation "in most cases, a reset isn't needed".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Curiously, spifiInit does nothing whatsoever if that reset flag is set 'false', so I figured I'd go through it line-by-line and figure out what inside spifiInit was causing problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It turns out that line 344 (of spifi_dev_common.c) was the culprit, setting the feedback clock to 1, or SPIFI_CTRL_FBCLK(0). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not only did setting this to 0 allow me to run spifiInit with reset 'true', but doing so fixed my quad mode / high speed reading problem! I can now run at 180 MHz, with the SPIFI clock at 60 MHz, and both reads and writes are functioning properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It turns out that &lt;/SPAN&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;SPAN&gt; setting SPIFI_CTRL_RFCLK(1) (by skipping the spifiInit reset completely) was the actual cause of my read problem. Setting SPIFI_CTRL_RFCLK(0) (with the feedback clock also 0) reintroduced my problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please give me some insight as to what exactly is going on with RFCLK/FBCLK enabled or disabled? The documentation for these is clear but not meaningful.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/521998#M4634</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: SPIFI read issues in quad mode and at higher clock speeds using lpcspifilib</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/521999#M4635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mc on Mon Dec 14 08:37:48 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi avenuti,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please check the SPIFI mode you were using? In MODE0&amp;nbsp; setting both RFCLK and FBCLK&amp;nbsp; should work. You may want to post you code here.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/521999#M4635</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: SPIFI read issues in quad mode and at higher clock speeds using lpcspifilib</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/522000#M4636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avenuti on Thu Jan 21 10:13:31 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;NXP,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After seeing your comment I went back and enabled FBCLK, attempting to recreate the error I had before. I was unable to do so, however. Regardless, I did not have SPI mode 3 enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have made my code more stable by replacing spifiInit entirely, configuring the SPIFI control register separately (including setting both RFCLK and FBCLK). Part of my problem may have been attempting to use SPIFI and/or the flash too quickly after reset. I have added in a small delay after reset to ensure the reset completes correctly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/522000#M4636</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: SPIFI read issues in quad mode and at higher clock speeds using lpcspifilib</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/522001#M4637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mc on Sun Jan 31 19:52:41 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you probe signals to confirm that you really need delay? Are you just resetting Microcontroller?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SPIFI-read-issues-in-quad-mode-and-at-higher-clock-speeds-using/m-p/522001#M4637</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:15Z</dc:date>
    </item>
  </channel>
</rss>

