<?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: MPU S32K144 can not change region descriptor (RGD) in S32K</title>
    <link>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953424#M5271</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have changed all RGDs so that only Debugger is allowed to access the memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I used these lines to test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*(unsigned int *)0x20006000 = 0xAABBCCDD;&lt;BR /&gt; temp = *(unsigned int *)0x20006000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just do not understand why the codes can NOT go to&amp;nbsp;HardFault_Handler().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attached and run it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anything that I have missed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Aug 2019 16:21:30 GMT</pubDate>
    <dc:creator>klau</dc:creator>
    <dc:date>2019-08-06T16:21:30Z</dc:date>
    <item>
      <title>MPU S32K144 can not change region descriptor (RGD)</title>
      <link>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953422#M5269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dear Reader(s),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to exercise the memory protection unit functions, but anything that I changed the descriptor would take the codes to&amp;nbsp;HardFault_Handler().&amp;nbsp; See line 116 to line 122 in the main.c from the attached file. These lines are copied below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Descriptor 0&lt;BR /&gt;// MPU-&amp;gt;RGD[0].WORD0 = 0x1FFF8000; // start address&lt;BR /&gt;// MPU-&amp;gt;RGD[0].WORD1 = 0x20000000; // end address&lt;BR /&gt;// MPU-&amp;gt;RGD[0].WORD2 = 0x61f7df; // access R/W for masters: M7 - M0&lt;BR /&gt;// // 0x7df;&lt;BR /&gt;// //0x61f7df reset value suggests there are M3 - M0 masters.&lt;BR /&gt;// MPU-&amp;gt;RGD[0].WORD3 = 1; // optional PID, PIDMask, Valid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried to write back what were in these registers, the mcu would go to&amp;nbsp;&lt;SPAN&gt;HardFault_Handler().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there anything I need to change to enable the write to region descriptors?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kevin&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PS. attached zip file.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2019 14:31:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953422#M5269</guid>
      <dc:creator>klau</dc:creator>
      <dc:date>2019-08-05T14:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: MPU S32K144 can not change region descriptor (RGD)</title>
      <link>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953423#M5270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;Please have a look at this thread:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/message/1158836"&gt;https://community.nxp.com/message/1158836&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;BR, Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2019 07:26:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953423#M5270</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2019-08-06T07:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: MPU S32K144 can not change region descriptor (RGD)</title>
      <link>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953424#M5271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have changed all RGDs so that only Debugger is allowed to access the memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I used these lines to test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*(unsigned int *)0x20006000 = 0xAABBCCDD;&lt;BR /&gt; temp = *(unsigned int *)0x20006000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just do not understand why the codes can NOT go to&amp;nbsp;HardFault_Handler().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attached and run it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anything that I have missed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2019 16:21:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953424#M5271</guid>
      <dc:creator>klau</dc:creator>
      <dc:date>2019-08-06T16:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: MPU S32K144 can not change region descriptor (RGD)</title>
      <link>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953425#M5272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you try the program I posted please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Tue, Aug 6, 2019 at 3:27 AM danielmartynek &amp;lt;admin@community.nxp.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2019 19:00:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953425#M5272</guid>
      <dc:creator>klau</dc:creator>
      <dc:date>2019-08-08T19:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: MPU S32K144 can not change region descriptor (RGD)</title>
      <link>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953426#M5273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;If I understand, you want to restrict the core access (write and read) in Descriptor 5.&lt;/P&gt;&lt;P&gt;You write:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;MPU-&amp;gt;RGD[5].WORD2 =&amp;nbsp; 0x7c0;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Which means:&lt;/P&gt;&lt;P&gt;[4-3]&amp;nbsp;M0SM = 0b00 r/w/x; read, write and execute allowed.&lt;/P&gt;&lt;P&gt;It should be&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;MPU-&amp;gt;RGD[5].WORD2 =&amp;nbsp;0x7D8;‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;[4-3]&amp;nbsp;&lt;SPAN&gt;M0SM = 0b11&amp;nbsp;Same as User mode defined in M0UM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[2-1]&amp;nbsp;M0UM = 0b000&amp;nbsp;An attempted access of that mode may be terminated with an access error (if not allowed by&lt;BR /&gt;another descriptor) and the access not performed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But looking at Descriptor 0 and the core access rights in the Supervisor mode, I see that you allows the core to access the whole map.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, the descriptor 5 won't trigger anyway.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 09:53:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953426#M5273</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2019-08-09T09:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: MPU S32K144 can not change region descriptor (RGD)</title>
      <link>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953427#M5274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: small;"&gt;Hi Daniel,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: small;"&gt;Thank you very much for your helps, I can set up the MPU now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: small;"&gt;When I looked at the EAR/EDR, and I could NOT find the exact address that caused the error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: small;"&gt;1) Block write access&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: small;"&gt;MPU-&amp;gt;RGDAAC[0] = 0x7dd; // restrict the write access&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: small;"&gt;*(unsigned int *)0x20004000 = 0xAABBCCDD;&amp;nbsp; &amp;nbsp; or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: small;"&gt;*(unsigned int *)0x20006000 = 0xAABBCCDD;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: small;"&gt;CESR[SPERR3]&amp;nbsp; = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;EAR3&amp;nbsp; = 0x20006fe0; &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; Is this estimate of address? I expect&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;0x20004000 or&amp;nbsp;&lt;SPAN&gt;0x20006000.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;EDR3 = 0x80000007;&amp;nbsp;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;2) Block read access&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;MPU-&amp;gt;RGDAAC[0] = 0x7db;&amp;nbsp; /* restrict read access */&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;temp = *(unsigned int *)0x20006000;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;CESR[SPERR0]&amp;nbsp; = 1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;EAR0&amp;nbsp; = 0x4C0&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;EDR0 = 0x80000006&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;CESR[SPERR2]&amp;nbsp; = 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;EAR2&amp;nbsp; = 0x1fff800C;&amp;nbsp;&lt;SPAN&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; Is this estimate of address? I expect&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;0x20006000.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;EDR2&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= 0x80000006;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;My test codes is attached.&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;Thanks,&lt;BR /&gt;Kevin&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #222222; font-size: small;"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 19:29:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953427#M5274</guid>
      <dc:creator>klau</dc:creator>
      <dc:date>2019-08-09T19:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: MPU S32K144 can not change region descriptor (RGD)</title>
      <link>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953428#M5275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;The default S32DS startup code copies the vector table into SRAM_L and the Stack is located in SRAM_U.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2019 08:07:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/953428#M5275</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2019-08-13T08:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: MPU S32K144 can not change region descriptor (RGD)</title>
      <link>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/1266512#M10636</link>
      <description>&lt;P&gt;Hi, did you solved that?? I am having the same issue. I defined a region without any privileges but it seems i can write to it anyways using a pointer in that way.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 09:17:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/MPU-S32K144-can-not-change-region-descriptor-RGD/m-p/1266512#M10636</guid>
      <dc:creator>riglesias2021</dc:creator>
      <dc:date>2021-04-22T09:17:33Z</dc:date>
    </item>
  </channel>
</rss>

