<?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: Using POWER_SYS_SetMode() to switch to VLPS but PMSTAT doesn't change?</title>
    <link>https://community.nxp.com/t5/S32K/Using-POWER-SYS-SetMode-to-switch-to-VLPS-but-PMSTAT-doesn-t/m-p/1423695#M14275</link>
    <description>&lt;P&gt;Dear NXP,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realized my mistake.&lt;/P&gt;&lt;P&gt;SMC-&amp;gt;PMSTAT cannot reveal VLPS status when debug is enabled.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="APU_1-1646631934421.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/172587i8F7ADF0B287A5289/image-size/medium?v=v2&amp;amp;px=400" role="button" title="APU_1-1646631934421.png" alt="APU_1-1646631934421.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;APU_1-1646631934421.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2022 05:47:10 GMT</pubDate>
    <dc:creator>APU</dc:creator>
    <dc:date>2022-03-07T05:47:10Z</dc:date>
    <item>
      <title>Using POWER_SYS_SetMode() to switch to VLPS but PMSTAT doesn't change?</title>
      <link>https://community.nxp.com/t5/S32K/Using-POWER-SYS-SetMode-to-switch-to-VLPS-but-PMSTAT-doesn-t/m-p/1423216#M14258</link>
      <description>&lt;P&gt;Dear NXP,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using S32K118 with RTM 3.0.0 SDK and try to implement RUN &amp;lt;-&amp;gt; VLPS power mode switch.&lt;/P&gt;&lt;P&gt;Behavior is done within a RTOS task, snippet of code as follow:&lt;/P&gt;&lt;P&gt;#define RUN (0U)&lt;/P&gt;&lt;P&gt;#define VLPS (1U)&lt;/P&gt;&lt;P&gt;#define VLPR (2U)&lt;/P&gt;&lt;P&gt;void CustomizedTask(void *pvParameters)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; (void)pvParameters;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; uint32_t get_addr = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; for (;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (condition_match_1) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; POWER_SYS_SetMode(RUN, POWER_MANAGER_POLICY_AGREEMENT);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else if (condition_match_2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;POWER_SYS_SetMode(VLPS, POWER_MANAGER_POLICY_AGREEMENT);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else if (condition_match_3) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; POWER_SYS_SetMode(VLPR, POWER_MANAGER_POLICY_AGREEMENT);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Do nothing */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vTaskDelay(2000);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get_addr = *((uint32_t*)0x4007E014);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (get_addr == 1) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Show value */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else if (get_addr == 4) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Show value */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else if (get_addr == 16) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Show value */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Show log */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; vTaskDelete(NULL);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to verify whether the power mode has been switched, I access the memory address 0x4007E014, which is supposed to store the value of SMC-&amp;gt;PMSTAT&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="reg.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/172491i1E4B8AD2396640EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="reg.png" alt="reg.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;reg.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I discovered only when I switched between RUN &amp;lt;-&amp;gt; VLPR, the value changed. RUN mode returned value 1, VLPR returned value 4, as described in `SMC_GetPowerModeStatus()` in power_smc_hw_access.h.&lt;/P&gt;&lt;P&gt;When I tried to switch to VLPS, the value always remained 1. This makes me wonder maybe the mode didn't change as expected, yet the function `POWER_SYS_SetMode()` returned "STATUS_SUCCESS".&lt;/P&gt;&lt;P&gt;Is the way I verify is wrong? Or there is something interfering during the transition?&lt;/P&gt;&lt;P&gt;Another question is, why function `POWER_SYS_GetCurrentMode()` only handles cases such as "STAT_RUN" and "STAT_VLPR", whilst other cases are regarded as "default"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;APU&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 09:21:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Using-POWER-SYS-SetMode-to-switch-to-VLPS-but-PMSTAT-doesn-t/m-p/1423216#M14258</guid>
      <dc:creator>APU</dc:creator>
      <dc:date>2022-03-04T09:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using POWER_SYS_SetMode() to switch to VLPS but PMSTAT doesn't change?</title>
      <link>https://community.nxp.com/t5/S32K/Using-POWER-SYS-SetMode-to-switch-to-VLPS-but-PMSTAT-doesn-t/m-p/1423695#M14275</link>
      <description>&lt;P&gt;Dear NXP,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realized my mistake.&lt;/P&gt;&lt;P&gt;SMC-&amp;gt;PMSTAT cannot reveal VLPS status when debug is enabled.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="APU_1-1646631934421.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/172587i8F7ADF0B287A5289/image-size/medium?v=v2&amp;amp;px=400" role="button" title="APU_1-1646631934421.png" alt="APU_1-1646631934421.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;APU_1-1646631934421.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 05:47:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Using-POWER-SYS-SetMode-to-switch-to-VLPS-but-PMSTAT-doesn-t/m-p/1423695#M14275</guid>
      <dc:creator>APU</dc:creator>
      <dc:date>2022-03-07T05:47:10Z</dc:date>
    </item>
  </channel>
</rss>

