<?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>MCUXpresso Config ToolsのトピックRe: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
    <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1400968#M1302</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have reviewed your issue and the problem is in the implementation of the following CLOCK_GetFlexCommClkFreq() function:&lt;/P&gt;
&lt;P&gt;uint32_t CLOCK_GetFlexCommClkFreq(uint32_t id)&lt;BR /&gt;{&lt;BR /&gt;uint32_t freq = 0U;&lt;BR /&gt;uint32_t temp;&lt;/P&gt;
&lt;P&gt;freq = CLOCK_GetFlexCommInputClock(id);&lt;BR /&gt;temp = SYSCON-&amp;gt;FLEXFRGXCTRL[id] &amp;amp; SYSCON_FLEXFRG0CTRL_MULT_MASK;&lt;BR /&gt;return freq / (1U + (temp) / ((SYSCON-&amp;gt;FLEXFRGXCTRL[id] &amp;amp; SYSCON_FLEXFRG0CTRL_DIV_MASK) + 1U));&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;The calculation of return expression is based on integer arithmetic and therefore the fractional divider is always 1. The implementation of the function must be fixed. I have already reported the issue.&lt;/P&gt;
&lt;P&gt;The definitions of the clock frequency of all top level clock outputs of the clock model have been already supported for latest i.MX RT MCUs. We are going to support this feature for other MCUs in a next release.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Marek Neuzil&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jan 2022 13:42:05 GMT</pubDate>
    <dc:creator>marek_neuzil</dc:creator>
    <dc:date>2022-01-18T13:42:05Z</dc:date>
    <item>
      <title>Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1378357#M1274</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;for using the serial interface, I configured Flexcom 0 clock to 23.97 MHz, see here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="danielholala_0-1638210856490.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/163467i9BED5A31CAC76852/image-size/large?v=v2&amp;amp;px=999" role="button" title="danielholala_0-1638210856490.png" alt="danielholala_0-1638210856490.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now to initialize USART0, I think I should call&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;USART_Init ( USART_Type * base,&lt;BR /&gt;const usart_config_t * config,&lt;BR /&gt;uint32_t &lt;STRONG&gt;srcClock_Hz&lt;/STRONG&gt;&lt;BR /&gt;) ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The last parameter is "&lt;SPAN&gt;USART clock source frequency in HZ." (see &lt;A href="https://mcuxpresso.nxp.com/api_doc/dev/2165/a00052.html#ga2aeb4e11fdf0eb515d090865ffcf2ba2" target="_self"&gt;docs&lt;/A&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I guess I should pass FXCOMCLK0 (in Hz) to correctly initialize the interface.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You don't want me to type this value in, do you? That would be 🤦‍&lt;LI-EMOJI id="lia_male-sign" title=":male_sign:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So how do I programatically retrieve this value?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;CLOCK_GetFlexCommClkFreq(0);&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but this resulted in 330 033 which is clearly not the value I need (what is this function returning, anyway?).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers&lt;BR /&gt;Dan&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 18:46:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1378357#M1274</guid>
      <dc:creator>danielholala</dc:creator>
      <dc:date>2021-11-29T18:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1378521#M1275</link>
      <description>&lt;P&gt;Hi Daniel&lt;/P&gt;
&lt;P&gt;What's your chip part number?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 03:04:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1378521#M1275</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2021-11-30T03:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1378731#M1276</link>
      <description>&lt;P&gt;It's a microcontroller from the LPC55xx family, currently LPC55S26JBD64.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 08:19:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1378731#M1276</guid>
      <dc:creator>danielholala</dc:creator>
      <dc:date>2021-11-30T08:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1378798#M1277</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For example, if you use Flexcomm0 USART0, USART0 is clocked by Flexcomm0 clock by default.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can change the clock source to 32K RTC clock by setting MODE32K as below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_0-1638263442038.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/163560i77F5246371634E22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_0-1638263442038.png" alt="ZhangJennie_0-1638263442038.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 09:14:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1378798#M1277</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2021-11-30T09:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1378811#M1278</link>
      <description>&lt;P&gt;Dear ZhangJennie,&lt;/P&gt;&lt;P&gt;Thank you for your reply, however, I don't see how your answer relates to my question. You basically suggest that I scrap the tool and do the clock configuration by registers.&lt;/P&gt;&lt;P&gt;That's bewildering.&lt;/P&gt;&lt;P&gt;I assume that NXP has invested a lot of resources (money, people) to provide the community with&amp;nbsp;MCUXpresso Config Tools. Of course, there will be different opinions on using tools for configuring a microcontroller. I guess that some engineers prefer to setup all registers on their on just using the datasheet and some basic structs. Other engineers use the SDK and embrace the availability of configuration tools provided through the manufacturer.&lt;/P&gt;&lt;P&gt;With that said, I gave it a try. I used the clocks tools as I think it nicely visualizes the setup and is self-sufficient (quite independent from the remaining configuration and code). I configured the FXCOM0_clock as reproduced in my first post.&lt;/P&gt;&lt;P&gt;Now, how do I continue from there?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 09:27:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1378811#M1278</guid>
      <dc:creator>danielholala</dc:creator>
      <dc:date>2021-11-30T09:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1379306#M1279</link>
      <description>&lt;P&gt;In my previous reply. I tried to tell you USART clock source selection from register, root level.&lt;/P&gt;
&lt;P&gt;If configure tool, it is easy, Just select FXCOM0 for clock source.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_0-1638325026263.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/163679i3337560E7FD4C580/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_0-1638325026263.png" alt="ZhangJennie_0-1638325026263.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 02:19:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1379306#M1279</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2021-12-01T02:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1379521#M1280</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;SPAN&gt;Jun Zhang,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your response.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;From you response I take it that there's no way to retrieve the Flexcom0 clock frequency that has been configured using the Clocks tool.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Instead, you suggest to configure the Flexcom/USART component using Peripherals tools. The Peripheral tools obviously retrieves the correct clock frequency from Clocks tool. Peripherals tool also adds code to initialize USART. The code is based on "fsl_usart_cmsis.h". It's based on ARM's CMSIS API. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I continue from there with the NXP SDK API?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 08:34:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1379521#M1280</guid>
      <dc:creator>danielholala</dc:creator>
      <dc:date>2021-12-01T08:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1381077#M1281</link>
      <description>&lt;P&gt;HI&lt;/P&gt;
&lt;P&gt;There is defect in clock get frequency functions. With below code, change temp type as float.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;uint32_t CLOCK_GetFlexCommClkFreq(uint32_t id)&lt;BR /&gt;{&lt;BR /&gt;uint32_t freq = 0U;&lt;BR /&gt;float temp;&lt;/P&gt;
&lt;P&gt;freq = CLOCK_GetFlexCommInputClock(id);&lt;BR /&gt;temp = (SYSCON-&amp;gt;FLEXFRGXCTRL[id] &amp;amp; SYSCON_FLEXFRG0CTRL_MULT_MASK) &amp;gt;&amp;gt; 8;&lt;BR /&gt;return (uint32_t)(freq / (1U + ((temp) / ((SYSCON-&amp;gt;FLEXFRGXCTRL[id] &amp;amp; SYSCON_FLEXFRG0CTRL_DIV_MASK) + 1U))));&lt;BR /&gt;}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You will also find in peripheral.h,&amp;nbsp;FLEXCOMM0_CLOCK_SOURCE&amp;nbsp; automatically changes to the right flexcomm0 clock source after code generation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* Definition of the clock source frequency */&lt;BR /&gt;#define FLEXCOMM0_CLOCK_SOURCE 47407407UL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a nice day,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 07:40:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1381077#M1281</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2021-12-03T07:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1381151#M1282</link>
      <description>&lt;P&gt;That code change fixed&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;CLOCK_GetFlexCommClkFreq()&lt;/FONT&gt;&amp;nbsp;and thus my&lt;/SPAN&gt;&amp;nbsp;issue. Thank you for your support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a quick note regarding your comment regarding "&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;FLEXCOMM0_CLOCK_SOURCE&lt;/FONT&gt;".&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I could not find this definition in any of my projects. What I found was "&lt;FONT face="courier new,courier"&gt;FLEXCOMM0_CLOCK_SOURCE_FREQ&lt;/FONT&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, this definition is only available after one uses the Peripherals tools to configure, e.g., USART0, see screenshot. In other words, if one does not use Peripherals tools this definition is not available. Just a thought, maybe the clocks tool should add this definition instead of the Peripherals tools.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="danielholala_0-1638522409000.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/164018i7CE03790FE73D7C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="danielholala_0-1638522409000.png" alt="danielholala_0-1638522409000.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 09:07:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1381151#M1282</guid>
      <dc:creator>danielholala</dc:creator>
      <dc:date>2021-12-03T09:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1381221#M1283</link>
      <description>&lt;P&gt;Maybe we use different versions. anyway, I think they are same thing despite the name. this is generated by peripheral tools&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_0-1638527648048.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/164024i278F377D6A600B88/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_0-1638527648048.png" alt="ZhangJennie_0-1638527648048.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 10:34:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1381221#M1283</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2021-12-03T10:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1381308#M1284</link>
      <description>&lt;P&gt;Thanks for confirming that the definition for clock source frequency is only available after using Peripheral tools.&lt;/P&gt;&lt;P&gt;The name of the definition may well vary over tool version. My versions are as follows:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;MCUXpresso IDE v11.4.1&lt;/LI&gt;&lt;LI&gt;Clocks Tool Version: 8.0.0.202109031454&lt;/LI&gt;&lt;LI&gt;Peripherals Tool Version: 10.0.0.202109031454&lt;/LI&gt;&lt;LI&gt;Pins Tool Version: 10.0.0.202109031454&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;(extracted from Help &amp;gt; About MCUXpresso IDE)&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 14:36:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1381308#M1284</guid>
      <dc:creator>danielholala</dc:creator>
      <dc:date>2021-12-03T14:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1381327#M1285</link>
      <description>&lt;P&gt;Ok. my version is older.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 15:13:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1381327#M1285</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2021-12-03T15:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1400968#M1302</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have reviewed your issue and the problem is in the implementation of the following CLOCK_GetFlexCommClkFreq() function:&lt;/P&gt;
&lt;P&gt;uint32_t CLOCK_GetFlexCommClkFreq(uint32_t id)&lt;BR /&gt;{&lt;BR /&gt;uint32_t freq = 0U;&lt;BR /&gt;uint32_t temp;&lt;/P&gt;
&lt;P&gt;freq = CLOCK_GetFlexCommInputClock(id);&lt;BR /&gt;temp = SYSCON-&amp;gt;FLEXFRGXCTRL[id] &amp;amp; SYSCON_FLEXFRG0CTRL_MULT_MASK;&lt;BR /&gt;return freq / (1U + (temp) / ((SYSCON-&amp;gt;FLEXFRGXCTRL[id] &amp;amp; SYSCON_FLEXFRG0CTRL_DIV_MASK) + 1U));&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;The calculation of return expression is based on integer arithmetic and therefore the fractional divider is always 1. The implementation of the function must be fixed. I have already reported the issue.&lt;/P&gt;
&lt;P&gt;The definitions of the clock frequency of all top level clock outputs of the clock model have been already supported for latest i.MX RT MCUs. We are going to support this feature for other MCUs in a next release.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Marek Neuzil&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jan 2022 13:42:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1400968#M1302</guid>
      <dc:creator>marek_neuzil</dc:creator>
      <dc:date>2022-01-18T13:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Get Flexcom clock (i.e., FXCOM0_clock) in my program?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1595725#M1612</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;just installed MCUXpresso IDE 11.7.0 and &lt;STRONG&gt;SDK 2.13.0&lt;/STRONG&gt; (for LPC5528).&lt;/P&gt;&lt;P&gt;This SDK version seems to have &lt;STRONG&gt;fixed this issue&lt;/STRONG&gt; although using different code to retrieve the Flexcom clock:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/* Get FLEXCOMM Clk */
uint32_t CLOCK_GetFlexCommClkFreq(uint32_t id)
{
    uint32_t freq   = 0U;
    uint32_t frgMul = 0U;
    uint32_t frgDiv = 0U;

    freq   = CLOCK_GetFlexCommInputClock(id);
    frgMul = (SYSCON-&amp;gt;FLEXFRGXCTRL[id] &amp;amp; SYSCON_FLEXFRG0CTRL_MULT_MASK) &amp;gt;&amp;gt; 8U;
    frgDiv = SYSCON-&amp;gt;FLEXFRGXCTRL[id] &amp;amp; SYSCON_FLEXFRG0CTRL_DIV_MASK;
    return (uint32_t)(((uint64_t)freq * ((uint64_t)frgDiv + 1ULL)) / (frgMul + frgDiv + 1UL));
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested this code with the following Clock Tools configuration: main clock at 150 MHz (derived from 16 MHz XTAL via PLL0) and Flexcom0 clock derived from main clock divided by 2 (PLL0DIV), multiplied by 256 (FRGCTROL0_MUL), divided by 400 (FRGCTRL0_DIV)&amp;nbsp; = 48 MHz. This function gets the correct result. I prefer this code over the code suggested by&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/13026"&gt;@ZhangJennie&lt;/a&gt;&amp;nbsp;as it does not employ floating point arithmetic.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 15:49:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-Config-Tools/Get-Flexcom-clock-i-e-FXCOM0-clock-in-my-program/m-p/1595725#M1612</guid>
      <dc:creator>danielholala</dc:creator>
      <dc:date>2023-02-08T15:49:10Z</dc:date>
    </item>
  </channel>
</rss>

