Invalid function pointer exception

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Invalid function pointer exception

跳至解决方案
1,077 次查看
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 解答
961 次查看
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 回复数
962 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

961 次查看
sudeepchandrase
Contributor II

Hi Kerry,

Thanks for your response. RESOLVED.

0 项奖励
回复
961 次查看
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 项奖励
回复