<?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>MCU BootloaderのトピックClock Dividers - Generic bug</title>
    <link>https://community.nxp.com/t5/MCU-Bootloader/Clock-Dividers-Generic-bug/m-p/708016#M561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys, I'm reviewing the Clock Setting for the KBoot v2.0.0 and just found out that the clock dividers are not being correctly set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file to check is the specific clock_config_*.c for the platform you're using.&lt;/P&gt;&lt;P&gt;The function to check is the configure_clocks(), step 9 or 10, around there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example, I'm studying MK64F12 freedom_bootloader project (NXP_Kinetis_Bootloader_2_0_0\targets\MK64F12\kds\freedom_bootloader) and the source file in question is&amp;nbsp;&lt;SPAN&gt;NXP_Kinetis_Bootloader_2_0_0\targets\MK64F12\src\clock_config_MK64F12.c.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Line 163:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SIM-&amp;gt;CLKDIV1 = SIM_CLKDIV1_OUTDIV1(div1 - 1) | SIM_CLKDIV1_OUTDIV1(div1 - 1) | SIM_CLKDIV1_OUTDIV2(div3 - 1) | SIM_CLKDIV1_OUTDIV4(div4 - 1); /* Update system prescalers */&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Three problems there:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;OUTDIV1 is set twice&lt;/LI&gt;&lt;LI&gt;OUTDIV2 is not set (div2 is ignored)&lt;/LI&gt;&lt;LI&gt;div3 is set on OUTDIV2 instead of OUTDIV3&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next example, MK22F51212 freedom_booltoader project (NXP_Kinetis_Bootloader_2_0_0\targets\MK22F51212\kds\freedom_bootloader) and&amp;nbsp;NXP_Kinetis_Bootloader_2_0_0\targets\MK22F51212\src\clock_config_K22F512.c source file. Same problem as before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next example, MK66F18 freedom_bootloader project (NXP_Kinetis_Bootloader_2_0_0\targets\MK66F18\kds\freedom_bootloader) and&amp;nbsp;NXP_Kinetis_Bootloader_2_0_0\targets\MK66F18\src\clock_source_MK66F18.c source file.&lt;/P&gt;&lt;P&gt;Line 155:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SIM-&amp;gt;CLKDIV1 = SIM_CLKDIV1_OUTDIV1(div1 - 1) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SIM_CLKDIV1_OUTDIV2(div2 - 1) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SIM_CLKDIV1_OUTDIV2(div3 - 1) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SIM_CLKDIV1_OUTDIV4(div4 - 1); // Update system prescalers&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;One problem here:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;div3 is set on OUTDIV2 instead of OUTDIV3.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whoever is thinking on using the bootloader, please check carefully this file. This may lead to "weird" problems, like the bootloader only works after a power on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Sep 2017 10:38:23 GMT</pubDate>
    <dc:creator>brunoalbrecht</dc:creator>
    <dc:date>2017-09-19T10:38:23Z</dc:date>
    <item>
      <title>Clock Dividers - Generic bug</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/Clock-Dividers-Generic-bug/m-p/708016#M561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys, I'm reviewing the Clock Setting for the KBoot v2.0.0 and just found out that the clock dividers are not being correctly set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file to check is the specific clock_config_*.c for the platform you're using.&lt;/P&gt;&lt;P&gt;The function to check is the configure_clocks(), step 9 or 10, around there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example, I'm studying MK64F12 freedom_bootloader project (NXP_Kinetis_Bootloader_2_0_0\targets\MK64F12\kds\freedom_bootloader) and the source file in question is&amp;nbsp;&lt;SPAN&gt;NXP_Kinetis_Bootloader_2_0_0\targets\MK64F12\src\clock_config_MK64F12.c.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Line 163:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SIM-&amp;gt;CLKDIV1 = SIM_CLKDIV1_OUTDIV1(div1 - 1) | SIM_CLKDIV1_OUTDIV1(div1 - 1) | SIM_CLKDIV1_OUTDIV2(div3 - 1) | SIM_CLKDIV1_OUTDIV4(div4 - 1); /* Update system prescalers */&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Three problems there:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;OUTDIV1 is set twice&lt;/LI&gt;&lt;LI&gt;OUTDIV2 is not set (div2 is ignored)&lt;/LI&gt;&lt;LI&gt;div3 is set on OUTDIV2 instead of OUTDIV3&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next example, MK22F51212 freedom_booltoader project (NXP_Kinetis_Bootloader_2_0_0\targets\MK22F51212\kds\freedom_bootloader) and&amp;nbsp;NXP_Kinetis_Bootloader_2_0_0\targets\MK22F51212\src\clock_config_K22F512.c source file. Same problem as before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next example, MK66F18 freedom_bootloader project (NXP_Kinetis_Bootloader_2_0_0\targets\MK66F18\kds\freedom_bootloader) and&amp;nbsp;NXP_Kinetis_Bootloader_2_0_0\targets\MK66F18\src\clock_source_MK66F18.c source file.&lt;/P&gt;&lt;P&gt;Line 155:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SIM-&amp;gt;CLKDIV1 = SIM_CLKDIV1_OUTDIV1(div1 - 1) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SIM_CLKDIV1_OUTDIV2(div2 - 1) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SIM_CLKDIV1_OUTDIV2(div3 - 1) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SIM_CLKDIV1_OUTDIV4(div4 - 1); // Update system prescalers&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;One problem here:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;div3 is set on OUTDIV2 instead of OUTDIV3.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whoever is thinking on using the bootloader, please check carefully this file. This may lead to "weird" problems, like the bootloader only works after a power on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2017 10:38:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/Clock-Dividers-Generic-bug/m-p/708016#M561</guid>
      <dc:creator>brunoalbrecht</dc:creator>
      <dc:date>2017-09-19T10:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Clock Dividers - Generic bug</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/Clock-Dividers-Generic-bug/m-p/708017#M562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bruno Albercht,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you for pointing out this code bug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The correct code should be:&lt;/P&gt;&lt;P style="margin: 2.0pt 0in 2.0pt 0in;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;SIM-&amp;gt;CLKDIV1 = SIM_CLKDIV1_OUTDIV1(div1 - 1) | SIM_CLKDIV&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;_OUTDIV2(div&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; - 1) | SIM_CLKDIV1_OUTDIV&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;3&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;(div3 - 1) |&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0in 2.0pt 0in;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_CLKDIV1_OUTDIV4(div4 - 1); /* Update system prescalers */&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0in 2.0pt 0in;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp; Please modify it on your side now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0in 2.0pt 0in;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp; This is the known issue, and the driver will be updated in the future .&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0in 2.0pt 0in;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp; Thanks again!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0in 2.0pt 0in;"&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0in 2.0pt 0in;"&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&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>Wed, 20 Sep 2017 03:28:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/Clock-Dividers-Generic-bug/m-p/708017#M562</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-09-20T03:28:45Z</dc:date>
    </item>
  </channel>
</rss>

