Hi, I am developing on a FRDM-K66F and I am trying to trap floating point exception by generating an interrupt.
I understand that it should be a usage fault interrupt that will be triggered.
The sample code below show that I am enabling the usage_fault interrupt, I set a priority then I enable all possible floating point exceptions in the Interrupt Status Register (MCM_ISCR) .
If I run this part of code, after the div/0 I see that the MCM detect it because if I read MCM_ISCR back I see 0x9F120200, FDZC is now set as well as the FPSCR[DZC].
Question: What am I missing to generate the interrupt? Code goes through, never calling the ISR (which is a while(1) for now.
float toto=1.0;
SCB->SHCSR|=SCB_SHCSR_USGFAULTENA_Msk |SCB_SHCSR_BUSFAULTENA_Msk |SCB_SHCSR_MEMFAULTENA_Msk;
NVIC_SetPriority (UsageFault_IRQn,0x08);
*(uint8_t *)0xe0080010=(uint8_t)0x9F;
toto=toto/0.0F;
Thanks