I like to receive an interrupt when I receive a can message. I see that the is a message is received and there is a interrupt request CANGIF0.GMIF0 and CANGIF0.MIV data. But after that, there is no PIE FR interrupt request. So between the CAN and PIE(FR Flag) the request is lost. I can't find how that is done or which bit i'm missing.
Any suggestion?
This is my code:
void ECAN_enableINT (HAL_Handle handle)
{
PIE_Obj *pie = (PIE_Obj *)handle->pieHandle;
EALLOW;
PIE_enable (pie); // Enable the PIE block
pie->ECANAINT0 = &CANint;
CANOBJ.ECanaRegs->CANMIL.all = 0x0; //The mailbox interrupt is generated on interrupt line 0.
CANOBJ.ECanaRegs->CANGIM.all=0x01; // Set CANINT0
CANOBJ.ECanaRegs->CANMIM.all=0X7FF; // Enable mailboxes for int
pie->PIEIER_PIEIFR[9].IER |= (1 << 5); // PIE Group 9, INT5 CANI0
unsigned x=IER ; // Enable CPU INT
x|= 0x100;
IER=x;
EDIS;
EINT;
}
Thanks!