SDK2.7.0 CAN drivers still has bug which can cause interrupt process missing, I debug and share the fixed code here.
The code of function MCAN_ClearStatusFlag should be changed from the following:
static inline void MCAN_ClearStatusFlag(CAN_Type *base, uint32_t mask)
{
/* Write 1 to clear status flag. */
base->IR |= mask;
}
to the following:
static inline void MCAN_ClearStatusFlag(CAN_Type *base, uint32_t mask)
{
/* Write 1 to clear status flag. */
base->IR = mask;
}
the problem is operator ‘|=’ will clear all pending flags, correct method is use operator '='
So, NXP and community administrator please fixed it in the next SDK version.
May be some other SDKs also exists this bug.