Hard fault when configuring 2-channel FTM on E series

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Hard fault when configuring 2-channel FTM on E series

ソリューションへジャンプ
1,774件の閲覧回数
rev
Contributor III

I'm seeing a hard fault exception when configuring FTM0 or FTM1 (both 2 channels) on a MK02Z16 device (also tested on KE06Z with same results).  The same code sequence works fine on FTM2 which 8 channels so not sure if that's a factor.  All of the example code I've found is for FTM2.

The code is simple:

SIM->SCGC |= SIM_SCGC_FTM1_MASK;

FTM1->MODE |= FTM_MODE_WPDIS_MASK;

The second line generates a hard-fault.  However writes to certain FTM registers do not generate hard faults (for example a write to the SC register is OK, so it appears that writes to legacy TPM registers are OK).

Is anyone aware of special considerations for FTM0 and FTM1 on E series devices?

ラベル(1)
1 解決策
1,443件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jonathan,

(For example  the KE06 )

- Which IDE do you  use , could you show all the code of  the FTM0 initialization ?

- The FTM0/FTM1 with basic TPM functions , the FTM2 module with full functions , also the available registers are different .

    (You can refer to the Reference manual pg82)

- If you use KDS or CW , you can use the PE to configure it , then you can see the generate code like this :

pastedImage_0.png

Hope it helps

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

Have a great day,

Alice

元の投稿で解決策を見る

2 返答(返信)
1,444件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jonathan,

(For example  the KE06 )

- Which IDE do you  use , could you show all the code of  the FTM0 initialization ?

- The FTM0/FTM1 with basic TPM functions , the FTM2 module with full functions , also the available registers are different .

    (You can refer to the Reference manual pg82)

- If you use KDS or CW , you can use the PE to configure it , then you can see the generate code like this :

pastedImage_0.png

Hope it helps

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

Have a great day,

Alice

1,443件の閲覧回数
rev
Contributor III

Thanks Alice.  I didn't realize that FTM0 and FTM1 are not really FTM modules but TPM modules.  It's confusing because the FTM chapter lists registers that don't actually exist!  I wish that the reference manual chapters were specific to the actual functionality of the part.

I've changed my code to use TPM functions only for FTM0 and FTM1.

0 件の賞賛
返信