<?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 in supervisor state on S12X in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MPU-in-supervisor-state-on-S12X/m-p/167241#M5465</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guillaume,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the descriptor in your example only covers the CPU in user state (bit 6 in MPUDESC0). To enable the descriptor for the CPU in supervisor state set bit 7 in MPUDESC0 as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MJW&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by MJW on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2010-01-14&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;12:32 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jan 2010 19:31:15 GMT</pubDate>
    <dc:creator>MJW</dc:creator>
    <dc:date>2010-01-14T19:31:15Z</dc:date>
    <item>
      <title>MPU in supervisor state on S12X</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MPU-in-supervisor-state-on-S12X/m-p/167240#M5464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use the MPU in the supervisor state.&lt;/P&gt;&lt;P&gt;The MPU works in the user state (by detect the MPU access Error interrupt on violation access set for the test), but when I try in supervisor state the MPU access error interrupt does not append whereas the MPUSEL_SVSEN was set to 1 as defined in the datasheet.&lt;/P&gt;&lt;P&gt;I tried to configure the MPU with and without the MPUSEL_SVSEN set to 1, but there is no effect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why the MPU access error interrupt does not append in the supervisor state ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of MPU configuration :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define Start_Shared_Data1 __SEG_START_SHARED_DATA1&lt;BR /&gt;#define End_Shared_Data1 __SEG_END_SHARED_DATA1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define CPU_S12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x40&lt;BR /&gt;#define CPU_XGATE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x20&lt;BR /&gt;#define WRITE_DISABLE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x80&lt;BR /&gt;#define EXECUTE_DISABLE&amp;nbsp;&amp;nbsp; 0x40&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Initialization of Memory Protection unit */&lt;BR /&gt;&amp;nbsp; //setReg8(MPUSEL, 1 | MPUSEL_SVSEN_MASK);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Select Descriptor num. 1 */&lt;BR /&gt;&amp;nbsp; setReg8(MPUSEL, 1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Select Descriptor num. 1 */&lt;BR /&gt;&amp;nbsp; U32Tmp_LowAdrress = (UINT32)Start_Shared_Data1;&lt;BR /&gt;&amp;nbsp; U32Tmp_HighAdrress = (UINT32)End_Shared_Data1;&lt;BR /&gt;&amp;nbsp; setReg8(MPUDESC2, ((UINT8)(U32Tmp_LowAdrress &amp;gt;&amp;gt; 3)));&lt;BR /&gt;&amp;nbsp; setReg8(MPUDESC1, ((UINT8)(U32Tmp_LowAdrress &amp;gt;&amp;gt; 11)));&lt;BR /&gt;&amp;nbsp; setReg8(MPUDESC0, (CPU_S12 | ((UINT8)(U32Tmp_LowAdrress &amp;gt;&amp;gt; 19))));&lt;BR /&gt;&amp;nbsp; setReg8(MPUDESC5, ((UINT8)(U32Tmp_HighAdrress &amp;gt;&amp;gt; 3)));&lt;BR /&gt;&amp;nbsp; setReg8(MPUDESC4, ((UINT8)(U32Tmp_HighAdrress &amp;gt;&amp;gt; 11)));&lt;BR /&gt;&amp;nbsp; setReg8(MPUDESC3, (WRITE_DISABLE | EXECUTE_DISABLE | ((UINT8)(U32Tmp_HighAdrress &amp;gt;&amp;gt;&amp;nbsp; 19))));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And after this configuration is set :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Enable MPU in supervisor state&lt;BR /&gt;&amp;nbsp; MPUSEL_SVSEN = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change "Enable MPU in supervisor state" for "Set the CPU in User State" as follow, the MPUaccess error interrupt appends correctly as I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Set the CPU in User State&lt;BR /&gt;&amp;nbsp; asm("TFR CCRH,A");&lt;BR /&gt;&amp;nbsp; asm("ORAA #128");&lt;BR /&gt;&amp;nbsp; asm("TFR A,CCRH");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have an idea, you are welcome.&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Guillaume.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2010 19:22:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MPU-in-supervisor-state-on-S12X/m-p/167240#M5464</guid>
      <dc:creator>GuillaumeDourne</dc:creator>
      <dc:date>2010-01-14T19:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: MPU in supervisor state on S12X</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MPU-in-supervisor-state-on-S12X/m-p/167241#M5465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Guillaume,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the descriptor in your example only covers the CPU in user state (bit 6 in MPUDESC0). To enable the descriptor for the CPU in supervisor state set bit 7 in MPUDESC0 as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MJW&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by MJW on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2010-01-14&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;12:32 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2010 19:31:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MPU-in-supervisor-state-on-S12X/m-p/167241#M5465</guid>
      <dc:creator>MJW</dc:creator>
      <dc:date>2010-01-14T19:31:15Z</dc:date>
    </item>
  </channel>
</rss>

