AnsweredAssumed Answered

_int_set_exception_handler issue

Question asked by ismail ghazy on Nov 19, 2015
Latest reply on Dec 2, 2015 by ismail ghazy

I am using a kinetis K60 and MQX 3.8. I am trying to add a custom exception handler. Following the post General Technical MQX FAQ Q: How are exceptions or unhandled interrupts handled by MQX?

 

When I do the following:

 

- Enable divide by zero trap SCB_CCR |= 1<< SCB_CCR_DIV_0_TRP_SHIFT;

- _int_install_exception_isr();

-_task_set_exception_handler(_task_get_id(), task_exception_handler);

- divide by zero in my code (sum = 2/zero; for example)

 

It does indeed go to my task_exception_handler.

 

Here is something I am trying to do:

-SCB_SHCSR |= 0x00070000; // enable Usage Fault, Bus Fault, and MMU Fault

-SCB_CCR |= 1<< SCB_CCR_DIV_0_TRP_SHIFT;

- _int_install_exception_isr();

-_int_set_exception_handler(vectorNum, ISR_exception_handler); // vectorNum are the vector numbers I pass (3,4,5 and 6) hard,mem,bus, and usage fualt.

 

This doesn't work. What Am I doing wrong?

 

Thanks

Outcomes