<?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: KL82 MCUExpresso USB Intermittent Failure in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KL82-MCUExpresso-USB-Intermittent-Failure/m-p/714302#M7614</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I edited&amp;nbsp;the Freescale drivers- fsl_clock.c in the same lines I cited in the above post, and stepping through it I saw a reference to error e9878 about clock issues, so I increased all the delay times and added delays *everywhere* in that function to try and make it work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing seemed to work, but immediately after that I added a countdown to that empty while loop so that it would return kStatus_Fail after 1500 iterations or something, and now it never fails at all! I'm not sure if because an empty block is UDB or if it fails and then tries again...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I suppose we can mark this as solved but I would appreciate some comment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using arm-none-eabi-gcc&amp;nbsp;4.9 btw (I know it's old- I'm lazy).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Sep 2017 05:08:53 GMT</pubDate>
    <dc:creator>apikul</dc:creator>
    <dc:date>2017-09-27T05:08:53Z</dc:date>
    <item>
      <title>KL82 MCUExpresso USB Intermittent Failure</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KL82-MCUExpresso-USB-Intermittent-Failure/m-p/714301#M7613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I have a FRDM board and a custom KL82 board that I just soldered up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the CDC_VCOM demo from MCUExpresso.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I check `lsusb`, and I notice that NXP Semiconductors device only enumerates, on either device, about 1/3 of the time. The Freescale bootloader enumerates each time, however.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm going to start stepping through the function and learning their framework. I suspect it has something to do with the oscillator stabilizing? I'm not sure though. I put a bitbanged square wave as a test program along with the CDC_VCOM and I noticed that when it does not enumerate, it doesn't seem to be in the main loop either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has any suggestions on where to look, that would be friendly &lt;SPAN class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;&lt;LI-EMOJI id="lia_grinning-face-with-smiling-eyes" title=":grinning_face_with_smiling_eyes:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt; I'll let you know how it goes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps, if gdb is any help, it seems to be hanging here:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;┌──&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;home&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;ajp&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;mcuexpresso_examples&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;cdc_vcom&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;drivers&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;fsl_clock&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;c──────────────────┐
│&lt;SPAN class="number token"&gt;1670&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
│&lt;SPAN class="number token"&gt;1671&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
│&lt;SPAN class="number token"&gt;1672&lt;/SPAN&gt; 
│&lt;SPAN class="number token"&gt;1673&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Wait for MCG_S[CLKST] and MCG_S[IREFST]. */&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1674&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MCG&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;S &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MCG_S_IREFST_MASK &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; MCG_S_CLKST_MASK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt;
│&lt;SPAN class="number token"&gt;1675&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MCG_S_IREFST&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kMCG_FllSrcExternal&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;MCG_S_CLKST&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kMCG_ClkOutStatExt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
│&lt;SPAN class="number token"&gt;1676&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
│&lt;SPAN class="number token"&gt;1677&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Sep 2017 20:27:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KL82-MCUExpresso-USB-Intermittent-Failure/m-p/714301#M7613</guid>
      <dc:creator>apikul</dc:creator>
      <dc:date>2017-09-26T20:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: KL82 MCUExpresso USB Intermittent Failure</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KL82-MCUExpresso-USB-Intermittent-Failure/m-p/714302#M7614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I edited&amp;nbsp;the Freescale drivers- fsl_clock.c in the same lines I cited in the above post, and stepping through it I saw a reference to error e9878 about clock issues, so I increased all the delay times and added delays *everywhere* in that function to try and make it work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing seemed to work, but immediately after that I added a countdown to that empty while loop so that it would return kStatus_Fail after 1500 iterations or something, and now it never fails at all! I'm not sure if because an empty block is UDB or if it fails and then tries again...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I suppose we can mark this as solved but I would appreciate some comment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using arm-none-eabi-gcc&amp;nbsp;4.9 btw (I know it's old- I'm lazy).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 05:08:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KL82-MCUExpresso-USB-Intermittent-Failure/m-p/714302#M7614</guid>
      <dc:creator>apikul</dc:creator>
      <dc:date>2017-09-27T05:08:53Z</dc:date>
    </item>
  </channel>
</rss>

