<?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 Is FTFA_FSTAT-&amp;gt;CCIF reliable as Flash available flag ? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Is-FTFA-FSTAT-gt-CCIF-reliable-as-Flash-available-flag/m-p/852701#M51235</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;/P&gt;&lt;P&gt;I'm using KM34Z256 with IAP support. Currently&amp;nbsp;interrupts are disabled during IAP flash write/erase to ensure there is no collision error (IAP code itself is executed in &lt;SPAN&gt;RAM&lt;/SPAN&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I'd like to have some interrupts available during Flash read/write (for example USART and DMA), my&amp;nbsp;approach is :&lt;/P&gt;&lt;P&gt;1.Copy vector table to RAM and modify SCB-&amp;gt;VTOR&lt;/P&gt;&lt;P&gt;2.Define all interrupt handlers as ramfunc&lt;/P&gt;&lt;P&gt;3.Check CCIF in interrupt handler before access to flash resident functions.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;__ramfunc void SysTick_Handler(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; msTicks++; /* increment counter necessary in Delay()*/&lt;BR /&gt;&amp;nbsp; if(FTFA-&amp;gt;FSTAT &amp;amp; FTFA_FSTAT_CCIF_MASK)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; /* Flash resident function */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;DoEvents();&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know if CCIF flag is a reliable indicator of Flash available ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Feb 2019 14:29:07 GMT</pubDate>
    <dc:creator>zixunli</dc:creator>
    <dc:date>2019-02-26T14:29:07Z</dc:date>
    <item>
      <title>Is FTFA_FSTAT-&gt;CCIF reliable as Flash available flag ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Is-FTFA-FSTAT-gt-CCIF-reliable-as-Flash-available-flag/m-p/852701#M51235</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;/P&gt;&lt;P&gt;I'm using KM34Z256 with IAP support. Currently&amp;nbsp;interrupts are disabled during IAP flash write/erase to ensure there is no collision error (IAP code itself is executed in &lt;SPAN&gt;RAM&lt;/SPAN&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I'd like to have some interrupts available during Flash read/write (for example USART and DMA), my&amp;nbsp;approach is :&lt;/P&gt;&lt;P&gt;1.Copy vector table to RAM and modify SCB-&amp;gt;VTOR&lt;/P&gt;&lt;P&gt;2.Define all interrupt handlers as ramfunc&lt;/P&gt;&lt;P&gt;3.Check CCIF in interrupt handler before access to flash resident functions.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;__ramfunc void SysTick_Handler(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; msTicks++; /* increment counter necessary in Delay()*/&lt;BR /&gt;&amp;nbsp; if(FTFA-&amp;gt;FSTAT &amp;amp; FTFA_FSTAT_CCIF_MASK)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; /* Flash resident function */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;DoEvents();&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know if CCIF flag is a reliable indicator of Flash available ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2019 14:29:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Is-FTFA-FSTAT-gt-CCIF-reliable-as-Flash-available-flag/m-p/852701#M51235</guid>
      <dc:creator>zixunli</dc:creator>
      <dc:date>2019-02-26T14:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is FTFA_FSTAT-&gt;CCIF reliable as Flash available flag ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Is-FTFA-FSTAT-gt-CCIF-reliable-as-Flash-available-flag/m-p/852702#M51236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Zixun Li,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the description of the reference manual about this flag:&lt;/P&gt;&lt;P&gt;&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/69479i9FA5950A1F85C979/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;While a flash command is executing, the flag will stay low. So you can use it to check if there isn't a flash operation executing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2019 16:27:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Is-FTFA-FSTAT-gt-CCIF-reliable-as-Flash-available-flag/m-p/852702#M51236</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-02-28T16:27:09Z</dc:date>
    </item>
  </channel>
</rss>

