<?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のトピックRe: How to make S32K146 M4 Core user mode and supervisor mode switching?</title>
    <link>https://community.nxp.com/t5/S32K/How-to-make-S32K146-M4-Core-user-mode-and-supervisor-mode/m-p/825990#M3189</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;BR /&gt;If you need to switch to User mode, just set the nPRIV bit in CONTROL register&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;// switch to User (unprivileged) mode
 __asm__("mov r0, #0x01");
 __asm__("msr control, r0"); // nPRIV = 1&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&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 class="language-none line-numbers"&gt;&lt;CODE&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;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I’m not familiar with MCAL.&lt;BR /&gt;Could you please create a service ticket?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-329745" rel="nofollow noopener noreferrer" target="_blank"&gt;https://community.nxp.com/docs/DOC-329745&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jul 2018 10:49:24 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2018-07-20T10:49:24Z</dc:date>
    <item>
      <title>How to make S32K146 M4 Core user mode and supervisor mode switching?</title>
      <link>https://community.nxp.com/t5/S32K/How-to-make-S32K146-M4-Core-user-mode-and-supervisor-mode/m-p/825989#M3188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sir&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; How to make&amp;nbsp;S32K146 M4 Core user mode and supervisor mode&amp;nbsp;switching?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Do you have demo code for this case? or reference application document ?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Do&amp;nbsp;S32K146 MCAL must do &lt;SPAN&gt;user mode and supervisor mode&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;switching to&amp;nbsp;&lt;/SPAN&gt;meets functional security?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 15:31:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-to-make-S32K146-M4-Core-user-mode-and-supervisor-mode/m-p/825989#M3188</guid>
      <dc:creator>paulzhou</dc:creator>
      <dc:date>2018-07-18T15:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to make S32K146 M4 Core user mode and supervisor mode switching?</title>
      <link>https://community.nxp.com/t5/S32K/How-to-make-S32K146-M4-Core-user-mode-and-supervisor-mode/m-p/825990#M3189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;BR /&gt;If you need to switch to User mode, just set the nPRIV bit in CONTROL register&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;// switch to User (unprivileged) mode
 __asm__("mov r0, #0x01");
 __asm__("msr control, r0"); // nPRIV = 1&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&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 class="language-none line-numbers"&gt;&lt;CODE&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;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I’m not familiar with MCAL.&lt;BR /&gt;Could you please create a service ticket?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-329745" rel="nofollow noopener noreferrer" target="_blank"&gt;https://community.nxp.com/docs/DOC-329745&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2018 10:49:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-to-make-S32K146-M4-Core-user-mode-and-supervisor-mode/m-p/825990#M3189</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-07-20T10:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to make S32K146 M4 Core user mode and supervisor mode switching?</title>
      <link>https://community.nxp.com/t5/S32K/How-to-make-S32K146-M4-Core-user-mode-and-supervisor-mode/m-p/825991#M3190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Daniel&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Thank you for your help and this problem is solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2018 05:27:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-to-make-S32K146-M4-Core-user-mode-and-supervisor-mode/m-p/825991#M3190</guid>
      <dc:creator>paulzhou</dc:creator>
      <dc:date>2018-07-25T05:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to make S32K146 M4 Core user mode and supervisor mode switching?</title>
      <link>https://community.nxp.com/t5/S32K/How-to-make-S32K146-M4-Core-user-mode-and-supervisor-mode/m-p/1998816#M43489</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am workinh with uC S32K144. I am developing two applications that have different access rights, one runs under supervisor mode, the other under user mode for safety reason.&lt;/P&gt;&lt;P&gt;The problem is, the application that runs under user mode has sometimes the need to read some registers and maube write on them, so it gets rejected and SW resets.&lt;/P&gt;&lt;P&gt;For now I developed a patch to switch to the supervisor mode before running the function that access crticial registers.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there another solution for that ? Is there a way to allow limited access for some registers whe we are on user mode ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 10:29:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/How-to-make-S32K146-M4-Core-user-mode-and-supervisor-mode/m-p/1998816#M43489</guid>
      <dc:creator>Fatma1234</dc:creator>
      <dc:date>2024-11-21T10:29:25Z</dc:date>
    </item>
  </channel>
</rss>

