<?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: run code on ram fault in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/run-code-on-ram-fault/m-p/766245#M46613</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi qingrong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you for your updated information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When do the flash operation, especially launch the command in the RAM, customer need to disable the global interrupt at first, after the command is finished, you can enable the interrupt again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Do you disable the interrupt?&lt;/P&gt;&lt;P&gt;__disable_irq();&lt;/P&gt;&lt;P&gt;Launch flash command;&lt;/P&gt;&lt;P&gt;__enable_irq();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Mar 2018 08:07:44 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2018-03-21T08:07:44Z</dc:date>
    <item>
      <title>run code on ram fault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/run-code-on-ram-fault/m-p/766242#M46610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I run code on RAM, it crashes into hardfault&amp;nbsp;interrupt. I using SKEAZ1284&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the&amp;nbsp;first picture is code on flash. the&amp;nbsp;second picture is the code run on RAM, but when it executes at 0x20000078 hardfault&amp;nbsp;interrupt occurs. it just normal instruct read theMCR-&amp;gt;PLACR register address into R1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28654i111C16909A146632/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28899i04462715FC05947D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/28775iA0756727B87FC205/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 10:47:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/run-code-on-ram-fault/m-p/766242#M46610</guid>
      <dc:creator>jason_shang</dc:creator>
      <dc:date>2018-03-16T10:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: run code on ram fault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/run-code-on-ram-fault/m-p/766243#M46611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shang jason,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Could you tell me what the IDE you are using, do you just put the FLASH_LaunchCMD to RAM or the whole project to RAM.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Take IAR project as an example, you can use this code:&lt;/P&gt;&lt;P&gt;#if (defined(IAR))&lt;BR /&gt;__ramfunc&amp;nbsp; void FLASH_LaunchCMD(uint8_t bWaitComplete)&lt;BR /&gt;#else&lt;BR /&gt;void FLASH_LaunchCMD(uint8_t bWaitComplete)&lt;BR /&gt;#endif&lt;BR /&gt;{&lt;BR /&gt;#if&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; defined(FLASH_ENABLE_STALLING_FLASH_CONTROLLER)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCM-&amp;gt;PLACR |= MCM_PLACR_ESFC_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* enable stalling flash controller when flash is busy */&lt;BR /&gt;#endif&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRH-&amp;gt;FSTAT = 0x80;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(bWaitComplete)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Wait till command is completed&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (!(FTMRH-&amp;gt;FSTAT &amp;amp; FTMRH_FSTAT_CCIF_MASK));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please also don't do the project optimization, then test it again.&lt;/P&gt;&lt;P&gt;Any updated information, please kindly let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2018 08:51:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/run-code-on-ram-fault/m-p/766243#M46611</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-03-19T08:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: run code on ram fault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/run-code-on-ram-fault/m-p/766244#M46612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks&amp;nbsp;for your suggestion, I am using keil, first I place&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;FLASH_LaunchCMD on code section, compile&amp;nbsp;the code.then copy the code data into a data&amp;nbsp;array, use a function pointer jump to data array&amp;nbsp;execute&amp;nbsp;&lt;SPAN&gt;FLASH_LaunchCMD.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2018 14:52:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/run-code-on-ram-fault/m-p/766244#M46612</guid>
      <dc:creator>jason_shang</dc:creator>
      <dc:date>2018-03-20T14:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: run code on ram fault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/run-code-on-ram-fault/m-p/766245#M46613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi qingrong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you for your updated information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When do the flash operation, especially launch the command in the RAM, customer need to disable the global interrupt at first, after the command is finished, you can enable the interrupt again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Do you disable the interrupt?&lt;/P&gt;&lt;P&gt;__disable_irq();&lt;/P&gt;&lt;P&gt;Launch flash command;&lt;/P&gt;&lt;P&gt;__enable_irq();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2018 08:07:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/run-code-on-ram-fault/m-p/766245#M46613</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-03-21T08:07:44Z</dc:date>
    </item>
  </channel>
</rss>

