<?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のトピックWhat's the best method to write a image file to flash?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-s-the-best-method-to-write-a-image-file-to-flash/m-p/261701#M8125</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am trying to write a boot loader.&lt;/P&gt;&lt;P&gt;Every time, it checks the SD card if there is new image file, if yes, then write this image file to the flash.&lt;/P&gt;&lt;P&gt;Based on MQX4.0.2, what's the best way to write to flash? Is there any API to do this or I have to use the low level registers to write to flash?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Dec 2013 19:21:57 GMT</pubDate>
    <dc:creator>danielchai</dc:creator>
    <dc:date>2013-12-13T19:21:57Z</dc:date>
    <item>
      <title>What's the best method to write a image file to flash?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-s-the-best-method-to-write-a-image-file-to-flash/m-p/261701#M8125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am trying to write a boot loader.&lt;/P&gt;&lt;P&gt;Every time, it checks the SD card if there is new image file, if yes, then write this image file to the flash.&lt;/P&gt;&lt;P&gt;Based on MQX4.0.2, what's the best way to write to flash? Is there any API to do this or I have to use the low level registers to write to flash?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 19:21:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-s-the-best-method-to-write-a-image-file-to-flash/m-p/261701#M8125</guid>
      <dc:creator>danielchai</dc:creator>
      <dc:date>2013-12-13T19:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: What's the best method to write a image file to flash?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-s-the-best-method-to-write-a-image-file-to-flash/m-p/261702#M8126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MQX includes the flashX driver, which can erase and program the internal flash.&amp;nbsp; You can refer to the the flashX example in MQX, and the driver documentation installed at &amp;lt;MQX Installation path&amp;gt;\doc\mqx\MQXIOUG.pdf for help on how to use the driver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Kinetis device MK60FN1M0VLQ12 offers the program flash swap feature.&amp;nbsp; If you can take advantage of it and fit your application in the lower half of the flash, then your MQX application can re-program the upper half with the new image from the SD card.&amp;nbsp; Once the new image is programmed and verified, you can execute the flash swap command.&amp;nbsp; This will swap the upper flash with the lower flash in the address map, and when you reset you will now boot from the lower flash address range with the new image.&amp;nbsp; Appnote AN4533 has the details on using the swap feature&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4533.pdf" title="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4533.pdf"&gt;http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4533.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the program flash swap feature doesn't work for your needs, you can use a small bootloader at the lower end of flash to program the remaining flash with your application.&amp;nbsp; We have several example bootloaders for Kinetis below you can reference for this.&amp;nbsp; The closest to what you describe would be AN4368 bootloader.&amp;nbsp; This uses USB instead of an SD card, but it uses a file system to mount the USB flash drive.&amp;nbsp; Then the bootloader reads the new firmware image off the USB drive, and programs it to internal flash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="g" style="margin-bottom: 1.05pt;"&gt;&lt;SPAN style="font-size: 6.5pt; font-family: 'Arial','sans-serif'; color: #51626f;"&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4379.pdf"&gt;&lt;SPAN class="goog-trans-section"&gt;&lt;STRONG style="color: #008ecb;"&gt;AN4379, Freescale USB Mass Storage Device Bootloader - Application Notes&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid white 1.0pt;"&gt; &lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #afafaf;"&gt;Associated File: &lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4379SW.zip"&gt;&lt;SPAN style="color: #017bba;"&gt;AN4379SW&lt;/SPAN&gt;&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class="g" style="margin-bottom: 1.05pt;"&gt;&lt;SPAN style="font-size: 6.5pt; font-family: 'Arial','sans-serif'; color: #51626f;"&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4368.pdf"&gt;&lt;SPAN class="goog-trans-section"&gt;&lt;STRONG style="color: #008ecb;"&gt;AN4368, USB Mass Storage Device Host Bootloader - Application Notes&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid white 1.0pt;"&gt; &lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #afafaf;"&gt;Associated File: &lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4368SW.zip"&gt;&lt;SPAN style="color: #017bba;"&gt;AN4368SW&lt;/SPAN&gt;&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class="g" style="margin-bottom: 1.05pt; background: white;"&gt;&lt;SPAN style="font-size: 6.5pt; font-family: 'Arial','sans-serif'; color: #51626f;"&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4370.pdf"&gt;&lt;SPAN class="goog-trans-section"&gt;&lt;STRONG style="color: #008ecb;"&gt;AN4370, USB DFU Bootloader for MCUs - Application Notes&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="background-color: white;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid white 1.0pt;"&gt; &lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #afafaf;"&gt;Associated File: &lt;A href="http://www.freescale.com/webapp/sps/download/license.jsp?colCode=AN4370SW&amp;amp;amp;location=null"&gt;&lt;SPAN style="color: #017bba;"&gt;AN4370SW&lt;/SPAN&gt;&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class="g" style="margin-bottom: 1.05pt;"&gt;&lt;SPAN style="font-size: 6.5pt; font-family: 'Arial','sans-serif'; color: #51626f;"&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN2295.pdf"&gt;&lt;SPAN class="goog-trans-section"&gt;&lt;STRONG style="color: #008ecb;"&gt;Developer's Serial Bootloader&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border: solid white 1.0pt;"&gt; &lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: #afafaf;"&gt;Associated File: &lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN2295SW.zip"&gt;&lt;SPAN style="color: #017bba;"&gt;AN2295SW&lt;/SPAN&gt;&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 20:39:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-s-the-best-method-to-write-a-image-file-to-flash/m-p/261702#M8126</guid>
      <dc:creator>dereksnell</dc:creator>
      <dc:date>2013-12-13T20:39:38Z</dc:date>
    </item>
  </channel>
</rss>

