<?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>Kinetis MicrocontrollersのトピックRe: unable to enter VLPR on the Kinetis KL02</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587287#M34612</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just pulled up a demo app and booted to VLPR successfully. When I used the RUN function first, and then the VLPR function, the transition was not successful. The RUN function is doing something that's preventing a successful transition to VLPR. Can you check to ensure that the MCG module transitions to BLPI mode successfully? A low power mode of the MCG is a requirement to enter VLPR mode, so if it's not actually entering BLPI mode, then this could be causing your holdup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll need to debug and look through your registers. Can you verify that these fields are being set properly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/39432i3FDB7BD6206E6C1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not using the same board, but from my simulation it seems as though the CLOCK_BootToBlpiMode isn't ensuring a successful switch from an external clock to an internal clock, which is messing with the MCG's C1 [CLKS] value and the C1[IREFS] value and preventing it from going into BLPI mode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jul 2016 15:56:59 GMT</pubDate>
    <dc:creator>charlesasquith</dc:creator>
    <dc:date>2016-07-20T15:56:59Z</dc:date>
    <item>
      <title>unable to enter VLPR on the Kinetis KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587282#M34607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My code is pretty mindless right now. I am using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BOARD_BootClockRUN()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To enter RUN mode and I am using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BOARD_BootClockVLPR()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To enter VLPR mode but I am getting hung on the check of the PMSTAT register. The VLPR status bit never gets set and I am hung in RUN mode. The CME bit is cleared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those@@ functions seems to handle all of the necessary changes to satisfy the requirements I see in the reference manual as well as AN4503 and AN4470.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 13:23:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587282#M34607</guid>
      <dc:creator>ryanlush</dc:creator>
      <dc:date>2016-07-19T13:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: unable to enter VLPR on the Kinetis KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587283#M34608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The status bit not getting set means that VLPR mode isn't successfully being entered (as you noted). I would theorize that this is because you are calling BOARD_BootClockRUN before you call BOARD_BootClockVLPR. BOARD_BootClockVLPR configures the clock for RUN mode first &lt;EM&gt;before&lt;/EM&gt; going into VLPR mode, and it also configures the clock speeds to an allowable frequency range for VLPR mode. This means you ONLY need to call BOARD_BootClockVLPR, and calling BOARD_BootClockRUN prior to this would be unnecessary, and would actually configure your MCG module for an external clock instead of an internal clock. This is probably what's preventing you from transitioning into VLPR mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Long story short, delete your call to the BOARD_BootClockRUN function and leave the call to the BOARD_BootClockVLPR function. Hopefully this will fix your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Charles&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 21:52:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587283#M34608</guid>
      <dc:creator>charlesasquith</dc:creator>
      <dc:date>2016-07-19T21:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: unable to enter VLPR on the Kinetis KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587284#M34609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But the whole point is to transition to VLPR mode during runtime when I don't need to run at full speed. Then back to RUN mode when the user wakes the device up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(sent from mobile device)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 22:06:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587284#M34609</guid>
      <dc:creator>ryanlush</dc:creator>
      <dc:date>2016-07-19T22:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: unable to enter VLPR on the Kinetis KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587285#M34610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The functions you are using are designed for starting up to a certain mode. If you want to transition to VLPR mode at some other point in time other than initialization, then I would think you might need to look at the SMC (System Mode Controller), and use that to achieve a VLPR state.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 00:27:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587285#M34610</guid>
      <dc:creator>charlesasquith</dc:creator>
      <dc:date>2016-07-20T00:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: unable to enter VLPR on the Kinetis KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587286#M34611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help Charles. I don't see what I am missing then. The reference manual says (pg 172)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The core, system, bus and flash clock frequencies and MCG&lt;/P&gt;&lt;P&gt;clocking mode are restricted in this mode. See the Power&lt;/P&gt;&lt;P&gt;Management chapter for the maximum allowable frequencies&lt;/P&gt;&lt;P&gt;and MCG modes supported.&lt;/P&gt;&lt;P&gt;Set PMPROT[AVLP]=1, PMCTRL[RUNM]=10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is BOARD_BootClockVLPR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void BOARD_BootClockVLPR(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Core clock: 4MHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; const sim_clock_config_t simConfig = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .clkdiv1 = 0x00040000U, /* SIM_CLKDIV1. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLOCK_SetSimSafeDivs();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLOCK_BootToBlpiMode(0U, kMCG_IrcFast, kMCG_IrclkEnable);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLOCK_SetSimConfig(&amp;amp;simConfig);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SystemCoreClock = 4000000U;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_SetPowerModeProtection(SMC, kSMC_AllowPowerModeAll);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_SetPowerModeVlpr(SMC);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (SMC_GetPowerModeState(SMC) != kSMC_PowerStateVlpr)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function seems to do just that...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOCK_SetSimSafeDivs just sets the bus/flash clocks to a safe value before the switch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOCK_BootToBlpiMode takes me from FEE to FBI to BLPI (required for VLPR) mode. I know it says boot but I can't see why I can't use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOCK_SetBlpiMode assumes I am already in FBI mode and I'm not, I'm in FEE mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOCK_SetSimConfig does the same thing as CLOCK_SetSimSaveDivs but I don't think it's hurting anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then it's sets the SMC just as the reference manual says. I can't see what I am missing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 14:44:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587286#M34611</guid>
      <dc:creator>ryanlush</dc:creator>
      <dc:date>2016-07-20T14:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: unable to enter VLPR on the Kinetis KL02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587287#M34612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just pulled up a demo app and booted to VLPR successfully. When I used the RUN function first, and then the VLPR function, the transition was not successful. The RUN function is doing something that's preventing a successful transition to VLPR. Can you check to ensure that the MCG module transitions to BLPI mode successfully? A low power mode of the MCG is a requirement to enter VLPR mode, so if it's not actually entering BLPI mode, then this could be causing your holdup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll need to debug and look through your registers. Can you verify that these fields are being set properly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/39432i3FDB7BD6206E6C1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not using the same board, but from my simulation it seems as though the CLOCK_BootToBlpiMode isn't ensuring a successful switch from an external clock to an internal clock, which is messing with the MCG's C1 [CLKS] value and the C1[IREFS] value and preventing it from going into BLPI mode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 15:56:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/unable-to-enter-VLPR-on-the-Kinetis-KL02/m-p/587287#M34612</guid>
      <dc:creator>charlesasquith</dc:creator>
      <dc:date>2016-07-20T15:56:59Z</dc:date>
    </item>
  </channel>
</rss>

