AnsweredAssumed Answered

TWR-K20D50M crashes on set MCG_C1 in __pe_initialize_hardware()

Question asked by Thomas Dowad on May 7, 2013
Latest reply on May 13, 2013 by Thomas Dowad

I have just received the tower board and the demos all worked fine. I created an MQX 4.0 project with the GPIO example. I made no modification to the example, and compiled it, then ran debugger. The file apparently downloaded successfully. When I single step the code dies in the section where  MCG registers are set. I have tried running through this code (by putting a breakpoint later) and it still crashes. It will hang on the line that sets MCG_C1 to 0x98, which apparently selects the external reference clock.


Another person had the same problem with the same board (another thread here), it was never resolved apparently. Presumably this code is switching from internal oscillator to the external 8 MHz resonator. I look at the board and see that resonator circuit is located 1/2" from the MCU. That is not good practice. So maybe these oscillators are dodgy?


On the other hand, the pre-programmed demo worked. But I don't know if the demo used the resonator or the internal oscillator.


So what to do? Get out the app note "How to Change Default Clock Settings in Kinetis BSPs". Written for MQX 3.8. Does it still apply? I'm afraid I am having trouble making sense of these step-by-step procedure. Because it is showing a directory structure that apparently is different on MQX 4.0.


I've been griping quite a lot lately about how all of these tools are out-of-sync. You can't update the OS, and not update all the docs that are OS-dependent. You can't update CW and not bring all related docs up to date. Same for the examples. Otherwise things devolve into confusion, and that is more-or-less where things are at the moment.


There is a guy who made a board based on this same K20 chip, and I installed that system today, along with his Arduino libraries, and USB drivers, and the lot. And it all worked , first time, out of the box, and took my about 20 minutes to have that board up and running my code. That's one guy, in his basement, with a budget measured in 10's of thousands (I believe it was a kickstarter project).


So why is it that a corporation of the size of Freescale cannot do the same? Come on boys, Americans used to be proud of producing the best in the world.


The chips seem fine, the docs seem pretty good, but the tools are all out of sync and someone just needs to work through fixing this mess. You're supposed to test and debug _before_ you release the product. Otherwise it isn't a product, it's a prototype.