<?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: LPC11xx runtime flash access</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-runtime-flash-access/m-p/532616#M10443</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by corwinb on Tue Feb 19 10:56:51 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Got it.&amp;nbsp; I think.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although I have not succeeded in my task I think I understand the basic concept.&amp;nbsp; u32IAP_CopyRAMToFlash fails with return code of 9 (IAP_STA_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION).&amp;nbsp; The args for the following func are as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;srcAddr = 0x10000050&amp;nbsp; (address of my ram structure)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;destAddr = 0x7000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;destSector = 7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;byte_count = 256&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;target chip LPC1114&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Prepare and EraseSectors functions succeeded and I use the same sector for the Copy func so I don't understand what the problem is.&amp;nbsp; Unless sector 7 is off limits for some reason.&amp;nbsp; I did not find any hint of this in the docs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did start with the Bootloader example from AN10995 which uses the uart.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not using a uart.&amp;nbsp; The u32IAP* funcs (unedited from example) I am using do not appear to be tailored to uart?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//---------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tU32 write_long_term_vars_to_flash( tU32 srcAddr, tU32 destAddr, tU32 destSector, tU32 byte_count )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if( u32IAP_PrepareSectors( destSector, destSector ) == IAP_STA_CMD_SUCCESS )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if( u32IAP_EraseSectors( destSector, destSector ) == IAP_STA_CMD_SUCCESS )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if( u32IAP_CopyRAMToFlash( destAddr, srcAddr, byte_count ) == IAP_STA_CMD_SUCCESS )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:33:40 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:33:40Z</dc:date>
    <item>
      <title>LPC11xx runtime flash access</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-runtime-flash-access/m-p/532615#M10442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by corwinb on Mon Feb 18 14:41:51 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to write and read some long term vars in flash during run-time.&amp;nbsp; I found AN10995 and associated code and can sort of see what is going on.&amp;nbsp; What I am looking for is an explanation of the commands and the proper sequence.&amp;nbsp; I am having trouble equating Chapter 26 (Flash programming firmware) in UM10398 to AN10995.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I missing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:33:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-runtime-flash-access/m-p/532615#M10442</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11xx runtime flash access</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-runtime-flash-access/m-p/532616#M10443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by corwinb on Tue Feb 19 10:56:51 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Got it.&amp;nbsp; I think.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although I have not succeeded in my task I think I understand the basic concept.&amp;nbsp; u32IAP_CopyRAMToFlash fails with return code of 9 (IAP_STA_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION).&amp;nbsp; The args for the following func are as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;srcAddr = 0x10000050&amp;nbsp; (address of my ram structure)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;destAddr = 0x7000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;destSector = 7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;byte_count = 256&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;target chip LPC1114&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Prepare and EraseSectors functions succeeded and I use the same sector for the Copy func so I don't understand what the problem is.&amp;nbsp; Unless sector 7 is off limits for some reason.&amp;nbsp; I did not find any hint of this in the docs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did start with the Bootloader example from AN10995 which uses the uart.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not using a uart.&amp;nbsp; The u32IAP* funcs (unedited from example) I am using do not appear to be tailored to uart?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//---------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tU32 write_long_term_vars_to_flash( tU32 srcAddr, tU32 destAddr, tU32 destSector, tU32 byte_count )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if( u32IAP_PrepareSectors( destSector, destSector ) == IAP_STA_CMD_SUCCESS )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if( u32IAP_EraseSectors( destSector, destSector ) == IAP_STA_CMD_SUCCESS )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if( u32IAP_CopyRAMToFlash( destAddr, srcAddr, byte_count ) == IAP_STA_CMD_SUCCESS )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:33:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-runtime-flash-access/m-p/532616#M10443</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11xx runtime flash access</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-runtime-flash-access/m-p/532617#M10444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by corwinb on Wed Feb 20 10:24:25 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I discovered 11008 - Flash based non-volatile storage.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This appnote/code illustrates exactly what I want to do.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My first problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was prepareSectors() before EraseSectors(), but not before CopyRAMToFlash().&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not bootloading so bootloader example is not perfect template for me.&amp;nbsp; The bootloader example does not disable interrupts before IAP_EXECUTE_CMD() and then enable interupts after.&amp;nbsp; This did not prevent my simple test from working, but, in certain applications it could cause problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All works fine now. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:33:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11xx-runtime-flash-access/m-p/532617#M10444</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:33:40Z</dc:date>
    </item>
  </channel>
</rss>

