FTM_Init() crashes

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

FTM_Init() crashes

Jump to solution
1,162 Views
tomolenik
Contributor I

I'm using MCUXepresso, SDK, and configuration tools with a Kinetis FRDM board project. Everything is for the specific board I'm using. I can get the FTM driver examples to run on the board from the same SDK. However, when I make my own project all my FTM_Init functions crash immediately after the line shown in the attached executes. I've double checked my clock and pin configurations which is really the only thing that might be different from the example projects, but I can't find why it is crashing. When I comment out all my FTM sections, the rest of the application runs fine. The only other modules that I'm using in this project are GPIO on one pin, msCAN, PWT, and PIT. Its on a FRDM-KE06Z. Does anyone have any thoughts on where to look for issues?

Line before fault.PNG

0 Kudos
1 Solution
948 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi  Thomas Olenik,

Would you please tell us which FTM module are used?
The FTMx_MODE is not available on FTM0/1.Table 3-33. FTM modules features.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
949 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi  Thomas Olenik,

Would you please tell us which FTM module are used?
The FTMx_MODE is not available on FTM0/1.Table 3-33. FTM modules features.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
948 Views
tomolenik
Contributor I

Hi Robin,

That is probably it. I am trying to use FTM0 for input capture to read a hall effect sensor, and FTM1 for combine mode PWM for driving a servo. I will switch to FTM2 and test that tomorrow. I will come back to mark your answer correct if that fixes the problem. 

Thanks,

Tom

0 Kudos
948 Views
mjbcswitzerland
Specialist V

Hi Thomas

Most likely you have removed some initialisation code that enables clock to the FTM. Any access to an FTM register without the clock gated to it will result in a hard fault.

pastedImage_1.png

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis KE:
- http://www.utasker.com/kinetis/FRDM-KE02Z.html
- http://www.utasker.com/kinetis/FRDM-KE02Z40M.html
- http://www.utasker.com/kinetis/FRDM-KE04Z.html
- http://www.utasker.com/kinetis/FRDM-KE06Z.html
- http://www.utasker.com/kinetis/FRDM-KE15Z.html


For less questions and restrictions, and faster, cheaper developments: try uTasker for Kinetis

0 Kudos