<?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: How to wait in Low Power mode with FreeRTOS and Kinetis MKL16Z in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-wait-in-Low-Power-mode-with-FreeRTOS-and-Kinetis-MKL16Z/m-p/887278#M7930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have working solution.&lt;/P&gt;&lt;P&gt;I added a&amp;nbsp;vApplicationIdleHook() that checks a global variable, and if set, it calls&amp;nbsp;APP_PowerModeSwitch().&lt;/P&gt;&lt;P&gt;When an interrupt like the FreeRTOS system tick wakes MCU, the state of a user button is checked.&lt;/P&gt;&lt;P&gt;If pressed, the task that requested low power mode is sent an event, so that it wakes up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Feb 2019 16:25:53 GMT</pubDate>
    <dc:creator>bgraham</dc:creator>
    <dc:date>2019-02-07T16:25:53Z</dc:date>
    <item>
      <title>How to wait in Low Power mode with FreeRTOS and Kinetis MKL16Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-wait-in-Low-Power-mode-with-FreeRTOS-and-Kinetis-MKL16Z/m-p/887277#M7929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Kinetis MKL16Z&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MCUXpresso IDE v10.2.1 [Build 795] [2018-07-25]&amp;nbsp;&lt;/P&gt;&lt;P&gt;Amazon FreeRTOS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to put the MCU into low power mode.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I go the "power_mode_switch" example to work with my custom board.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am attempting to convert the "power_mode_switch" example to work with FreeRTOS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Around the calls to&amp;nbsp;APP_PowerModeSwitch(), which calls&amp;nbsp;SMC_PreEnterWaitModes() SMC_SetPowerModeWait(SMC), I used portENTER_CRITICAL() and portEXIT_CRITICAL().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;portENTER_CRITICAL(); // stop the RTOS kernel tick timer&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;APP_PowerModeSwitch(SMC_GetPowerModeState(SMC), kAPP_PowerModeWait);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;portEXIT_CRITICAL(); // resume the RTOS kernel tick timer&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;The FreeRTOS APIs did not keep the MCU in low power mode. I am guessing that an interrupt woke the MCU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;I would like to determine which interrupt woke the MCU. Can MCUXpresso catch the interrupt in the debugger?&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;The &lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;EM style="font-weight: 400;"&gt;&lt;STRONG&gt;FreeRTOS docs do't cover this problem.&lt;/STRONG&gt;&amp;nbsp;&lt;/EM&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;Is there a "correct way" to do this in FreeRTOS?&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2019 20:14:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-wait-in-Low-Power-mode-with-FreeRTOS-and-Kinetis-MKL16Z/m-p/887277#M7929</guid>
      <dc:creator>bgraham</dc:creator>
      <dc:date>2019-02-06T20:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to wait in Low Power mode with FreeRTOS and Kinetis MKL16Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-wait-in-Low-Power-mode-with-FreeRTOS-and-Kinetis-MKL16Z/m-p/887278#M7930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have working solution.&lt;/P&gt;&lt;P&gt;I added a&amp;nbsp;vApplicationIdleHook() that checks a global variable, and if set, it calls&amp;nbsp;APP_PowerModeSwitch().&lt;/P&gt;&lt;P&gt;When an interrupt like the FreeRTOS system tick wakes MCU, the state of a user button is checked.&lt;/P&gt;&lt;P&gt;If pressed, the task that requested low power mode is sent an event, so that it wakes up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2019 16:25:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-wait-in-Low-Power-mode-with-FreeRTOS-and-Kinetis-MKL16Z/m-p/887278#M7930</guid>
      <dc:creator>bgraham</dc:creator>
      <dc:date>2019-02-07T16:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to wait in Low Power mode with FreeRTOS and Kinetis MKL16Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-wait-in-Low-Power-mode-with-FreeRTOS-and-Kinetis-MKL16Z/m-p/887279#M7931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for sharing this good idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 15:41:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-to-wait-in-Low-Power-mode-with-FreeRTOS-and-Kinetis-MKL16Z/m-p/887279#M7931</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2019-02-18T15:41:32Z</dc:date>
    </item>
  </channel>
</rss>

