<?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のトピックdifference between user and supervisor mode?</title>
    <link>https://community.nxp.com/t5/S32K/difference-between-user-and-supervisor-mode/m-p/1186970#M8925</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is difference between user and&amp;nbsp;supervisor mode?&lt;/P&gt;&lt;P&gt;e.g. page 542 (S32K1xx RM):&lt;/P&gt;&lt;P&gt;"&amp;nbsp;The RCM registers can be written only in supervisor mode. Write accesses in user mode are blocked and will result in a bus error. "&lt;/P&gt;&lt;P&gt;can we switch between them in runtime dynamically?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Sat, 21 Nov 2020 12:28:27 GMT</pubDate>
    <dc:creator>JeorgeB</dc:creator>
    <dc:date>2020-11-21T12:28:27Z</dc:date>
    <item>
      <title>difference between user and supervisor mode?</title>
      <link>https://community.nxp.com/t5/S32K/difference-between-user-and-supervisor-mode/m-p/1186970#M8925</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is difference between user and&amp;nbsp;supervisor mode?&lt;/P&gt;&lt;P&gt;e.g. page 542 (S32K1xx RM):&lt;/P&gt;&lt;P&gt;"&amp;nbsp;The RCM registers can be written only in supervisor mode. Write accesses in user mode are blocked and will result in a bus error. "&lt;/P&gt;&lt;P&gt;can we switch between them in runtime dynamically?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 12:28:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/difference-between-user-and-supervisor-mode/m-p/1186970#M8925</guid>
      <dc:creator>JeorgeB</dc:creator>
      <dc:date>2020-11-21T12:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: difference between user and supervisor mode?</title>
      <link>https://community.nxp.com/t5/S32K/difference-between-user-and-supervisor-mode/m-p/1187141#M8941</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;JeorgeB,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The device is running in Supervisor (privileged) mode out of reset. It is controlled by nPRIV bit in CONTROL register (it is core register, see ARM documentation for more details).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If you need to switch to User mode, just set the nPRIV bit in CONTROL register&lt;/P&gt;
&lt;PRE&gt;// switch to User (unprivileged) mode
 __asm__("mov r0, #0x01");
 __asm__("msr control, r0"); // nPRIV = 1‍‍‍&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;And to switch it back, you need to do it in SVC handler&lt;/P&gt;
&lt;PRE&gt;// make a supervisor call (SVC) to transfer control to privileged software
 __asm__("svc #0x00");

void SVC_Handler(void){
 // switch to Supervisor (privileged) mode
 __asm__("mov r0, #0x00");
 __asm__("msr control, r0"); // nPRIV = 0
}‍‍‍‍‍‍‍‍&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 04:37:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/difference-between-user-and-supervisor-mode/m-p/1187141#M8941</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2020-11-23T04:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: difference between user and supervisor mode?</title>
      <link>https://community.nxp.com/t5/S32K/difference-between-user-and-supervisor-mode/m-p/1187146#M8943</link>
      <description>Thanks for your kind reply, where is benefit or application of using supervisor mode? (assume we do not implement any OS on MCU)</description>
      <pubDate>Mon, 23 Nov 2020 04:55:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/difference-between-user-and-supervisor-mode/m-p/1187146#M8943</guid>
      <dc:creator>JeorgeB</dc:creator>
      <dc:date>2020-11-23T04:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: difference between user and supervisor mode?</title>
      <link>https://community.nxp.com/t5/S32K/difference-between-user-and-supervisor-mode/m-p/1191890#M9072</link>
      <description>&lt;P&gt;Sorry for my late reply!&lt;BR /&gt;I am not very familiar with this part, you can refer: &lt;A href="https://developer.arm.com/documentation/dui0552/a/the-cortex-m3-processor/programmers-model/processor-mode-and-privilege-levels-for-software-execution" target="_self"&gt;Processor mode and privilege levels for software execution&lt;/A&gt;&lt;BR /&gt;ARM Cortex related question can also&amp;nbsp;ask in &lt;A href="http://community.arm.com" target="_self"&gt;community.arm.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 01:41:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/difference-between-user-and-supervisor-mode/m-p/1191890#M9072</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2020-12-02T01:41:31Z</dc:date>
    </item>
  </channel>
</rss>

