how to handle nested interrupt (interrupt within an interrupt) in S32K144

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

how to handle nested interrupt (interrupt within an interrupt) in S32K144

2,164 Views
d_shivamkumar
Contributor III

for my project i'm reading I2C data with I2C_master_interrupt. i am also having port interrupt configured. i've also taken care of the priorities of both the interrupts. still whenever the execution is in port interrupt and if i2c interrupt comes, it is not jumping to the new ISR. please help

Labels (1)
6 Replies

2,035 Views
d_shivamkumar
Contributor III

i've resolved it now. instead of setting priority to 0x03 we are supposed to set priority as 0x30. only upper nibble should be used for priority and lower nibble should be always zero. basically priority should have only 0-15 levels.

0 Kudos

2,035 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello, 

Are you clearing the interrupt in the handler of the port interrupt? Based on what you mentioned it seems to me that you are not clearing the port interrupt and due to this your program is stuck in the port handler interrupt. 

Regards, 

Victor 

2,035 Views
d_shivamkumar
Contributor III

are you talking about this:

PORTE->PCR[9] |= PORT_PCR_ISF_MASK; /* Clear PORTD ISF flag */

I'm clearing this flag at the end of PORR IRQ and expecting I2C IRQ to be executed before this ISF flag clearing. so all you want to say is that I have to clear the flag before I'm expecting the I2C IRQ???

0 Kudos

2,035 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello,

Yes, I wanted to confirm that you were clearing the port interrupt in the handler. Which of these two interrupts has the highest priority? Could you please share the code that you are using to test this?

Regards,
Victor

0 Kudos

2,035 Views
d_shivamkumar
Contributor III

as I've told you earlier, I'm keeping port priority lower then i2c. i am expecting i2c interrupt occurring while the execution is in port interrupt. I'm clearing port interrupt status flag like this:

"PORTE->PCR[9] |= PORT_PCR_ISF_MASK; /* Clear PORTE ISF flag */".

I'm doing this immediately after entering port ISR. i don't know what I'm missing. please help.

0 Kudos

2,034 Views
d_shivamkumar
Contributor III

port interrupt is having priority of 0x03 and i2c interrupt is having priority of 0x00. so basically I'm putting i2c interrupt on higher priority. 

0 Kudos