<?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>Kinetis MicrocontrollersのトピックCannot erase or write internal flash memory.</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Cannot-erase-or-write-internal-flash-memory/m-p/465590#M28049</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As attachment can not be done in reply, I have opened this new thread in continuation to earlier thread - &lt;STRONG&gt;"&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica','sans-serif'; color: #666666; font-weight: normal;"&gt;&lt;STRONG&gt;Problem with KL17 flash erase an writing".&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached demo code - &lt;STRONG&gt;"flash_erase_write_code"&lt;/STRONG&gt;, please find the attachment. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I said in earlier question's comment, flash erase and write routines return "RESULT_OK" means FTFA_FCCOB commands are getting sent successfully, but expected data is not being written on flash addresses staring from 0x2000.&lt;/P&gt;&lt;P&gt;I have tested the demo code on &lt;STRONG style="color: #1f497d; font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;“&lt;/STRONG&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;FRDM-KL43Z” board. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to do any configuration or initialization related flash in addition with flash routines?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please review the demo code and let us know if we are missing anything.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinayak Wadkar&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337383"&gt;flash_erase_write_code.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 May 2016 05:23:29 GMT</pubDate>
    <dc:creator>vinayakwadkar</dc:creator>
    <dc:date>2016-05-12T05:23:29Z</dc:date>
    <item>
      <title>Cannot erase or write internal flash memory.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Cannot-erase-or-write-internal-flash-memory/m-p/465590#M28049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As attachment can not be done in reply, I have opened this new thread in continuation to earlier thread - &lt;STRONG&gt;"&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica','sans-serif'; color: #666666; font-weight: normal;"&gt;&lt;STRONG&gt;Problem with KL17 flash erase an writing".&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached demo code - &lt;STRONG&gt;"flash_erase_write_code"&lt;/STRONG&gt;, please find the attachment. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I said in earlier question's comment, flash erase and write routines return "RESULT_OK" means FTFA_FCCOB commands are getting sent successfully, but expected data is not being written on flash addresses staring from 0x2000.&lt;/P&gt;&lt;P&gt;I have tested the demo code on &lt;STRONG style="color: #1f497d; font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;“&lt;/STRONG&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;FRDM-KL43Z” board. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to do any configuration or initialization related flash in addition with flash routines?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please review the demo code and let us know if we are missing anything.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinayak Wadkar&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337383"&gt;flash_erase_write_code.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 05:23:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Cannot-erase-or-write-internal-flash-memory/m-p/465590#M28049</guid>
      <dc:creator>vinayakwadkar</dc:creator>
      <dc:date>2016-05-12T05:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot erase or write internal flash memory.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Cannot-erase-or-write-internal-flash-memory/m-p/465591#M28050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinayak&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to execute the CommandLaunch() routine from SRAM and not from Flash. Generally you also need to ensure that interrupts are disabled when it is executing.&lt;/P&gt;&lt;P&gt;Beware that&lt;/P&gt;&lt;P&gt;status = FlashErase(flash_addr_ptr,sizeof(myData));&lt;/P&gt;&lt;P&gt;doesn't match your prototype&lt;/P&gt;&lt;P&gt;U32 FlashErase(U32 block_start);&lt;/P&gt;&lt;P&gt;so your compiler should be giving your warnings or errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the Flash driver from the uTasker project which supports all KE,KV,KW,KL,K parts flash and includes program-once, flash swap, parameter storage, as well as KE EEPROM as reference of how to do it generically without needing drivers for each type.&lt;/P&gt;&lt;P&gt;If used within the uTasker project with Kinetis simulator it will also accurately emulate Flash operation and inform of any incorrect usage or other violations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As comparison, you can also load the following image to your board and experiment with flash writing, sector erasure etc.&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.freescale.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-KL43Z.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KL43Z.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Commands (on the OpenSDA UART at 115k) are explained in &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.freescale.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FKE_EEPROM.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/KE_EEPROM.html&lt;/A&gt;&lt;SPAN&gt; whereby the same interface can be used for EEPROM or Flash.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 10:58:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Cannot-erase-or-write-internal-flash-memory/m-p/465591#M28050</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-05-12T10:58:56Z</dc:date>
    </item>
  </channel>
</rss>

