AnsweredAssumed Answered

FTM crash on init, on MK20DX256VLK10

Question asked by Kris Bird on Dec 6, 2015
Latest reply on Dec 6, 2015 by Alice_Yang

I'm new to the Kinetis series, but not to microcontrollers in general.


I seem to be finding it really hard to achieve 'stable' settings in modules. i.e. configurations which don't immediately hard fault or "UsageFault"


For example...


Screen Shot 2015-12-06 at 12.47.28.png


The FTM setup seems pretty basic


Screen Shot 2015-12-06 at 12.47.51.png


With 3 channels set up for the R G B diodes of an RGBLED


Screen Shot 2015-12-06 at 12.47.58.png



The crash happens on the very first line of the FTM0_Init....


Screen Shot 2015-12-06 at 12.47.37.png



I have another demo project based on a different chip model  with so far as I can tell identical FTM settings...  The generated code for that one is different:-


void FTM0_Init(void)


  /* SIM_SCGC6: FTM0=1 */


  (void)(FTM0_SC == 0U);               /* Dummy read of the FTM0_SC register to clear the interrupt flag */





Am I missing something?  Should I expect these models to be this unstable?


I had another case where the UI didn't seem to "save" the changes I was making in the KSDK component...  i.e. if I Generated Code right away, it worked.. but if I went back to the component, the change would be lost, and Generating Code again would give me something incorrect (which crashed)