<?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: S32K144: Cache enable/disable question in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905091#M4596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Victor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;Regarding your answer marked&amp;nbsp;with red on Q2, what is the mean of "buffer is cleared"?&lt;/P&gt;&lt;P&gt;It will execute 2 steps: 1. flush cache content to destination; 2. invalidate&amp;nbsp;cache content&lt;/P&gt;&lt;P&gt;Is it right?&lt;/P&gt;&lt;P&gt;I am concerned about the valid content behavior in cache.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Liu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 05 May 2019 01:06:28 GMT</pubDate>
    <dc:creator>dsfire</dc:creator>
    <dc:date>2019-05-05T01:06:28Z</dc:date>
    <item>
      <title>S32K144: Cache enable/disable question</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905089#M4594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the following statement for cache enable.&lt;BR /&gt;&lt;STRONG&gt;Q1: The following statement is ok? Does this statement can enable both instructions cache and data cache? And don't need other configuration for cache enable?&lt;/STRONG&gt;&lt;BR /&gt;LMEM-&amp;gt;PCCCR = LMEM_PCCCR_INVW0(1) | LMEM_PCCCR_INVW1(1) | LMEM_PCCCR_GO(1) | LMEM_PCCCR_ENCACHE(1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i want to disable PFLASH cache temporarily before modifying PFLASH,&lt;BR /&gt;&lt;STRONG&gt;Q2: The following statement is ok? And don't need to flush data(in cache) to destination before PFLASH cache disable? If needed, how to flush?&lt;/STRONG&gt;&lt;BR /&gt;MSCM-&amp;gt;OCMDR[0u] |= MSCM_OCMDR_OCM1(0x3u);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i want to disable cache temporarily,&lt;BR /&gt;&lt;STRONG&gt;Q3: The following statement is ok? And don't need to flush data(in cache) to destination before cache disable? If needed, how to flush?&lt;/STRONG&gt;&lt;BR /&gt;LMEM-&amp;gt;PCCCR = LMEM_PCCCR_INVW0(1) | LMEM_PCCCR_INVW1(1) | LMEM_PCCCR_GO(1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Liu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2019 10:20:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905089#M4594</guid>
      <dc:creator>dsfire</dc:creator>
      <dc:date>2019-04-23T10:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144: Cache enable/disable question</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905090#M4595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Liu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your questions please see my comments below.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q1: The following statement is ok? Can this statement enable both instructions cache and data cache? And don't need other configuration for cache enable?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Your statement's correct, you only need that to enable the cache.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q2: The following statement is ok? And don't need to flush data(in cache) to a destination before PFLASH cache disable? If needed, how to flush?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This statement is correct. Noticed that when you do this the buffer is cleared automatically.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/75084iB8C89637EFEBF511/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q3: The following statement is ok? And don't need to flush data(in cache) to a destination before cache disable? If needed, how to flush?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Your statement is correct. However, I recommend you to add the following statements. &lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/* Enables the processor code bus to invalidate all lines in both ways.
