<?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: How to use internal Flash memory for data storage with so long execution times?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520956#M3902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wmues on Mon Apr 27 07:43:32 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC177x/8x has 2K-4K of EEPROM memory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:46:48 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:46:48Z</dc:date>
    <item>
      <title>How to use internal Flash memory for data storage with so long execution times?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520952#M3898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by giusloq on Mon Apr 27 02:41:20 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to save a small set of small variables, rarely changed during the execution time. Internal flash memory and IAP commands seem to me a good choice. I already read and studied &lt;/SPAN&gt;&lt;A href="http://http://www.lpcware.com/content/nxpfile/an11008-flash-based-non-volatile-storage-software"&gt;AN11008&lt;/A&gt;&lt;SPAN&gt; documentantion and code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have only one but big problem. When a variable is updated, a swap of sectors could happen. And this operation takes a long time (&lt;/SPAN&gt;&lt;STRONG&gt;more than 100ms!&lt;/STRONG&gt;&lt;SPAN&gt;). During this time, interrupts are disabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My gadget is a RS485 slave on a bus network. I use UART rx interrupts to receive bytes from the bus. If I disable interrupts for an interval of 100ms, I surely lost some bytes and I could end with problems on communication.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems the IAP routines can't be splitted in small parts and transformed using a state-machine pattern. So I can't see any way to solve this big problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions? Is an external non-volatile memory the only solution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:46:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520952#M3898</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use internal Flash memory for data storage with so long execution times?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520953#M3899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Mon Apr 27 03:52:17 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: giusloq&lt;/STRONG&gt;&lt;BR /&gt;Any suggestions?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What about General purpose storage (GPREG0-4)&amp;nbsp; :quest: &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:46:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520953#M3899</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to use internal Flash memory for data storage with so long execution times?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520954#M3900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by giusloq on Mon Apr 27 04:47:40 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;What about General purpose storage (GPREG0-4)&amp;nbsp; :quest: &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think those registers are non-volatile only when a battery is used to supply RTC peripheral. In my case, I don't use RTC so I don't have a battery.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another problem with GPREG, they are only 20 bytes. Maybe they are sufficient at the moment, but what happens if I will need additional bytes in the future?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:46:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520954#M3900</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to use internal Flash memory for data storage with so long execution times?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520955#M3901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Mon Apr 27 05:08:37 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Then it's time to consider something external like FRAM&amp;nbsp; :O &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:46:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520955#M3901</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use internal Flash memory for data storage with so long execution times?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520956#M3902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wmues on Mon Apr 27 07:43:32 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC177x/8x has 2K-4K of EEPROM memory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:46:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520956#M3902</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use internal Flash memory for data storage with so long execution times?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520957#M3903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MikeSimmonds on Mon Apr 27 10:17:25 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You can continue to have interrupts while erasing/programming flash IF all of the following are true.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) You have relocated the vector table to ram (or at least out of flash) Hint: Lookup the VTOR register, AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) All possible interrupt routines (and any routines they may reference) are also in ram (or at least out of flash).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Search the forums for moving code to ram.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps, Mike&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:46:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520957#M3903</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use internal Flash memory for data storage with so long execution times?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520958#M3904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by giusloq on Tue Apr 28 06:03:10 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;You can continue to have interrupts while erasing/programming flash IF all of the following are true.&lt;BR /&gt;&lt;BR /&gt;1) You have relocated the vector table to ram (or at least out of flash) Hint: Lookup the VTOR register, AND&lt;BR /&gt;2) All possible interrupt routines (and any routines they may reference) are also in ram (or at least out of flash).&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this true even if I write flash sectors dedicated to user/config data and not code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:46:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520958#M3904</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use internal Flash memory for data storage with so long execution times?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520959#M3905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MikeSimmonds on Tue Apr 28 10:45:04 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Fundamentally, no other access is possible to the flash ram during erase or program operations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This rules out executing ANY code in flash because the MPU would have to prefetch (i.e. read) from flash&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This rules out interrupts because the vector table is at address zero in flash by default.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code doing the erasing and programming is in the boot rom (not in flash).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you relocate the vector table and the (entire) interrupt code (note 1) you will not be accessing flash&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while it is busy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So NO CODE in flash may run regardless of what sector(s) are being erased/programmed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note 1: If you want to get fancy, you can disable&amp;nbsp; all interrupts except those that are needed to be active&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while the flash array is busy. Those that do remain active must execute &lt;/SPAN&gt;&lt;I&gt;entirely&lt;/I&gt;&lt;SPAN&gt; in ram.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The vector table always has to be copied to ram and relocated via VTOR.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bottom line -- while erasing etc, you cannot access &lt;/SPAN&gt;&lt;I&gt;anywhere&lt;/I&gt;&lt;SPAN&gt; in flash!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&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 17:46:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-to-use-internal-Flash-memory-for-data-storage-with-so-long/m-p/520959#M3905</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:46:50Z</dc:date>
    </item>
  </channel>
</rss>

