<?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 KDSK CLOCK_SYS_SetConfiguration() no uptade  ticks in _time_delay() MQX in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KDSK-CLOCK-SYS-SetConfiguration-no-uptade-ticks-in-time-delay/m-p/452337#M3136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;I create e new project for a custom board using KSDK + PEx and then I add MQX like this Training: &lt;A _jive_internal="true" data-containerid="11347" data-containertype="14" data-objectid="104811" data-objecttype="102" href="https://community.nxp.com/docs/DOC-104811"&gt;Training Class: MQX RTOS for Kinetis SDK, Kinetis Design Studio (6 labs, including TCP/IP)&lt;/A&gt; &lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Looking the way HAL and FSL work I think is not any more necessary create a BSP. PEx take care of the hardware configuration. So I went in this way.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Then I create tasks OK, RS232 for debug is Ok, interrupts for GPIO when MCU is wake and for LLWU when is in STOP and everithing is working.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;But I need to change my clock from run (48Mhz in startup) to &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;low power to (4Mhz and stop in LLS)&amp;nbsp; &lt;/SPAN&gt;mode and I note when I change my clock using:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;CLOCK_SYS_SetConfiguration(&amp;amp;clockMan1_InitConfig1);&amp;nbsp; // Will run in 4Mhz for Low power mode&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;the _time_delay()&amp;nbsp; function from MQX not work as expectec taking much more time to execute, I think because the clock #1 I´m running in lower clock.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;then I call:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;POWER_SYS_SetMode(1U, kPowerManagerPolicyAgreement);&amp;nbsp;&amp;nbsp; // put in STOP mode LLS&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;And is in LLS just fine.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;My question is:&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;How can I tell to MQX that the clock changed to calculate the _time_delay()&amp;nbsp; correctly? I know that is in _bsp_pre_init() that MQX receive the clock config and make the adjustments, but when I change clock I need to update, I try recall _bsp_pre_init() or some internal function that bsp_pre/_init calls&amp;nbsp; and the _time_delay() get work, but I not some other strange behaviors. Some one have a good way to do this?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;KSDK 1.2&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;MQX for KSDK&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2015 12:43:44 GMT</pubDate>
    <dc:creator>voider</dc:creator>
    <dc:date>2015-09-15T12:43:44Z</dc:date>
    <item>
      <title>KDSK CLOCK_SYS_SetConfiguration() no uptade  ticks in _time_delay() MQX</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KDSK-CLOCK-SYS-SetConfiguration-no-uptade-ticks-in-time-delay/m-p/452337#M3136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;I create e new project for a custom board using KSDK + PEx and then I add MQX like this Training: &lt;A _jive_internal="true" data-containerid="11347" data-containertype="14" data-objectid="104811" data-objecttype="102" href="https://community.nxp.com/docs/DOC-104811"&gt;Training Class: MQX RTOS for Kinetis SDK, Kinetis Design Studio (6 labs, including TCP/IP)&lt;/A&gt; &lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Looking the way HAL and FSL work I think is not any more necessary create a BSP. PEx take care of the hardware configuration. So I went in this way.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Then I create tasks OK, RS232 for debug is Ok, interrupts for GPIO when MCU is wake and for LLWU when is in STOP and everithing is working.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;But I need to change my clock from run (48Mhz in startup) to &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;low power to (4Mhz and stop in LLS)&amp;nbsp; &lt;/SPAN&gt;mode and I note when I change my clock using:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;CLOCK_SYS_SetConfiguration(&amp;amp;clockMan1_InitConfig1);&amp;nbsp; // Will run in 4Mhz for Low power mode&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;the _time_delay()&amp;nbsp; function from MQX not work as expectec taking much more time to execute, I think because the clock #1 I´m running in lower clock.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;then I call:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;POWER_SYS_SetMode(1U, kPowerManagerPolicyAgreement);&amp;nbsp;&amp;nbsp; // put in STOP mode LLS&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;And is in LLS just fine.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;My question is:&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;How can I tell to MQX that the clock changed to calculate the _time_delay()&amp;nbsp; correctly? I know that is in _bsp_pre_init() that MQX receive the clock config and make the adjustments, but when I change clock I need to update, I try recall _bsp_pre_init() or some internal function that bsp_pre/_init calls&amp;nbsp; and the _time_delay() get work, but I not some other strange behaviors. Some one have a good way to do this?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;KSDK 1.2&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;MQX for KSDK&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 12:43:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KDSK-CLOCK-SYS-SetConfiguration-no-uptade-ticks-in-time-delay/m-p/452337#M3136</guid>
      <dc:creator>voider</dc:creator>
      <dc:date>2015-09-15T12:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: KDSK CLOCK_SYS_SetConfiguration() no uptade  ticks in _time_delay() MQX</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KDSK-CLOCK-SYS-SetConfiguration-no-uptade-ticks-in-time-delay/m-p/452338#M3137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello voider:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case you need to use the Clock Manager notification framework to notify the low level drivers when the clock changes. To do that you have the API &lt;STRONG&gt;CLOCK_SYS_UpdateConfiguration()&lt;/STRONG&gt; and use clock callbacks as discussed in &lt;A _jive_internal="true" href="https://community.nxp.com/message/523984#523984"&gt;&lt;STRONG&gt;this&lt;/STRONG&gt;&lt;/A&gt; thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created an example &lt;STRONG&gt;[MQX_KSDK + PE]&lt;/STRONG&gt; project with &lt;STRONG&gt;KDS v3.0.0&lt;/STRONG&gt; for the &lt;STRONG&gt;FRDM-K64F&lt;/STRONG&gt; so you can take it as reference. In the project there are callbacks to adjust the UART (debug console) and SysTick timer (MQX RTOS tick) frequencies. If you connect the terminal at a 115200 baud then you will see how a message is printed BEFORE and AFTER changing frequency. Also the green LED blinks at the same frequency before and after the clock change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a different evaluation board then I can replicate it, just let me know.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards!,&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 02:11:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KDSK-CLOCK-SYS-SetConfiguration-no-uptade-ticks-in-time-delay/m-p/452338#M3137</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-09-29T02:11:49Z</dc:date>
    </item>
  </channel>
</rss>

