<?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>topic Re: LPC4337 IAP Flash Programming in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549463#M13831</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by v0ynich on Thu Feb 26 06:52:41 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your response&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After changing the argument from 96000 to 12000 the "compare" command returns "compare_error" right after the first page. After dumping the flash, I can confirm the first page is indeed badly programmed. Some of the words are wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I supposed to perform the "init" command only one time or every time I do a "prepare to write" ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried both ways and noticed exactly the same behaviour.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After making sure the clock is 12 Mhz by using the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iap_regtmp&amp;nbsp; = *((uint32_t *)0x4005006C);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iap_regtmp &amp;amp;= 0xE0FFF7FE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iap_regtmp |= 0x01000000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *((uint32_t *)0x4005006C) = iap_regtmp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *((uint32_t *)0x40050044) |= 0x00000001;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and setting the write, erase, etc,, argument as 12000, the whole process behaves as described in the first post...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:34:50 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:34:50Z</dc:date>
    <item>
      <title>LPC4337 IAP Flash Programming</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549461#M13829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by v0ynich on Wed Feb 25 14:16:32 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the following problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By using my own bootloader, I'm able to program the LPC4337 flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, in a ~45kByte code, there is almost always one page (512Bytes) missing. This page is still with all bytes -&amp;gt; 0xFF.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm 100% sure I'm not writing this page full of 0xFF.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The location of this page (is always 512byte aligned) is random (even if a reset everything before each new flashing procedure).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The pages before and after the missing one are correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I do:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; I do init IAP&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; I do disable the interrupts using __asm volatile ("cpsid i");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; I do prepare for writing operations before erase&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; I do erase&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; I do a blank check operation&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; I do prepare for writing operations before write&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; I do write (copy ram to flash)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; I do compare after writing&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No error is reported.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use a low frequency clock (1000 Khz) as argument for the write operation, the compare fails as expected (there's no enough time for the flash&amp;nbsp; programming). At this momment I'm setting it as 96000 Khz (not sure if this is the correct value after reset).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When programming a ~4KBytes code, most of the time this missing page is not noticed. It seams it needs a bunch of pages writes to have at least one missing page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I think it's happening:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The copy ram to flash operation returns "COMMAND OK" but in fact some error occured.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any hints ??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:34:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549461#M13829</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4337 IAP Flash Programming</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549462#M13830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Wed Feb 25 22:49:03 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;After booting, the clock is running at 12Mhz - not 96. That is most likely the cause of your problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:34:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549462#M13830</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4337 IAP Flash Programming</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549463#M13831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by v0ynich on Thu Feb 26 06:52:41 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your response&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After changing the argument from 96000 to 12000 the "compare" command returns "compare_error" right after the first page. After dumping the flash, I can confirm the first page is indeed badly programmed. Some of the words are wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I supposed to perform the "init" command only one time or every time I do a "prepare to write" ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried both ways and noticed exactly the same behaviour.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After making sure the clock is 12 Mhz by using the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iap_regtmp&amp;nbsp; = *((uint32_t *)0x4005006C);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iap_regtmp &amp;amp;= 0xE0FFF7FE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iap_regtmp |= 0x01000000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *((uint32_t *)0x4005006C) = iap_regtmp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *((uint32_t *)0x40050044) |= 0x00000001;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and setting the write, erase, etc,, argument as 12000, the whole process behaves as described in the first post...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:34:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549463#M13831</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4337 IAP Flash Programming</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549464#M13832</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 Thu Feb 26 07:03:02 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a working example provided in LPCOpen for the LPC4300 family. I suggest that you read and understand that example.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:34:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549464#M13832</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4337 IAP Flash Programming</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549465#M13833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by v0ynich on Thu Feb 26 11:19:33 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've read the example and nothing rings me a bell about what am I doing wrong. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I found that the pages are correclty written, but the following writes to the subsequent pages may perturb the last ones..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I perform a "prepare to write", I'm only preparing the sector I'm working with at that moment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:34:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549465#M13833</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4337 IAP Flash Programming</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549466#M13834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Except the LPC4337 LPCOpen IAP example does not work. For me it hangs in the ROM code unless I run under debugger control. See my post on this subject. &lt;BR /&gt;As far as I can tell, the flash signature part of the example could never have been tested. It generates a hard fault as the register struct pointer definition is just wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 08:34:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4337-IAP-Flash-Programming/m-p/549466#M13834</guid>
      <dc:creator>definium</dc:creator>
      <dc:date>2016-08-29T08:34:45Z</dc:date>
    </item>
  </channel>
</rss>

