<?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>MPC5xxx中的主题 Re: MPC5775B/E, Problem with D-Cache and asynchronous MC Exceptions from MPU</title>
    <link>https://community.nxp.com/t5/MPC5xxx/MPC5775B-E-Problem-with-D-Cache-and-asynchronous-MC-Exceptions/m-p/1033146#M15490</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there's one more option - you can put sensitive data to certain RAM area which will be configured as cache inhibited by MMU. It will slightly affect the performance but I think this is the best solution. &lt;/P&gt;&lt;P&gt;By the way, this is much more easier on other MPC57xx devices which have CMPU (core MPU) and SMPU (system MPU), so access can be disabled directly in the core.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lukas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jan 2020 10:51:22 GMT</pubDate>
    <dc:creator>lukaszadrapa</dc:creator>
    <dc:date>2020-01-06T10:51:22Z</dc:date>
    <item>
      <title>MPC5775B/E, Problem with D-Cache and asynchronous MC Exceptions from MPU</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5775B-E-Problem-with-D-Cache-and-asynchronous-MC-Exceptions/m-p/1033145#M15489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear NXP Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Migrating an OS kernel from MPC5643L to MPC5775B/E, we face some issues&lt;BR /&gt;with D-cache and MPU. With respect to the kernel, these two are the major&lt;BR /&gt;difference between the two MCUs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The core problem is the delayed MC exception from the MPU in case of a&lt;BR /&gt;forbidden store:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The MPU sits behind the cache and only protects the contents of the main&lt;BR /&gt;memory. The cache contents are however damaged by the store. For normal&lt;BR /&gt;process RAM there is a solution: The IVOR #1 handler reads the target&lt;BR /&gt;address of the failing store from the MPU and issues a cache block&lt;BR /&gt;invalidation instruction (dcbi, icbi) at that address. This makes the&lt;BR /&gt;temporarily bad memory contents be replaced by the still correct,&lt;BR /&gt;undamaged main memory contents on next use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By appropriate synchronization instructions, we can ensure that all of&lt;BR /&gt;this repair is safely completed prior to the next context switch, i.e.&lt;BR /&gt;another process may have damaged data for a short while but it won't&lt;BR /&gt;become active during this critical period of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Situation is worse for OS data. Like in most code samples, we hold e.g.&lt;BR /&gt;the External Interrupt vector table in RAM. If an External Interrupt&lt;BR /&gt;appears after a process has issued a forbidden store into the table but&lt;BR /&gt;before the MPU has raised the MC exception, thus before the IVOR #4&lt;BR /&gt;handler could repair the cache contents, then the read and used interrupt&lt;BR /&gt;address would be wrong and the code would crash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have configured the cache as write-through for all of the RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following (undesired) solutions are known:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* We can put all sensitive OS data into an MMU protected memory section.&lt;BR /&gt;&amp;nbsp; MMU exceptions are raised synchronously and don't cause any headache.&lt;BR /&gt;&amp;nbsp; Drawback: The MMU can only control memory chunks of power-of-two size.&lt;BR /&gt;&amp;nbsp; We would loose a significant amount of RAM because of the alignment of&lt;BR /&gt;&amp;nbsp; subsequent data sections&lt;BR /&gt;* We can turn off the store buffers to minimize the delay of the MC&lt;BR /&gt;&amp;nbsp; exception from the MPU. (However, it is unclear if this would be enough&lt;BR /&gt;&amp;nbsp; without even setting the guard bit.) Drawback: Significant performance&lt;BR /&gt;&amp;nbsp; loss&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;Would you know more solutions? In particular, is there a possibility to&lt;BR /&gt;hinder the D cache from caching written data according to this idea: A&lt;BR /&gt;store at a cached address wouldn't change the cache block contents&lt;BR /&gt;immediately but invalidate the block so that subsequent reads would force&lt;BR /&gt;a cache line fill from the (protected, undamaged) main memory instead of&lt;BR /&gt;returning the illicitly overwritten cache block contents?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2020 17:59:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5775B-E-Problem-with-D-Cache-and-asynchronous-MC-Exceptions/m-p/1033145#M15489</guid>
      <dc:creator>peter_vranken</dc:creator>
      <dc:date>2020-01-03T17:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5775B/E, Problem with D-Cache and asynchronous MC Exceptions from MPU</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5775B-E-Problem-with-D-Cache-and-asynchronous-MC-Exceptions/m-p/1033146#M15490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there's one more option - you can put sensitive data to certain RAM area which will be configured as cache inhibited by MMU. It will slightly affect the performance but I think this is the best solution. &lt;/P&gt;&lt;P&gt;By the way, this is much more easier on other MPC57xx devices which have CMPU (core MPU) and SMPU (system MPU), so access can be disabled directly in the core.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lukas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2020 10:51:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5775B-E-Problem-with-D-Cache-and-asynchronous-MC-Exceptions/m-p/1033146#M15490</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2020-01-06T10:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5775B/E, Problem with D-Cache and asynchronous MC Exceptions from MPU</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5775B-E-Problem-with-D-Cache-and-asynchronous-MC-Exceptions/m-p/1033147#M15491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Lukas, for your confirmation. Changing the MCU is of course not done just like that. However, meanwhile the SW is migrated and running stably. I've summarized the made experiences in a new thread, see &lt;A href="https://community.nxp.com/message/1260631"&gt;https://community.nxp.com/message/1260631&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2020 22:03:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5775B-E-Problem-with-D-Cache-and-asynchronous-MC-Exceptions/m-p/1033147#M15491</guid>
      <dc:creator>peter_vranken</dc:creator>
      <dc:date>2020-01-27T22:03:37Z</dc:date>
    </item>
  </channel>
</rss>

