AnsweredAssumed Answered

S32DS PA SDK interrupt management gotcha

Question asked by Dan Teodorescu on Mar 15, 2019
Latest reply on May 23, 2019 by Dan Teodorescu



The function INT_SYS_EnableIRQ() indifferently sets the interrupt priority to a value of FEATURE_INTERRUPT_DEFAULT_PRIO for a specific interrupt source. This function is called by other drivers in the SDK, and the change to the interrupt priority is not obvious to the caller of those other drivers. This will likely result in applications having unintended interrupt priority levels. 


A better solution is to deprecate the call to any interrupt manager (INT_SYS_*()) functions from the other sdk drivers such that only user code makes changes to the INTC registers. Furthermore, INT_SYS_EnableIRQ() should only ensure that the requesting core will be notified on the interrupt request, but it should not change the interrupt priority level. The other drivers should control interrupt requests by enabling or disabling their respective module's interrupt enable configuration registers. I.e. interrupts requests are controlled at the source rather than at the INTC module.


Dynamic interrupt priority adds unnecessary complexity and possibly  bugs in the design. The proposed interrupt management model described above would support a static interrupt priority assignment loaded once by the application at startup.


Thank you,