<?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 I'm porting a bootloader to my MK10DN512VLL10. Trouble verifying written bytes? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-m-porting-a-bootloader-to-my-MK10DN512VLL10-Trouble-verifying/m-p/306097#M13004</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm porting a bootloader to my MK10DN512VLL10. I have used it in an MKL15Z128VFT4 before wihout problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I execute a "Program Longword" and then read back the four written bytes I get a miss match. But if i single step my code it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I disable the verification I can successfully download my application to flash with my bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect the cache memory is the problem and it reads back the four bytes from cache memory and not from flash?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I make sure i really read back the four bytes from flash and not cache?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this &lt;A href="https://community.nxp.com/message/341372"&gt;Flash cache invalidate.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i tested to disable the cache before and after write to flash and it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PFB0CR_restore = FMC-&amp;gt;PFB0CR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FMC-&amp;gt;PFB0CR = PFB0CR_restore | FMC_PFB0CR_CINV_WAY(15); &amp;lt;--- I selected all as I don't know what else to select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; execute_flash_command();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FMC-&amp;gt;PFB0CR = PFB0CR_restore;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Mar 2014 13:22:39 GMT</pubDate>
    <dc:creator>markosiponen</dc:creator>
    <dc:date>2014-03-28T13:22:39Z</dc:date>
    <item>
      <title>I'm porting a bootloader to my MK10DN512VLL10. Trouble verifying written bytes?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-m-porting-a-bootloader-to-my-MK10DN512VLL10-Trouble-verifying/m-p/306097#M13004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm porting a bootloader to my MK10DN512VLL10. I have used it in an MKL15Z128VFT4 before wihout problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I execute a "Program Longword" and then read back the four written bytes I get a miss match. But if i single step my code it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I disable the verification I can successfully download my application to flash with my bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect the cache memory is the problem and it reads back the four bytes from cache memory and not from flash?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I make sure i really read back the four bytes from flash and not cache?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this &lt;A href="https://community.nxp.com/message/341372"&gt;Flash cache invalidate.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i tested to disable the cache before and after write to flash and it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PFB0CR_restore = FMC-&amp;gt;PFB0CR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FMC-&amp;gt;PFB0CR = PFB0CR_restore | FMC_PFB0CR_CINV_WAY(15); &amp;lt;--- I selected all as I don't know what else to select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; execute_flash_command();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FMC-&amp;gt;PFB0CR = PFB0CR_restore;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 13:22:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-m-porting-a-bootloader-to-my-MK10DN512VLL10-Trouble-verifying/m-p/306097#M13004</guid>
      <dc:creator>markosiponen</dc:creator>
      <dc:date>2014-03-28T13:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: I'm porting a bootloader to my MK10DN512VLL10. Trouble verifying written bytes?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-m-porting-a-bootloader-to-my-MK10DN512VLL10-Trouble-verifying/m-p/306098#M13005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see you found a solution/workaround in that other thread. I just wanted to confirm, is your issue resolved?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2014 23:52:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-m-porting-a-bootloader-to-my-MK10DN512VLL10-Trouble-verifying/m-p/306098#M13005</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2014-04-01T23:52:43Z</dc:date>
    </item>
  </channel>
</rss>

