s32K344 FLEXCAN3~CAN5 inital fail problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

s32K344 FLEXCAN3~CAN5 inital fail problem

Jump to solution
579 Views
tianxing
Contributor III

Dear sir:

I use EB to configure the flexcan module code for s32k344.

And we use 6 can channels Flexcan0~can2 is initalized OK but flex can3~can5 cannot do the software reset.I debugged the code and found that can3~can5 all failed in the below part which returnResult is FLEXCAN_STATUS_TIMEOUT and I also checked the SOFTRST register is always keep 1 cannot change to 0.Is there any difference between can0 ~can2 and can3~can5 need to be configured in EB? I cannot find the reason why can3~can5 can not work.The attach file  is the EB project please help me solve this problem.

base->MCR = (base->MCR & ~FLEXCAN_MCR_SOFTRST_MASK) | FLEXCAN_MCR_SOFTRST(1U);
/* Wait for reset cycle to complete */
timeStart = OsIf_GetCounter(FLEXCAN_IP_SERVICE_TIMEOUT_TYPE);
while (((base->MCR & FLEXCAN_MCR_SOFTRST_MASK) >> FLEXCAN_MCR_SOFTRST_SHIFT) != 0U)
{
timeElapsed += OsIf_GetElapsed(&timeStart, FLEXCAN_IP_SERVICE_TIMEOUT_TYPE);
if (timeElapsed >= uS2Ticks)
{
returnResult = FLEXCAN_STATUS_TIMEOUT;
break;
}
}

0 Kudos
1 Solution
565 Views
tianxing
Contributor III

Problem is solved I forgot the configure the clock for CAN3~CAN5

View solution in original post

0 Kudos
2 Replies
566 Views
tianxing
Contributor III

Problem is solved I forgot the configure the clock for CAN3~CAN5

0 Kudos
576 Views
tianxing
Contributor III

The attach files are the S32DS project.

0 Kudos