<?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: Freedom k64F Switching Between two applications bootloader code  in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Freedom-k64F-Switching-Between-two-applications-bootloader-code/m-p/829521#M50127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aashir&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have any problems with the links - the first is to another forum entry - if the links don't work for you just do a search in the forum for "SWAP" and you will find these and possibly others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check the uTasker open source project it includes an API that is simple to use.&lt;BR /&gt;&lt;STRONG&gt;fnSwapMemory(1);&lt;/STRONG&gt; returns the present state of the SWAP blocks&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_STATE_UNINITIALISED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_STATE_SWAPPED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_STATE_USING_1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_STATE_USING_0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_COMMAND_FAILURE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_ERASE_FAILURE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once new code has been copied it is swapped using&lt;BR /&gt;&lt;STRONG&gt;fnSwapMemory(0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;At &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-K64F.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-K64F.html&lt;/A&gt;&lt;SPAN&gt; you will find binaries that allow you to test this on a FRDM-K64F, as well as loading new code via USB, SD card or Web Browser.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are doing it for a school project you will find all that you need to experiment and learn in the open source version. Should you have a professional requirement it is all available as a supported turn-key solution that will avoid any project risks or delays.&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;P&gt;&lt;/P&gt;&lt;P&gt;P.S. No CPU register level coding is usually needed to do such things, although there is a routine called&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;extern void start_application(unsigned long app_link_location);&lt;/STRONG&gt;&lt;BR /&gt;that is available in case one wants to jump to another application without going through a reset at the the usual reset vector location (which indeed sets PC and SP accordingly).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Oct 2018 10:41:58 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2018-10-09T10:41:58Z</dc:date>
    <item>
      <title>Freedom k64F Switching Between two applications bootloader code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Freedom-k64F-Switching-Between-two-applications-bootloader-code/m-p/829518#M50124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello , i am new to K64F board, what i want to do is to have a bootloader code in my app which can write new app code in memory location and decides which app to execute based on the value in eprom. Basically i want to update my app code so i want to partition my ram into two parts running code will be on first part new coming code will be saved on another part and i want to shift program counter location based on the value stored in eprom either 1 or 0.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Oct 2018 07:56:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Freedom-k64F-Switching-Between-two-applications-bootloader-code/m-p/829518#M50124</guid>
      <dc:creator>aas_jav</dc:creator>
      <dc:date>2018-10-06T07:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Freedom k64F Switching Between two applications bootloader code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Freedom-k64F-Switching-Between-two-applications-bootloader-code/m-p/829519#M50125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aashir&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One potential method is to use the SWAP BLOCK functionality in the K64, which allows you to swap between two code bases (one in the lower half of memory and the other in the upper half of memory) - see &lt;BR /&gt;&lt;A class="jive-link-thread-small" data-containerid="2019" data-containertype="14" data-objectid="445528" data-objecttype="1" href="https://community.nxp.com/thread/445528"&gt;https://community.nxp.com/thread/445528&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-thread-small" data-containerid="2019" data-containertype="14" data-objectid="439189" data-objecttype="1" href="https://community.nxp.com/thread/439189"&gt;https://community.nxp.com/thread/439189&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, the uTasker project contains the ability to have one code base but to chose a set of tasks to operate at run time (based on a DIP switch or parameter) as well as to swap between different such configurations during run time (option MULTISTART). Furthermore, it includes multiple boot loaders :[&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fdocs%2FuTasker%2FuTaskerSerialLoader.pdf" rel="nofollow" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.pdf&lt;/A&gt;&lt;SPAN&gt; / &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fdocs%2FuTasker%2FuTasker_BM_Loader.pdf" rel="nofollow" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTasker_BM_Loader.pdf&lt;/A&gt;&lt;SPAN&gt;] which can be used together to achieve many variations of such.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most is available in the free open source version on Github or, for professional requirements, a supported version with advanced features is also available.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;BR /&gt;Kinetis K64:&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-K64F.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-K64F.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTWR-K64F120M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K64F120M.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTEENSY_3.5.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TEENSY_3.5.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FHexiwear-K64F.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/Hexiwear-K64F.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2018 21:36:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Freedom-k64F-Switching-Between-two-applications-bootloader-code/m-p/829519#M50125</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-10-08T21:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Freedom k64F Switching Between two applications bootloader code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Freedom-k64F-Switching-Between-two-applications-bootloader-code/m-p/829520#M50126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark, Thanks for the guidance but the first link you gave is not available and i&amp;nbsp;can't find&amp;nbsp;a suitable example of swapping between flash memory in application for IAP. Basically my application will flash the code received over IP and then shift the control to new application burned and right now i cant find any direction to move forward? Do i need to work with PC and SP?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 04:42:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Freedom-k64F-Switching-Between-two-applications-bootloader-code/m-p/829520#M50126</guid>
      <dc:creator>aas_jav</dc:creator>
      <dc:date>2018-10-09T04:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Freedom k64F Switching Between two applications bootloader code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Freedom-k64F-Switching-Between-two-applications-bootloader-code/m-p/829521#M50127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aashir&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have any problems with the links - the first is to another forum entry - if the links don't work for you just do a search in the forum for "SWAP" and you will find these and possibly others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check the uTasker open source project it includes an API that is simple to use.&lt;BR /&gt;&lt;STRONG&gt;fnSwapMemory(1);&lt;/STRONG&gt; returns the present state of the SWAP blocks&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_STATE_UNINITIALISED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_STATE_SWAPPED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_STATE_USING_1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_STATE_USING_0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_COMMAND_FAILURE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define SWAP_ERASE_FAILURE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once new code has been copied it is swapped using&lt;BR /&gt;&lt;STRONG&gt;fnSwapMemory(0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;At &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-K64F.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-K64F.html&lt;/A&gt;&lt;SPAN&gt; you will find binaries that allow you to test this on a FRDM-K64F, as well as loading new code via USB, SD card or Web Browser.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are doing it for a school project you will find all that you need to experiment and learn in the open source version. Should you have a professional requirement it is all available as a supported turn-key solution that will avoid any project risks or delays.&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;P&gt;&lt;/P&gt;&lt;P&gt;P.S. No CPU register level coding is usually needed to do such things, although there is a routine called&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;extern void start_application(unsigned long app_link_location);&lt;/STRONG&gt;&lt;BR /&gt;that is available in case one wants to jump to another application without going through a reset at the the usual reset vector location (which indeed sets PC and SP accordingly).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 10:41:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Freedom-k64F-Switching-Between-two-applications-bootloader-code/m-p/829521#M50127</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-10-09T10:41:58Z</dc:date>
    </item>
  </channel>
</rss>

