Part Number: LAUNCHXL-F28P55X
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE
Tool/software:
Hello,
We have configured MCAN [Classic configuration with 125Kbps] using Sysconfig. [Sysconfig Version 1.23.0 & C2000Ware Version 5.4.0.00]. We have successfully implemented transmit. But, we have partially successful in implementing the reception part using sysconfig tool. The reason for the failure is ISR is being triggered only for the first time & all subsequent reception of CAN messages has failed to trigger ISR. In order to get it to trigger again, We had to utilize some of the functions from CAN initialize called in Board_init() of Board.c. Also, none of the interrupt clearing has helped in re-establishing ISR.
We have tried all the mentioned solution given under the thread below & none of them were useful
[Please refer the code snippet].
__interrupt void INT_PWR_CAN_0_ISR(void)
{
//uint32_t intrStatus;
MCAN_RxNewDataStatus newData;
intrStatus = MCAN_getIntrStatus(MCANA_DRIVER_BASE);
//
// Clear the interrupt Status.
//
MCAN_clearIntrStatus(MCANA_DRIVER_BASE, intrStatus);
//
// Clearing the interrupt lineNum
//
MCAN_clearInterrupt(MCANA_DRIVER_BASE, 0x1); // Clear Int Line 0
//
// Check to see if the interrupt is caused by a message being
// received in dedicated RX Buffers
//
if((MCAN_INTR_SRC_RX_FIFO0_NEW_MSG & intrStatus) == MCAN_INTR_SRC_RX_FIFO0_NEW_MSG)
{
//
// Read the NewData registers
//
MCAN_getNewDataStatus(MCANA_DRIVER_BASE, &newData);
// If message is received in buffer element 0
if((newData.statusLow & (1UL << 0U)) != 0)
{
MCAN_readMsgRam(MCANA_DRIVER_BASE, MCAN_MEM_TYPE_BUF, 0U,
0, &rxMsg1);
if((rxMsg[0].id >> 18U) == 0x40)
{
}
else if((rxMsg[0].id >> 18U) == 0x42)
{
}
}
//
// Clearing the NewData registers
//
MCAN_clearNewDataStatus(MCANA_DRIVER_BASE, &newData);
newData.statusLow = 0;
}
else
{
//error++;
//
// Interrupt handling for other interrupt sources goes here
//
}
//
// Acknowledge this interrupt located in group 9
//
Interrupt_clearACKGroup(INT_PWR_CAN_0_INTERRUPT_ACK_GROUP);
//-----------------------------------------------------------------------------------
This code snippet used for re-initialising the ISR to get it to trigger subsequently
MCAN_StdMsgIDFilterElement stdFiltelem_PWR_CAN;
MCAN_setOpMode(PWR_CAN_BASE, MCAN_OPERATION_MODE_SW_INIT);
while (MCAN_OPERATION_MODE_SW_INIT != MCAN_getOpMode(PWR_CAN_BASE));
stdFiltelem_PWR_CAN.sft = MCAN_STDFILT_RANGE;
stdFiltelem_PWR_CAN.sfec = MCAN_STDFILTEC_RXBUFF;
stdFiltelem_PWR_CAN.sfid1 = 64;
stdFiltelem_PWR_CAN.sfid2 = 0;
MCAN_addStdMsgIDFilter(PWR_CAN_BASE, 0U, &stdFiltelem_PWR_CAN);
stdFiltelem_PWR_CAN.sft = MCAN_STDFILT_RANGE;
stdFiltelem_PWR_CAN.sfec = MCAN_STDFILTEC_RXBUFF;
stdFiltelem_PWR_CAN.sfid1 = 66;
stdFiltelem_PWR_CAN.sfid2 = 0;
MCAN_addStdMsgIDFilter(PWR_CAN_BASE, 1U, &stdFiltelem_PWR_CAN);
MCAN_lpbkModeEnable(PWR_CAN_BASE, MCAN_LPBK_MODE_EXTERNAL, false);
MCAN_setOpMode(PWR_CAN_BASE, MCAN_OPERATION_MODE_NORMAL);
while (MCAN_OPERATION_MODE_NORMAL != MCAN_getOpMode(PWR_CAN_BASE));
//-----------------------------------------------------------------------------------
}





Regards,
Sharath




