<?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 Flash driver fails when configuring swap at 180MHz in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-driver-fails-when-configuring-swap-at-180MHz/m-p/568994#M34064</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When trying to initialize flash swapping for reprogramming purposes, I am failing when calling to execute flash swap configuration commands using the FLASH_SwapControl function in the fsl_flash.c driver file when running my core clock frequency at 180MHz. Note, that it works fine when running at 120MHz. I have verified that my flash clock is divided down by 7 so that it is below the required 28MHz. The code used for configuring the flash is right out of the demo app up for reading/writing flash right up until we configure the swap as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;DEMO APP CODE from main function of &lt;SPAN style="font-size: 10pt;"&gt;SDK_2.0_MK26FN2M0xxx18/boards/twrk65f180m/driver_examples/flash/flash_erase_program_verify/flash_erase_program_verify.c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OUR CODE BELOW:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("\r\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; activeBlock = (FTFE-&amp;gt;FCNFG &amp;gt;&amp;gt; 3) &amp;amp; 0x01;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( activeBlock == 0 )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Program Flash Half 0 (Blocks 0/1) located at address 0x0000\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Executing from Program Flash Half 0 (Blocks 0/1) \n\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; settingsAddress =&amp;nbsp; pflashTotalSize - (3*pflashSectorSize) - pflashSectorSize;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Program Flash Half 1 (Blocks 2/3) located at address 0x0000\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Executing from Program Flash Half 1 (Blocks 2/3) \n\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; settingsAddress =&amp;nbsp; (pflashTotalSize / 2) - (3*pflashSectorSize) - pflashSectorSize;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flashSwapAddress = (pflashTotalSize / 2) - pflashSectorSize;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = FLASH_SwapControl(&amp;amp;flashDriver, flashSwapAddress, kFLASH_swapControlOptionReportStatus, &amp;amp;flashSwapState);&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( result != kStatus_FLASH_Success )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("\r\n ERROR flash_SwapControl optionReport Status Result = %d 0x%x", result, result);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;................................&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MORE UNRELATED CODE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bolded line of code returns a 0x67 from the attempted call of flash_command_sequence. The 0x67 indicates a kFlash_AccessError.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something we need to configure in the driver, or something else that needs to be done prior to making this call when running in High Speed mode?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2016 06:04:43 GMT</pubDate>
    <dc:creator>patricklewis</dc:creator>
    <dc:date>2016-08-04T06:04:43Z</dc:date>
    <item>
      <title>Flash driver fails when configuring swap at 180MHz</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-driver-fails-when-configuring-swap-at-180MHz/m-p/568994#M34064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When trying to initialize flash swapping for reprogramming purposes, I am failing when calling to execute flash swap configuration commands using the FLASH_SwapControl function in the fsl_flash.c driver file when running my core clock frequency at 180MHz. Note, that it works fine when running at 120MHz. I have verified that my flash clock is divided down by 7 so that it is below the required 28MHz. The code used for configuring the flash is right out of the demo app up for reading/writing flash right up until we configure the swap as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;DEMO APP CODE from main function of &lt;SPAN style="font-size: 10pt;"&gt;SDK_2.0_MK26FN2M0xxx18/boards/twrk65f180m/driver_examples/flash/flash_erase_program_verify/flash_erase_program_verify.c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OUR CODE BELOW:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("\r\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; activeBlock = (FTFE-&amp;gt;FCNFG &amp;gt;&amp;gt; 3) &amp;amp; 0x01;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( activeBlock == 0 )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Program Flash Half 0 (Blocks 0/1) located at address 0x0000\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Executing from Program Flash Half 0 (Blocks 0/1) \n\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; settingsAddress =&amp;nbsp; pflashTotalSize - (3*pflashSectorSize) - pflashSectorSize;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Program Flash Half 1 (Blocks 2/3) located at address 0x0000\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Executing from Program Flash Half 1 (Blocks 2/3) \n\n");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; settingsAddress =&amp;nbsp; (pflashTotalSize / 2) - (3*pflashSectorSize) - pflashSectorSize;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flashSwapAddress = (pflashTotalSize / 2) - pflashSectorSize;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = FLASH_SwapControl(&amp;amp;flashDriver, flashSwapAddress, kFLASH_swapControlOptionReportStatus, &amp;amp;flashSwapState);&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( result != kStatus_FLASH_Success )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("\r\n ERROR flash_SwapControl optionReport Status Result = %d 0x%x", result, result);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;................................&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MORE UNRELATED CODE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bolded line of code returns a 0x67 from the attempted call of flash_command_sequence. The 0x67 indicates a kFlash_AccessError.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something we need to configure in the driver, or something else that needs to be done prior to making this call when running in High Speed mode?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 06:04:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-driver-fails-when-configuring-swap-at-180MHz/m-p/568994#M34064</guid>
      <dc:creator>patricklewis</dc:creator>
      <dc:date>2016-08-04T06:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Flash driver fails when configuring swap at 180MHz</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-driver-fails-when-configuring-swap-at-180MHz/m-p/568995#M34065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/4147i9AEA366F5005C3EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Another reference: &lt;A _jive_internal="true" href="https://community.nxp.com/message/584668?commentID=584668#comment-584668" title="https://community.nxp.com/message/584668?commentID=584668#comment-584668"&gt;https://community.nxp.com/message/584668?commentID=584668#comment-584668&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kinetis for professionals: &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%2F" rel="nofollow" target="_blank"&gt;http://www.utasker.com/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 12:24:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Flash-driver-fails-when-configuring-swap-at-180MHz/m-p/568995#M34065</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-08-04T12:24:04Z</dc:date>
    </item>
  </channel>
</rss>

