<?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: Error Changing from FEI to FBI with KSDK on FRDM-KL25Z in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Error-Changing-from-FEI-to-FBI-with-KSDK-on-FRDM-KL25Z/m-p/460622#M3391</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ives,&lt;/P&gt;&lt;P&gt;Welcome !:smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Dec 2015 07:22:38 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2015-12-07T07:22:38Z</dc:date>
    <item>
      <title>Error Changing from FEI to FBI with KSDK on FRDM-KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Error-Changing-from-FEI-to-FBI-with-KSDK-on-FRDM-KL25Z/m-p/460619#M3388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a FRDM-KL25Z and I'm trying to change the power mode from FEI to FBI. I want to run on FBI mode with a internal frequency of 4 MHz. I've used the following code to do the job:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;CLOCK_HAL_SetOutDiv1(SIM, 0);&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;CLOCK_HAL_SetOutDiv4(SIM, 4);&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;mcg_mode_error_t mcgModeError = CLOCK_HAL_SetFbiMode(MCG, kMcgDcoRangeSelLow, kMcgIrcFast, 1, NULL);&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that the firmware stops running during the CLOCK_HAL_SetFbiMode function. I've added a breakpoint inside this function and I saw that the problem is in the following line:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_WR_C1(base, (MCG_RD_C1(base) &amp;amp; ~(MCG_C1_CLKS_MASK | MCG_C1_IREFS_MASK))&lt;/P&gt;&lt;P&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; | (MCG_C1_CLKS(kMcgClkOutSrcInternal)&amp;nbsp; /* CLKS = 1 */&lt;/P&gt;&lt;P&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; | MCG_C1_IREFS(kMcgFllSrcInternal))); /* IREFS = 1 */&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realized that if I change the CLOCK_HAL_SetFbiMode function, to force it to write on MCG_C1 register after writing on MCG_C2 register, the firmware works! &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you think there is a problem in CLOCK_HAL_SetFbiMode function?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 19:28:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Error-Changing-from-FEI-to-FBI-with-KSDK-on-FRDM-KL25Z/m-p/460619#M3388</guid>
      <dc:creator>ives</dc:creator>
      <dc:date>2015-12-03T19:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error Changing from FEI to FBI with KSDK on FRDM-KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Error-Changing-from-FEI-to-FBI-with-KSDK-on-FRDM-KL25Z/m-p/460620#M3389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ives,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your question , i have some suggestions :&lt;/P&gt;&lt;P&gt;1) Which version of KSDK do you use ? i recommend you use the latest one ksdk1.3, you can download it in the web.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) If you want use the KSDK APIs configure the clock mode ,i recommend you sue the function "CLOCK_SYS_SetConfiguration()",&lt;/P&gt;&lt;P&gt;it configure the SIM SIM&amp;nbsp; .etc clock module&amp;nbsp; ,it include the function "CLOCK_HAL_SetFbiMode" ,you can find this function here :&lt;/P&gt;&lt;P&gt;Freescale\KSDK_1.3.0\platform\system\src\clock\MKL25Z4\fsl_clock_MKL25Z4.c&lt;/P&gt;&lt;P&gt;(in general , do not directly use the&amp;nbsp; "HAL " functions, these HAL functions are call by the driver fucntions. )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)If you do not want use the ksdk driver,&amp;nbsp; in the file of "system_MKL25z4.c" and "system_MKL25Z4.h" have defined all of the clock mode ,&lt;/P&gt;&lt;P&gt;you can refer to :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/53161i595ADDE6F7DFE026/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;4) You can also use the PE configure the clock , i thin it is easy .&lt;/P&gt;&lt;P&gt;If use the latest version still can not work well,&amp;nbsp; please contact me without any hesitate .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&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;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2015 07:04:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Error-Changing-from-FEI-to-FBI-with-KSDK-on-FRDM-KL25Z/m-p/460620#M3389</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-12-04T07:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error Changing from FEI to FBI with KSDK on FRDM-KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Error-Changing-from-FEI-to-FBI-with-KSDK-on-FRDM-KL25Z/m-p/460621#M3390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Alice! I am using KSDK 1.3. Good advice about the function &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;CLOCK_SYS_SetConfiguration(). Have a great weekend.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2015 15:37:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Error-Changing-from-FEI-to-FBI-with-KSDK-on-FRDM-KL25Z/m-p/460621#M3390</guid>
      <dc:creator>ives</dc:creator>
      <dc:date>2015-12-04T15:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error Changing from FEI to FBI with KSDK on FRDM-KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Error-Changing-from-FEI-to-FBI-with-KSDK-on-FRDM-KL25Z/m-p/460622#M3391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ives,&lt;/P&gt;&lt;P&gt;Welcome !:smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Dec 2015 07:22:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Error-Changing-from-FEI-to-FBI-with-KSDK-on-FRDM-KL25Z/m-p/460622#M3391</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-12-07T07:22:38Z</dc:date>
    </item>
  </channel>
</rss>

