NVIC ISR pending bit set by MCU automatically (S32K322)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NVIC ISR pending bit set by MCU automatically (S32K322)

146 Views
Jason_1234
Contributor I

Hi,

We got the ISR re-entry twice but actually it was triggered only once issue, and this issue can happen for all ISRs.

we guess this issue happened due to our process of ISR, details please see our analysis as followings:

  • In CortexM, interrupt flag of NVIC is cleared by hardware automatically;
  • And in our issue projects, we have two ISR functions: 1) ISR map function; 2) User ISR real handler function;
  • When the interrupt triggered, its ISR map function called, we can see the NVIC ISR flag bit is cleared already;
  • After finish its ISR map function, we will execute BX LR to go to the user ISR handler function;
  • In user ISR handler function, we will clear the peripheral isr flag bit to acknowledge the ISR of course;
  • But when software left "BX LR" and the entry of user ISR map function, we find its NVIC ISR pending flag set again by MCU, so after the finish of user ISR handler function, the ISR will be triggered again;
  • We thought it may be relevant to "BX LR", because after it, mcu will switch to the thread mode from handelr mode instead.

Q: Do we have any experience or suggestion for this issue?

Thank you!

0 Kudos
0 Replies