Dear all.
I am trying to configure different interrupts on a KL 17Z256 processor ( KSDK1.0.0 and Kinetis 2.0 IDE.) but run into problems when several interrupts arrive within a short time frame. My main loop then simply get stuck.
Hence I have some questions.
1) Are nestled interrupts enabled as default, that is, will my ISR routine get interrupted for other interrupts of higher prio?
2) Do I need to run PORT_HAL_ClearPinIntFlag after entering the ISR, or is this handled by itself. I have seen many different ideas about this on the internet, and in ARMs documention they state that the flag is cleared after entering the ISR.
Kind Regards
Peter Abdelmassih Waller
Solved! Go to Solution.
Hi Peter,
1) Are nestled interrupts enabled as default, that is, will my ISR routine get interrupted for other interrupts of higher prio?
Yes, the lower interrupt will be preempted by the higher interrupt.
2) Do I need to run PORT_HAL_ClearPinIntFlag after entering the ISR, or is this handled by itself. I have seen many different ideas about this on the internet, and in ARMs documention they state that the flag is cleared after entering the ISR.
You need to use the PORT_HAL_ClearPinIntFlag function to clear the status of the GPIO interrupt.
Hope it helps.
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Another question...if only higher prio interrupts lower prio, then nested interrupts are not "turned on" in my case since I didnt change any priorities and they are problaby all equal (zero??).
Is correct then that only system interrupts (not possible to change prio on those) that will interrupt my onging ISRs?
Kind Regards
Peter
Hi Jeremy,
thank you for your support, it will surely help in the troubleshooting.
Is it correct that an interrupt will not be preempted by another one with the same priority?
Kind Regards
Peter
Hi Peter,
Thanks for your reply.
1) Is it correct that an interrupt will not be preempted by another one with the same priority?
No.
And I'd highly recommend you to learn the more information about the NVIC from the ARM website whose link is below.
ARM Information Center
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Peter,
1) Are nestled interrupts enabled as default, that is, will my ISR routine get interrupted for other interrupts of higher prio?
Yes, the lower interrupt will be preempted by the higher interrupt.
2) Do I need to run PORT_HAL_ClearPinIntFlag after entering the ISR, or is this handled by itself. I have seen many different ideas about this on the internet, and in ARMs documention they state that the flag is cleared after entering the ISR.
You need to use the PORT_HAL_ClearPinIntFlag function to clear the status of the GPIO interrupt.
Hope it helps.
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------