FTM crash on init, on MK20DX256VLK10

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FTM crash on init, on MK20DX256VLK10

379 Views
epicedium
Contributor II

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...

 

111952_111952.pngScreen Shot 2015-12-06 at 12.47.28.png

 

The FTM setup seems pretty basic

 

112301_112301.pngScreen Shot 2015-12-06 at 12.47.51.png

 

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

 

112302_112302.pngScreen Shot 2015-12-06 at 12.47.58.png

 

 

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

 

112303_112303.pngScreen 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 */

  SIM_SCGC6 |= SIM_SCGC6_FTM0_MASK;

  (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)

 

Kris

Labels (1)
0 Kudos
1 Reply

294 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Kris,

Have you enable the FTM clock ? If not ,please enable it first like this :

/* SIM_SCGC6: FTM0=1 */

  SIM_SCGC6 |= SIM_SCGC6_FTM0_MASK;

And if it still can not work well , please tell me the version of your KDS , and send your project to me ,

i will  check the problem for you .

Hope it helps

Alice

0 Kudos