<?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: TWR-K60N512 and KSDK Demo Apps in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/TWR-K60N512-and-KSDK-Demo-Apps/m-p/1416081#M62472</link>
    <description>&lt;P&gt;Hello, I don't know how stable is this solution but it helped me to get my code running. The problem is that&amp;nbsp;MCG_C7_OSCSEL_VAL appears in the code not only one time. After fixing the clock initialization I got a problem with the UART initialization.&lt;/P&gt;&lt;P&gt;The TWR-K60N512, as I know, has some old Kinetis MCU. My board has revision D and uses the PK60N512VMD100 (Mask set 0M33Z). This MCU just doesn't have register MCG_C7. I expect that you use the same MCU. The best solution is maybe to switch to the&amp;nbsp;&lt;SPAN&gt;TWR-K60D100M with newer MCU.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This Application Note explains the problem&amp;nbsp;&lt;A href="https://www.nxp.com/docs/en/application-note/AN4526.pdf" target="_blank"&gt;(https://www.nxp.com/docs/en/application-note/AN4526.pdf&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stnslv_0-1645196922348.png" style="width: 733px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/171072i4D833D2AE4737EDD/image-dimensions/733x176?v=v2" width="733" height="176" role="button" title="stnslv_0-1645196922348.png" alt="stnslv_0-1645196922348.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;stnslv_0-1645196922348.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stnslv_1-1645196982013.png" style="width: 726px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/171073i40B797A12B14BEC5/image-dimensions/726x234?v=v2" width="726" height="234" role="button" title="stnslv_1-1645196982013.png" alt="stnslv_1-1645196982013.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;stnslv_1-1645196982013.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Feb 2022 15:19:42 GMT</pubDate>
    <dc:creator>stnslv</dc:creator>
    <dc:date>2022-02-18T15:19:42Z</dc:date>
    <item>
      <title>TWR-K60N512 and KSDK Demo Apps</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/TWR-K60N512-and-KSDK-Demo-Apps/m-p/750735#M45751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to get some KSDK demo apps up and running on my TWR-K60N512 tower stack (together with TWR-SER). Used the online configurator tool to generate the basic KSDK framework for the TWR-K60D100M (which I assume is the correct choice as the TWR-K60N512 option was not available to me).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When debugging&amp;nbsp;any&amp;nbsp;demo application, a hard fault occurs when calling the BOARD_BootClockRUN function, more specifically in the&amp;nbsp;CLOCK_SetExternalRefClkConfig call within the CLOCK_BootToPeeMode function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I know, the tower stack is configured correctly (50MHz EXTAL connected to CLKIN0 on elevator for ethernet) and all other jumpers set to their defaults.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone suggest what I'm missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jan 2018 12:18:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/TWR-K60N512-and-KSDK-Demo-Apps/m-p/750735#M45751</guid>
      <dc:creator>weblar</dc:creator>
      <dc:date>2018-01-24T12:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K60N512 and KSDK Demo Apps</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/TWR-K60N512-and-KSDK-Demo-Apps/m-p/750736#M45752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so I've managed to work around the issue - I've modified the following function and&amp;nbsp;everything seems to work as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;status_t CLOCK_SetExternalRefClkConfig(mcg_oscsel_t oscsel)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; bool needDelay;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; uint32_t i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#if (defined(MCG_CONFIG_CHECK_PARAM) &amp;amp;&amp;amp; MCG_CONFIG_CHECK_PARAM)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; /* If change MCG_C7[OSCSEL] and external reference clock is system clock source, return error. */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; if ((MCG_C7_OSCSEL_VAL != oscsel) &amp;amp;&amp;amp; (!(MCG-&amp;gt;S &amp;amp; MCG_S_IREFST_MASK)))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; return kStatus_MCG_SourceUsed;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#endif /* MCG_CONFIG_CHECK_PARAM */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;// #######&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;// FIX - RETURN EARLY AS THE FOLLOWING CAUSES A HARD FAULT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;// #######&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;return kStatus_Success;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;if (MCG_C7_OSCSEL_VAL != oscsel)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; // If change OSCSEL, need to delay, ERR009878.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; needDelay = true;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; needDelay = false;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;MCG-&amp;gt;C7 = (MCG-&amp;gt;C7 &amp;amp; ~MCG_C7_OSCSEL_MASK) | MCG_C7_OSCSEL(oscsel);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; if (kMCG_OscselOsc == oscsel)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; if (MCG-&amp;gt;C2 &amp;amp; MCG_C2_EREFS_MASK)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; while (!(MCG-&amp;gt;S &amp;amp; MCG_S_OSCINIT0_MASK))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;if (needDelay)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; /* ERR009878 Delay at least 50 micro-seconds for external clock change valid. */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; i = 1500U;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; while (i--)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; __NOP();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;return kStatus_Success;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jan 2018 17:31:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/TWR-K60N512-and-KSDK-Demo-Apps/m-p/750736#M45752</guid>
      <dc:creator>weblar</dc:creator>
      <dc:date>2018-01-24T17:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K60N512 and KSDK Demo Apps</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/TWR-K60N512-and-KSDK-Demo-Apps/m-p/1416081#M62472</link>
      <description>&lt;P&gt;Hello, I don't know how stable is this solution but it helped me to get my code running. The problem is that&amp;nbsp;MCG_C7_OSCSEL_VAL appears in the code not only one time. After fixing the clock initialization I got a problem with the UART initialization.&lt;/P&gt;&lt;P&gt;The TWR-K60N512, as I know, has some old Kinetis MCU. My board has revision D and uses the PK60N512VMD100 (Mask set 0M33Z). This MCU just doesn't have register MCG_C7. I expect that you use the same MCU. The best solution is maybe to switch to the&amp;nbsp;&lt;SPAN&gt;TWR-K60D100M with newer MCU.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This Application Note explains the problem&amp;nbsp;&lt;A href="https://www.nxp.com/docs/en/application-note/AN4526.pdf" target="_blank"&gt;(https://www.nxp.com/docs/en/application-note/AN4526.pdf&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stnslv_0-1645196922348.png" style="width: 733px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/171072i4D833D2AE4737EDD/image-dimensions/733x176?v=v2" width="733" height="176" role="button" title="stnslv_0-1645196922348.png" alt="stnslv_0-1645196922348.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;stnslv_0-1645196922348.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stnslv_1-1645196982013.png" style="width: 726px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/171073i40B797A12B14BEC5/image-dimensions/726x234?v=v2" width="726" height="234" role="button" title="stnslv_1-1645196982013.png" alt="stnslv_1-1645196982013.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;stnslv_1-1645196982013.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 15:19:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/TWR-K60N512-and-KSDK-Demo-Apps/m-p/1416081#M62472</guid>
      <dc:creator>stnslv</dc:creator>
      <dc:date>2022-02-18T15:19:42Z</dc:date>
    </item>
  </channel>
</rss>

