Invalid function pointer exception

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

Invalid function pointer exception

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

I am trying to write a exception handler to catch invalid function pointer calls for Uc MK20DX256(cortex M4). I was assuming a hard fault exception would be raised for such calls unfortunately that doesn't seem to be the case. I had enabled the hard fault in the PE cpu components. PE created a hard fault exception catch routine. Tried catching this exception by enabling a breakpoint in the exception catch routine but this break point was never hit. It would be great if anyone could give clarity on the following:

1. Does Hard fault exception get raised during invalid function pointer calls ?

2. If Yes, whats it that I am doing wrong ?

3. If no, whats a good way to catch invalid function pointer calls ?@

ラベル(1)
1 解決策
958件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Sudeep,

   Thank you for your interest in NXP kinetis product, I would like to provide service for you.

    Next time, please let us know the kinetis chip part number, as you know, K20 have a lot of series, 50Mhz, 72Mhz, 100Mhz etc.

   In your PE configuration, don't just enable the hardfault, you can enable all the fault interrupt:

pastedImage_1.png

  I think you especially need to enable the usage fault.

  From the ARM cortex-M4 device generic user guide, we can know these exception types:

pastedImage_2.png

pastedImage_3.png

So, enable all the fault interrupt, then try it again.

If you still have problems, you can send me your test project, I will help you to check it.

You also can stop the running during debugging after you run the exceptions, just to check where the code is stopping.

Any updated information, just let me know.


Have a great day,
Kerry

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

元の投稿で解決策を見る

3 返答(返信)
959件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Sudeep,

   Thank you for your interest in NXP kinetis product, I would like to provide service for you.

    Next time, please let us know the kinetis chip part number, as you know, K20 have a lot of series, 50Mhz, 72Mhz, 100Mhz etc.

   In your PE configuration, don't just enable the hardfault, you can enable all the fault interrupt:

pastedImage_1.png

  I think you especially need to enable the usage fault.

  From the ARM cortex-M4 device generic user guide, we can know these exception types:

pastedImage_2.png

pastedImage_3.png

So, enable all the fault interrupt, then try it again.

If you still have problems, you can send me your test project, I will help you to check it.

You also can stop the running during debugging after you run the exceptions, just to check where the code is stopping.

Any updated information, just let me know.


Have a great day,
Kerry

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

958件の閲覧回数
sudeepchandrase
Contributor II

Hi Kerry,

Thanks for your response. RESOLVED.

0 件の賞賛
返信
958件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Sudeep Chandrasekaran,

You are welcome!

 If your problem is solved, could you help to mark the correct answer? Just to close the case, thank you!


Have a great day,
Kerry

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

0 件の賞賛
返信