<?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のトピックRe: Fault Injection to cache location using an interface provide in emcem</title>
    <link>https://community.nxp.com/t5/S32K/Fault-Injection-to-cache-location-using-an-interface-provide-in/m-p/2419352#M61388</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/267166"&gt;@Rudved_3366&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I haven’t found an example of this cache injection, but here it is in a nutshell:&lt;/P&gt;
&lt;P&gt;Before injecting the CM7_0 I-cache tag double-bit error, verify that the relevant I-cache error-bank entries (IEBRn) are available and unlocked.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_0-1791448008505.png" style="width: 846px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/397519i86E10B7FF9F4D90A/image-dimensions/846x159?v=v2" width="846" height="159" role="button" title="danielmartynek_0-1791448008505.png" alt="danielmartynek_0-1791448008505.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I tested it on S32K344, which I have on the bench, I injected:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;	if (eMcem_SetupInjectionChannel(EMCEM_EIM_CH_3, 1, 2 ) != (Std_ReturnType)E_OK)
	{
		while (1U);
	}
	if (eMcem_InjectFault(EMCEM_EIM_CH_3) != (Std_ReturnType)E_OK)
	{
		while (1U);
	}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, in the handler, disable the EIM.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;void BusFault_Handler(void)
{
if(IP_EIM-&amp;gt;EIMCR &amp;amp; EIM_EIMCR_GEIEN_MASK)
{
IP_EIM-&amp;gt;EIMCR = EIM_EIMCR_GEIEN(0);
}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE that the recovery code (such as the vector table referenced by VTOR, the exception handler, and whatever the handler calls) must not be in a cacheable region, because we do not want the error to be injected again during recovery.&lt;/P&gt;
&lt;P&gt;Then, read the IEBR registers again and clear them by writing 0 to them.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_2-1791449944755.png" style="width: 879px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/397523i76571DD2CED41459/image-dimensions/879x145?v=v2" width="879" height="145" role="button" title="danielmartynek_2-1791449944755.png" alt="danielmartynek_2-1791449944755.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Call an API to invalidate the cache.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2026 08:59:21 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2026-10-08T08:59:21Z</dc:date>
    <item>
      <title>Fault Injection to cache location using an interface provide in emcem</title>
      <link>https://community.nxp.com/t5/S32K/Fault-Injection-to-cache-location-using-an-interface-provide-in/m-p/2419094#M61353</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;&lt;P&gt;I have addition question to below query (&lt;A href="https://community.nxp.com/t5/S32K/what-values-to-select-as-arguments-for-eMcem/m-p/2418919" target="_blank"&gt;what values to select as arguments for eMcem_setupinjectionChannel - NXP Community&lt;/A&gt;&lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;I need to inject a 2-bit fault in Cache location but I'm not sure what it means as mentioned in the reference manual and we use NXP s32K394 microcontroller:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rudved_3366_0-1791374596002.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/397427i2C544983E483817E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rudved_3366_0-1791374596002.png" alt="Rudved_3366_0-1791374596002.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I need to call below function 2 times to inject the faults in cache and get the 2-bit error in cache like below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rudved_3366_1-1791374706513.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/397428i026D4E802521F59E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rudved_3366_1-1791374706513.png" alt="Rudved_3366_1-1791374706513.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I'm doing wrongly, could you please share the example code how to do this injection, and currently we are using SAF package in our project, so if there are already fault injection code exists for the these, please share which file I need to refer to inject all kind of faults using (EIM) for memory test interface which is provided in SAF module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2026 12:08:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Fault-Injection-to-cache-location-using-an-interface-provide-in/m-p/2419094#M61353</guid>
      <dc:creator>Rudved_3366</dc:creator>
      <dc:date>2026-10-07T12:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Fault Injection to cache location using an interface provide in emcem</title>
      <link>https://community.nxp.com/t5/S32K/Fault-Injection-to-cache-location-using-an-interface-provide-in/m-p/2419164#M61363</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/160001"&gt;@danielmartynek&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you please check above query also which is related to fault injection to cache address.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2026 17:49:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Fault-Injection-to-cache-location-using-an-interface-provide-in/m-p/2419164#M61363</guid>
      <dc:creator>Rudved_3366</dc:creator>
      <dc:date>2026-10-07T17:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Fault Injection to cache location using an interface provide in emcem</title>
      <link>https://community.nxp.com/t5/S32K/Fault-Injection-to-cache-location-using-an-interface-provide-in/m-p/2419352#M61388</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/267166"&gt;@Rudved_3366&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I haven’t found an example of this cache injection, but here it is in a nutshell:&lt;/P&gt;
&lt;P&gt;Before injecting the CM7_0 I-cache tag double-bit error, verify that the relevant I-cache error-bank entries (IEBRn) are available and unlocked.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_0-1791448008505.png" style="width: 846px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/397519i86E10B7FF9F4D90A/image-dimensions/846x159?v=v2" width="846" height="159" role="button" title="danielmartynek_0-1791448008505.png" alt="danielmartynek_0-1791448008505.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I tested it on S32K344, which I have on the bench, I injected:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;	if (eMcem_SetupInjectionChannel(EMCEM_EIM_CH_3, 1, 2 ) != (Std_ReturnType)E_OK)
	{
		while (1U);
	}
	if (eMcem_InjectFault(EMCEM_EIM_CH_3) != (Std_ReturnType)E_OK)
	{
		while (1U);
	}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, in the handler, disable the EIM.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;void BusFault_Handler(void)
{
if(IP_EIM-&amp;gt;EIMCR &amp;amp; EIM_EIMCR_GEIEN_MASK)
{
IP_EIM-&amp;gt;EIMCR = EIM_EIMCR_GEIEN(0);
}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE that the recovery code (such as the vector table referenced by VTOR, the exception handler, and whatever the handler calls) must not be in a cacheable region, because we do not want the error to be injected again during recovery.&lt;/P&gt;
&lt;P&gt;Then, read the IEBR registers again and clear them by writing 0 to them.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_2-1791449944755.png" style="width: 879px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/397523i76571DD2CED41459/image-dimensions/879x145?v=v2" width="879" height="145" role="button" title="danielmartynek_2-1791449944755.png" alt="danielmartynek_2-1791449944755.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Call an API to invalidate the cache.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2026 08:59:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Fault-Injection-to-cache-location-using-an-interface-provide-in/m-p/2419352#M61388</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2026-10-08T08:59:21Z</dc:date>
    </item>
  </channel>
</rss>

