AnsweredAssumed Answered

KL24 internal clock and USB?

Question asked by Christopher Mason on Nov 25, 2013
Latest reply on Dec 10, 2013 by Alistair Muir

Should I expect USB target to be functional on a KL24 with the internal reference clock enabled?


I'm trying to port some code that's working on a MK20 to the KL24.  I've made a number of obvious adjustments to the code necessary to get it running (in particular switching bitbanding to BME) and it seems to be correctly ported; I'm not seeing any faults, etc.  The code is from the open source McHck project, with it's USB stack.


In both cases, we're using the internal reference clock and FLL.  In the case of the MK20 this is working fine; the device enumerates and communicates flawlessly.


When I try basically the same code on the KL24 again with the internal clock, the device enumerates, and often connects but immediately disconnects.  Apple's USB Prober reports a number of errors including overruns and stalls.  I can post logs if it would be helpful.


When I enable error interrupts, I see a number of errors:


(gdb) p USB0.errstat

$1 = {{raw = 139 '\213', {{<No data fields>}, piderr = 1 '\001',

      crc5eof = 1 '\001', crc16 = 0 '\000', dfn8 = 1 '\001',

      btoerr = 0 '\000', dmaerr = 0 '\000', _rsvd0 = 0 '\000',

      btserr = 1 '\001'}}}


The KL24 and MK20 are on different board layouts, so it's possible that this is a layout related issue.  If I get confirmation that this should work with the internal oscillator, I'll dig into the layout possibilities.


I had expected these devices to be similar enough for this to not be an issue.