<?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のトピックHow to enable MemManage_Handler when MPU violation happens?</title>
    <link>https://community.nxp.com/t5/S32K/How-to-enable-MemManage-Handler-when-MPU-violation-happens/m-p/929940#M4935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have a problem wih MPU.&lt;/P&gt;&lt;P&gt;I'm using S32K144 uC.&lt;/P&gt;&lt;P&gt;I'm using MPU to detect stack overflow/underflow.&lt;/P&gt;&lt;P&gt;I have enabled MPU protection for two regions which surrounds the stack.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After this, I enable MemManage_Handler and then the MPU, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; S32_SCB-&amp;gt;SHCSR |= 1&amp;lt;&amp;lt;16;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MPU-&amp;gt;CESR |= MPU_CESR_VLD_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that when I try to write in a protected region, HardFault exception Always occurs.&lt;/P&gt;&lt;P&gt;Do you have experience on this issue?&lt;/P&gt;&lt;P&gt;Is there any restriction to enable MemManage exception?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also redefined MemManage handler&lt;/P&gt;&lt;P&gt;void MemManage_Handler(void)&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;&amp;nbsp; FailureCbk();&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;since I need to apply a recovery action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you will help me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Sep 2019 08:28:02 GMT</pubDate>
    <dc:creator>anita_tranzillo</dc:creator>
    <dc:date>2019-09-30T08:28:02Z</dc:date>
    <item>
      <title>How to enable MemManage_Handler when MPU violation happens?</title>
      <link>https://community.nxp.com/t5/S32K/How-to-enable-MemManage-Handler-when-MPU-violation-happens/m-p/929940#M4935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have a problem wih MPU.&lt;/P&gt;&lt;P&gt;I'm using S32K144 uC.&lt;/P&gt;&lt;P&gt;I'm using MPU to detect stack overflow/underflow.&lt;/P&gt;&lt;P&gt;I have enabled MPU protection for two regions which surrounds the stack.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After this, I enable MemManage_Handler and then the MPU, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; S32_SCB-&amp;gt;SHCSR |= 1&amp;lt;&amp;lt;16;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MPU-&amp;gt;CESR |= MPU_CESR_VLD_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that when I try to write in a protected region, HardFault exception Always occurs.&lt;/P&gt;&lt;P&gt;Do you have experience on this issue?&lt;/P&gt;&lt;P&gt;Is there any restriction to enable MemManage exception?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also redefined MemManage handler&lt;/P&gt;&lt;P&gt;void MemManage_Handler(void)&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;&amp;nbsp; FailureCbk();&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;since I need to apply a recovery action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you will help me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2019 08:28:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-to-enable-MemManage-Handler-when-MPU-violation-happens/m-p/929940#M4935</guid>
      <dc:creator>anita_tranzillo</dc:creator>
      <dc:date>2019-09-30T08:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to enable MemManage_Handler when MPU violation happens?</title>
      <link>https://community.nxp.com/t5/S32K/How-to-enable-MemManage-Handler-when-MPU-violation-happens/m-p/929941#M4936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anita,&lt;BR /&gt;MemManage exceptions rise on an attempt to access regions that are protected by the core ARM Cortex M4 Memory Protection Unit.&lt;BR /&gt;However, the S32K144 MCU&amp;nbsp;implements its own system Memory Protection Unit on the bus and therefore an attempt to access a protected region results in a bus fault exception instead.&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/83397iF63E922A03819A1B/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;BR, Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2019 10:19:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-to-enable-MemManage-Handler-when-MPU-violation-happens/m-p/929941#M4936</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2019-10-01T10:19:58Z</dc:date>
    </item>
  </channel>
</rss>

