<?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>S32Kのトピック  flash_partitioning _s32k144 example project</title>
    <link>https://community.nxp.com/t5/S32K/flash-partitioning-s32k144-example-project/m-p/737842#M1925</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;This is regarding a comment in the main.c of &lt;STRONG&gt;flash_partitioning _s32k144 example project:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* Set callback function before a long time consuming flash operation&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* (&lt;SPAN style="text-decoration: underline;"&gt;ex&lt;/SPAN&gt;: erasing) to let the application code do other tasks while flash&lt;/P&gt;&lt;P&gt;* in operation. In this case we use it to enable interrupt for&lt;/P&gt;&lt;P&gt;* Flash Command Complete event */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then following that,&amp;nbsp; &lt;/P&gt;&lt;P&gt;FLASH_DRV_EraseSector(&amp;amp;flashSSDConfig, address, size);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is called which in turn calls &lt;/P&gt;&lt;P&gt;FLASH_DRV_EraseSector&amp;nbsp;where eventually we see the call to the callback:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;while&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; (0U == (FTFx_FSTAT &amp;amp; FTFx_FSTAT_CCIF_MASK))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* Wait till CCIF bit is set&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* Serve callback function as often as possible&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; (NULL_CALLBACK != pSSDConfig-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small;"&gt;CallBack&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* Temporarily disable compiler's check for ROM access call from within a ram function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* The use of a function pointer type makes this check irrelevant.&lt;/P&gt;&lt;P&gt;* Nevertheless, it is imperative that the user-provided callback be defined in RAMSECTION */&lt;/P&gt;&lt;P&gt;DISABLE_CHECK_RAMSECTION_FUNCTION_CALL&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; (pSSDConfig-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small;"&gt;CallBack&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;)();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ENABLE_CHECK_RAMSECTION_FUNCTION_CALL&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Now I see a while loop that waits until CCIF is set and while it is waiting it enables the CCIF INTERRUPT via callback&amp;nbsp;and the CCIF interrupt disables itself , how is this not blocking , we have to wait until CCIF is set .&lt;/P&gt;&lt;P&gt;HOW IS THIS CALLBACK MAKING THIS NON BLOCKING ? CONTRARY TO WHAT THE COMMENT SAYS.&lt;/P&gt;&lt;P&gt;TO ME THIS WAITS A CERTAIN AMOUNT OF TIME UNTILL CCIF IS SET, INTERRUPT OR NOT.&lt;/P&gt;&lt;P&gt;CCIF GETS SET AND WHILE LOOP IS EXITED BEFORE THE CALLBACK GETS A CHANCE TO ENABLE THE INTERRUPT.&lt;/P&gt;&lt;P&gt;That comment is really confusing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLEASE ENLIGHTEN ME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Dec 2017 23:58:28 GMT</pubDate>
    <dc:creator>hajianik</dc:creator>
    <dc:date>2017-12-20T23:58:28Z</dc:date>
    <item>
      <title>flash_partitioning _s32k144 example project</title>
      <link>https://community.nxp.com/t5/S32K/flash-partitioning-s32k144-example-project/m-p/737842#M1925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;This is regarding a comment in the main.c of &lt;STRONG&gt;flash_partitioning _s32k144 example project:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* Set callback function before a long time consuming flash operation&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* (&lt;SPAN style="text-decoration: underline;"&gt;ex&lt;/SPAN&gt;: erasing) to let the application code do other tasks while flash&lt;/P&gt;&lt;P&gt;* in operation. In this case we use it to enable interrupt for&lt;/P&gt;&lt;P&gt;* Flash Command Complete event */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then following that,&amp;nbsp; &lt;/P&gt;&lt;P&gt;FLASH_DRV_EraseSector(&amp;amp;flashSSDConfig, address, size);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is called which in turn calls &lt;/P&gt;&lt;P&gt;FLASH_DRV_EraseSector&amp;nbsp;where eventually we see the call to the callback:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;while&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; (0U == (FTFx_FSTAT &amp;amp; FTFx_FSTAT_CCIF_MASK))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* Wait till CCIF bit is set&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* Serve callback function as often as possible&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; (NULL_CALLBACK != pSSDConfig-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small;"&gt;CallBack&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* Temporarily disable compiler's check for ROM access call from within a ram function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* The use of a function pointer type makes this check irrelevant.&lt;/P&gt;&lt;P&gt;* Nevertheless, it is imperative that the user-provided callback be defined in RAMSECTION */&lt;/P&gt;&lt;P&gt;DISABLE_CHECK_RAMSECTION_FUNCTION_CALL&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; (pSSDConfig-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: small;"&gt;CallBack&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;)();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ENABLE_CHECK_RAMSECTION_FUNCTION_CALL&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Now I see a while loop that waits until CCIF is set and while it is waiting it enables the CCIF INTERRUPT via callback&amp;nbsp;and the CCIF interrupt disables itself , how is this not blocking , we have to wait until CCIF is set .&lt;/P&gt;&lt;P&gt;HOW IS THIS CALLBACK MAKING THIS NON BLOCKING ? CONTRARY TO WHAT THE COMMENT SAYS.&lt;/P&gt;&lt;P&gt;TO ME THIS WAITS A CERTAIN AMOUNT OF TIME UNTILL CCIF IS SET, INTERRUPT OR NOT.&lt;/P&gt;&lt;P&gt;CCIF GETS SET AND WHILE LOOP IS EXITED BEFORE THE CALLBACK GETS A CHANCE TO ENABLE THE INTERRUPT.&lt;/P&gt;&lt;P&gt;That comment is really confusing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLEASE ENLIGHTEN ME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2017 23:58:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/flash-partitioning-s32k144-example-project/m-p/737842#M1925</guid>
      <dc:creator>hajianik</dc:creator>
      <dc:date>2017-12-20T23:58:28Z</dc:date>
    </item>
  </channel>
</rss>

