AnsweredAssumed Answered

KL82 MCUExpresso USB Intermittent Failure

Question asked by Andrew Pikul on Sep 26, 2017
Latest reply on Sep 26, 2017 by Andrew Pikul

So I have a FRDM board and a custom KL82 board that I just soldered up.

 

I'm using the CDC_VCOM demo from MCUExpresso.

 

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.

 

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.

 

If anyone has any suggestions on where to look, that would be friendly :-D I'll let you know how it goes.

 

ps, if gdb is any help, it seems to be hanging here:

┌──/home/ajp/mcuexpresso_examples/cdc_vcom/drivers/fsl_clock.c──────────────────┐
1670 }
1671 }
1672
1673 /* Wait for MCG_S[CLKST] and MCG_S[IREFST]. */
>1674 while ((MCG->S & (MCG_S_IREFST_MASK | MCG_S_CLKST_MASK)) !=
1675 (MCG_S_IREFST(kMCG_FllSrcExternal) | MCG_S_CLKST(kMCG_ClkOutStatExt)))
1676 {
1677 }

Outcomes