Urgent: Need help on Hard Fault

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

Urgent: Need help on Hard Fault

ソリューションへジャンプ
1,241件の閲覧回数
0815
Contributor II

I've read something about Hard Faults so far and I'm also using a Hard Fault Handler on my KEA128.

However I can't find the reason what is going wrong here.

This is the line of C code resulting in a Hard Fault:

FTM2_MODE = (FTM_MODE_FAULTM(0x00) | FTM_MODE_WPDIS_MASK);

I can debug this code in Disassembly View:

disassembly.PNG

Actually I'm getting the Hard Fault directly on the first assembly instruction, but before it happend only on the 3rd instruction.

Any hints? Thanks in advance!

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,092件の閲覧回数
bobpaddock
Senior Contributor IV

Is there a clock that needs turned on?

Some peripherals generate a hard fault if they are accessed without their clock running, some don't. 

I find that inconstancy annoying.  Just as annoying it is not documented in the Reference Manual which is which.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,093件の閲覧回数
bobpaddock
Senior Contributor IV

Is there a clock that needs turned on?

Some peripherals generate a hard fault if they are accessed without their clock running, some don't. 

I find that inconstancy annoying.  Just as annoying it is not documented in the Reference Manual which is which.

0 件の賞賛
返信
1,092件の閲覧回数
0815
Contributor II

Yes, you are right!

SIM_SCGC |= SIM_SCGC_FTM2_MASK;

This does the magic.

Thank you, very much!

0 件の賞賛
返信