<?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: Kinetis K8x MPU and Supervisor/User Modes in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K8x-MPU-and-Supervisor-User-Modes/m-p/640902#M38816</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer could check below MPU register value during KSDK MPU demo execution:&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/6177i58B047A8347BF901/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;&lt;/P&gt;&lt;P&gt;The demo set the SRAM range [0x1FFF0020~0x1FFF007F] with supervisor mode read and execute allowed, but no write and user mode R/W/X no permitted.&lt;/P&gt;&lt;P&gt;That's why when the code want to write new value to related SRAM range will generate the bus fault.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Cannot write here, bus fault occur. */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; regionArray[g_count] = g_count;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The regionArray[] located at above SRAM range as below variable window shows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/6139i91458817591255B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ma Hui&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jan 2017 05:43:47 GMT</pubDate>
    <dc:creator>Hui_Ma</dc:creator>
    <dc:date>2017-01-05T05:43:47Z</dc:date>
    <item>
      <title>Kinetis K8x MPU and Supervisor/User Modes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K8x-MPU-and-Supervisor-User-Modes/m-p/640901#M38815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to understand MPU on K8x family. This family does not include a Cortex M4 MPU, instead, it has Kinetis specific MPU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the &lt;A href="http://www.nxp.com/assets/documents/data/en/reference-manuals/K82P121M150SF5RM.pdf"&gt;Kinetis K82 Sub-Family Reference Manual&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3.1.5 Core privilege levels&lt;/STRONG&gt;&lt;BR /&gt;The ARM documentation uses different terms than this document to distinguish between privilege levels.&lt;BR /&gt;If you see this term... it also means this term...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Privileged -&amp;gt; Supervisor&lt;/LI&gt;&lt;LI&gt;Unprivileged or user -&amp;gt; User&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, Great but when I look at the MPU example in Kinetis SDK v2.1 for FRDM-82F, I cannot see that relation. &lt;/P&gt;&lt;P&gt;As you know, region 0 gives access to User mode for all device at startup.&lt;/P&gt;&lt;P&gt;In the example,&amp;nbsp; a different region is also set to limit user access to a specific region.&lt;/P&gt;&lt;P&gt;First, application is able to write the sepecific region and execution is in Privileged Mode. &lt;/P&gt;&lt;P&gt;And then example removes rights from Region 0 (which gives access to user mode for all device) using MPU_SetRegionRwxMasterAccessRights() function.&lt;/P&gt;&lt;P&gt;After that when example tries to access same region again, it gets "Bus Fault".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is that execution still in Privileged Mode and no operation to pass Unprivileged mode during example.&lt;/P&gt;&lt;P&gt;Example just changes regions access but execution is always in privileged mode and SuperVisor (privileged) mode has rights to access to this region but getting Bus Fault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only I need, differentiate memory access with ARM Cortex Privileged/Unprivileged Modes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Dec 2016 12:06:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K8x-MPU-and-Supervisor-User-Modes/m-p/640901#M38815</guid>
      <dc:creator>muratcakmak</dc:creator>
      <dc:date>2016-12-24T12:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis K8x MPU and Supervisor/User Modes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K8x-MPU-and-Supervisor-User-Modes/m-p/640902#M38816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer could check below MPU register value during KSDK MPU demo execution:&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/6177i58B047A8347BF901/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;&lt;/P&gt;&lt;P&gt;The demo set the SRAM range [0x1FFF0020~0x1FFF007F] with supervisor mode read and execute allowed, but no write and user mode R/W/X no permitted.&lt;/P&gt;&lt;P&gt;That's why when the code want to write new value to related SRAM range will generate the bus fault.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Cannot write here, bus fault occur. */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; regionArray[g_count] = g_count;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The regionArray[] located at above SRAM range as below variable window shows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/6139i91458817591255B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ma Hui&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2017 05:43:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K8x-MPU-and-Supervisor-User-Modes/m-p/640902#M38816</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2017-01-05T05:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis K8x MPU and Supervisor/User Modes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K8x-MPU-and-Supervisor-User-Modes/m-p/640903#M38817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ma Hui but my question was "What does SuperVisor/User Mode mean?" from the Kinetis Specific MPU side? &lt;/P&gt;&lt;P&gt;SuperVisor ?= ARM Cortex M Privileged&lt;/P&gt;&lt;P&gt;User Mode ?= ARM Cortex M Unprivileged&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is true, SRAM range [0x1FFF0020~0x1FFF007F]&amp;nbsp; is set with SuperVisor mode but if SuperVisor means ARM Privileged mode, BUS Fault should not be rised because all example runs with ARM Privileged (SuperVisor) Mode.&lt;/P&gt;&lt;P&gt;I would expect to see BUS Fault when we pass to ARM Unprivileged mode and after trying to access Supervisor SRAM Range.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jan 2017 12:50:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K8x-MPU-and-Supervisor-User-Modes/m-p/640903#M38817</guid>
      <dc:creator>muratcakmak</dc:creator>
      <dc:date>2017-01-08T12:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis K8x MPU and Supervisor/User Modes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K8x-MPU-and-Supervisor-User-Modes/m-p/640904#M38818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Murat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The MPU module in K8x product with below relationship with ARM Cortex M4 core:&lt;/P&gt;&lt;P&gt;SuperVisor = ARM Cortex M Privileged&lt;/P&gt;&lt;P&gt;User Mode = ARM Cortex M Unprivileged&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the MPU demo code located in Flash memory, that doesn't affect the code execution whatever ARM Cortex M4 core in Privileged mode or Unprivileged mode.&lt;/P&gt;&lt;P&gt;The demo shows the SRAM range was protected only with supervisor mode read and execute allowed, the user mode without read/write/execute right.&lt;/P&gt;&lt;P&gt;That SRAM range doesn't writable even core in privileged mode (supervisor mode), for the MPU_RGD2_WORD2 [M0SM] bits is 0b01:&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/7768i000341B6DAC0A4E2/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;The bus fault will happen, for there with operation to write new value to protected SRAM range.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;BR /&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ma Hui&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2017 04:56:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K8x-MPU-and-Supervisor-User-Modes/m-p/640904#M38818</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2017-01-09T04:56:20Z</dc:date>
    </item>
  </channel>
</rss>