and Initiate the processor code bus code cache command. */&lt;/SPAN&gt;
base&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;PCCCR &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; LMEM_PCCCR_INVW0_MASK &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; LMEM_PCCCR_INVW1_MASK &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; LMEM_PCCCR_GO_MASK&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/* Wait until the cache command completes. */&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;base&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;PCCCR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; LMEM_PCCCR_GO_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/* As a precaution clear the bits to avoid inadvertently re-running this command. */&lt;/SPAN&gt;
base&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;PCCCR &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;~&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LMEM_PCCCR_INVW0_MASK &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; LMEM_PCCCR_INVW1_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:22:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905090#M4595</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2020-11-02T14:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144: Cache enable/disable question</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905091#M4596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Victor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;Regarding your answer marked&amp;nbsp;with red on Q2, what is the mean of "buffer is cleared"?&lt;/P&gt;&lt;P&gt;It will execute 2 steps: 1. flush cache content to destination; 2. invalidate&amp;nbsp;cache content&lt;/P&gt;&lt;P&gt;Is it right?&lt;/P&gt;&lt;P&gt;I am concerned about the valid content behavior in cache.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Liu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 May 2019 01:06:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905091#M4596</guid>
      <dc:creator>dsfire</dc:creator>
      <dc:date>2019-05-05T01:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144: Cache enable/disable question</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905092#M4597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Liu, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the misunderstood. I was confused by questions two and three, please see my comments below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;when i want to disable PFLASH cache temporarily before modifying PFLASH,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Q2: The following statement is ok? And don't need to flush data(in cache) to destination before PFLASH cache disable? If needed, how to flush?&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;MSCM-&amp;gt;OCMDR[0u] |= MSCM_OCMDR_OCM1(0x3u);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What you are deactivating here is the speculation buffer. When you deactivate this buffer it will be cleared automatically. You don't need to back up this information since it's already in the flash memory. However, since this is a read-only buffer, you don't need to deactivate it before modifying PFLASH. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;when I&lt;/STRONG&gt;&lt;STRONG&gt; want to disable cache temporarily,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Q3: The following statement is ok? And don't need to flush data(in cache) to&lt;/STRONG&gt; &lt;STRONG&gt;destination before cache disable? If needed, how to flush?&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LMEM-&amp;gt;PCCCR = LMEM_PCCCR_INVW0(1) | LMEM_PCCCR_INVW1(1) | LMEM_PCCCR_GO(1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As mentioned before, your statement is correct, but I recommend you to add the lines that I mentioned in my last reply.&lt;/P&gt;&lt;P&gt;Here you don't need to back-up the data. By default, the local memory controller is in write-through mode. A write-through write hit updates the cache hit data and writes to the output bus.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2019 19:50:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905092#M4597</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2019-05-08T19:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144: Cache enable/disable question</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905093#M4598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Victor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your information.&lt;/P&gt;&lt;P&gt;It's cleared to me for Q2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Q3.&lt;/P&gt;&lt;P&gt;Just as you said, the default setting about region is Write-through, and there is no need to back-up the data.&lt;/P&gt;&lt;P&gt;So, if i change the setting to Write-back mode, do i need to bake-up the data if i use your &lt;STRONG&gt;statements&lt;/STRONG&gt;&amp;nbsp;as&amp;nbsp;you mentioned before?&lt;/P&gt;&lt;P&gt;If yes, How i bake-up the data under Write-back mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Liu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 May 2019 06:52:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905093#M4598</guid>
      <dc:creator>dsfire</dc:creator>
      <dc:date>2019-05-11T06:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144: Cache enable/disable question</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905094#M4599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Liu, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In write-back mode initially, writing is done only to the cache. The write to the backing store is postponed until the modified content is about to be replaced by another cache block. Unfortunately, there isn't a way to control this. If you want to eliminate the risk of data loss you must use write-through mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2019 17:43:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905094#M4599</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2019-05-14T17:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144: Cache enable/disable question</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905095#M4600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Victor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a great pity that there is no way to flush cache data to backing store in write-back mode.&lt;/P&gt;&lt;P&gt;Because i think the performance in write-back mode is better than in write-through mode.&lt;/P&gt;&lt;P&gt;But it's clear to me for these modes, thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Liu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2019 10:43:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905095#M4600</guid>
      <dc:creator>dsfire</dc:creator>
      <dc:date>2019-05-15T10:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144: Cache enable/disable question</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905096#M4601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Victor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Q2 you replied : ...you don't need to deactivate it before modifying PFLASH.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But what about this scenario/problem described here?&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/message/880253?commentID=880253#comment-880253" title="https://community.nxp.com/message/880253?commentID=880253#comment-880253"&gt;https://community.nxp.com/message/880253?commentID=880253#comment-880253&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Jochen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2020 06:59:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-Cache-enable-disable-question/m-p/905096#M4601</guid>
      <dc:creator>jochengerster</dc:creator>
      <dc:date>2020-07-16T06:59:36Z</dc:date>
    </item>
  </channel>
</rss>

