<?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>Kinetis Software Development KitのトピックRe: USB clock init error</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-clock-init-error/m-p/477124#M4010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your responses. Actually I must work on the current board, so we have not the possibility of adding another crystal.&lt;/P&gt;&lt;P&gt;Changing (brutally) the previous define to 47972352, the composite demo works very well, both Mass Storage and Virtual Com. This is a temporary patch, in the future we'll change the hardware revision.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Dec 2015 11:46:51 GMT</pubDate>
    <dc:creator>mircopizzichini</dc:creator>
    <dc:date>2015-12-17T11:46:51Z</dc:date>
    <item>
      <title>USB clock init error</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-clock-init-error/m-p/477121#M4007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created my project from the USB composite example for TWRK60, using KSDK 1.3.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On my custom board I have a quartz of 32KHz for the RTC (on the EXTAL32) and no oscillator.&lt;/P&gt;&lt;P&gt;Since external clock from the RTC can only be used as a source for the FLL, the MCG is operating in FEE mode, at 48 MHz for the USB (so I've set DMX32 and DRST_DRS bit of MCG_C4 to 1).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UART and peripherals initialization works fine, I've no problems, but during USB initialization (in particular in usb_dev_soc_init function) I have:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;/* USB clock divider */ src=CLOCK_SYS_GetUsbfsSrc(usb_instance); switch(src) { &amp;nbsp; case kClockUsbfsSrcExt: &amp;nbsp;&amp;nbsp;&amp;nbsp; ret = USBERR_BAD_STATUS; &amp;nbsp;&amp;nbsp;&amp;nbsp; break; &amp;nbsp; case kClockUsbfsSrcPllFllSel: &amp;nbsp;&amp;nbsp;&amp;nbsp; freq = CLOCK_SYS_GetPllFllClockFreq(); &amp;nbsp;&amp;nbsp;&amp;nbsp; ret = USB_OK; &amp;nbsp;&amp;nbsp;&amp;nbsp; switch(freq) &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 120000000U: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLOCK_SYS_SetUsbfsDiv(usb_instance, 4, 1); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 96000000U: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLOCK_SYS_SetUsbfsDiv(usb_instance, 1, 0); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 72000000U: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLOCK_SYS_SetUsbfsDiv(usb_instance, 2, 1); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 48000000U: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLOCK_SYS_SetUsbfsDiv(usb_instance, 0, 0); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; default: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret = USBERR_BAD_STATUS; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break; &amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp; break; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable &lt;EM&gt;freq&lt;/EM&gt; is obtained from the ext clock (32768) multiplied by an FLL factor (1464 as reported in the datasheet), so its value is 32768*1464 = 47972352.&lt;/P&gt;&lt;P&gt;This value could never be identical to 48000000, so it always returns an error!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What can I do? I should replace these macros with the real values?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Dec 2015 16:29:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-clock-init-error/m-p/477121#M4007</guid>
      <dc:creator>mircopizzichini</dc:creator>
      <dc:date>2015-12-10T16:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: USB clock init error</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-clock-init-error/m-p/477122#M4008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello mircopizzichini:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The USB module is not expected to work with the FLL oscillator (FEE mode), because it is not stable enough to meet the jitter specification. There are some discussions in the community talking about this subject:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/381355"&gt;Problems with USB running off IRC48&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/320608"&gt;Kinetis KL26xx - USB clock (48 MHz) from 32.768 KHz crystal?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/359652"&gt;Can the L26Z with 32Khz Xtal generate a clock for USB MSB Device&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you need an external crystal and use the PEE mode. Some of the latest Kinetis MCUs have an internal 48 MHz Internal Reference Clock for USB Device mode, for example the &lt;STRONG&gt;K64&lt;/STRONG&gt; family or the &lt;STRONG&gt;K22FN512/256 (120 MHz)&lt;/STRONG&gt;.&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>Fri, 11 Dec 2015 00:45:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-clock-init-error/m-p/477122#M4008</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-12-11T00:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: USB clock init error</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-clock-init-error/m-p/477123#M4009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or use a dedicated 48MHz clock input on the USB_CLKIN pin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2015 00:48:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-clock-init-error/m-p/477123#M4009</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-12-11T00:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: USB clock init error</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-clock-init-error/m-p/477124#M4010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your responses. Actually I must work on the current board, so we have not the possibility of adding another crystal.&lt;/P&gt;&lt;P&gt;Changing (brutally) the previous define to 47972352, the composite demo works very well, both Mass Storage and Virtual Com. This is a temporary patch, in the future we'll change the hardware revision.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 11:46:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/USB-clock-init-error/m-p/477124#M4010</guid>
      <dc:creator>mircopizzichini</dc:creator>
      <dc:date>2015-12-17T11:46:51Z</dc:date>
    </item>
  </channel>
</rss>

